Description
Filters Stripe sessionโs cancel URL, which is the URL that users will be sent to after canceling the payment on Stripe.
Usage
1 | add_filter( 'gform_stripe_cancel_url' , 'your_function_name' , 10, 2 ); |
Example
1 2 3 4 5 6 7 | add_filter( 'gform_stripe_cancel_url' , function ( $url , $form_id ) { GFCommon::log_debug( __METHOD__ . '(): Original URL: ' . $url ); // Replace example.com with your site domain. $url = str_replace ( 'localhost' , 'example.com' , $url ); GFCommon::log_debug( __METHOD__ . '(): New URL: ' . $url ); return $url ; }, 10, 2 ); |
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Stripe 3.0.
Source Code
This filter is located in class-gf-stripe.php.