Skip to content

Instantly share code, notes, and snippets.

@vanbo
Created February 25, 2019 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanbo/d30261be5dc6888a01458cc33edbdeac to your computer and use it in GitHub Desktop.
Save vanbo/d30261be5dc6888a01458cc33edbdeac to your computer and use it in GitHub Desktop.
WC Paysafe Custom redirect url
add_filter( 'wc_paysafe_payment_customer_redirect_url', 'prefix_custom_redirect_url', 10, 3 );
function prefix_custom_redirect_url( $url, $status, $order_id ) {
/**
* $status possible values are:
* 'success',
* 'error',
* 'hold',
* 'timeout',
* 'decline',
*/
if ( 'decline' == $status ) {
$url = 'https://your-domain-url.com';
}
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment