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:
//**
* gateway
* name
* email
* amount
* amount_received
* currency
* payment_page_url
* payment_page_id
* domain_name
*
* 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/
*/
add_action( 'payment_page_payment_received', function( $information ) {
// Example code for advanced debugging
file_put_contents( $information, WP_CONTENT_DIR . '/payment_page_payment_received-' . time() . '.json', json_encode( $information, JSON_PRETTY_PRINT ) );
}, 10 );
/**
* gateway
* name
* email
* amount
* amount_received
* currency
* payment_page_url
* payment_page_id
* domain_name
*
* 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/
*/
add_action( 'payment_page_subscription_created', function( $information ) {
// Example code for advanced debugging
file_put_contents( $information, WP_CONTENT_DIR . '/payment_page_subscription_created-' . time() . '.json', json_encode( $information, JSON_PRETTY_PRINT ) );
}, 10 );
Copy link