Triggering Custom Functions
We have these custom triggers on payment completion:
  • payment_page_payment_received
  • payment_page_subscription_created
Here are examples about how they work:
1
//**
2
* gateway
3
* name
4
* email
5
* amount
6
* amount_received
7
* currency
8
* payment_page_url
9
* payment_page_id
10
* domain_name
11
*
12
* Will also contain custom fields or URL Params provided, use the file_put_contents to debug this if you wish, or use the HTTP Request Method ( on paid version ) with https://requestbin.com/
13
*/
14
add_action( 'payment_page_payment_received', function( $information ) {
15
// Example code for advanced debugging
16
file_put_contents( $information, WP_CONTENT_DIR . '/payment_page_payment_received-' . time() . '.json', json_encode( $information, JSON_PRETTY_PRINT ) );
17
}, 10 );
18
19
/**
20
* gateway
21
* name
22
* email
23
* amount
24
* amount_received
25
* currency
26
* payment_page_url
27
* payment_page_id
28
* domain_name
29
*
30
* Will also contain custom fields or URL Params provided, use the file_put_contents to debug this if you wish, or use the HTTP Request Method ( on paid version ) with https://requestbin.com/
31
*/
32
add_action( 'payment_page_subscription_created', function( $information ) {
33
// Example code for advanced debugging
34
file_put_contents( $information, WP_CONTENT_DIR . '/payment_page_subscription_created-' . time() . '.json', json_encode( $information, JSON_PRETTY_PRINT ) );
35
}, 10 );
Copied!
Copy link