Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafiahmedd/01c6d0c303727781badf5b770c526cb6 to your computer and use it in GitHub Desktop.
Save rafiahmedd/01c6d0c303727781badf5b770c526cb6 to your computer and use it in GitHub Desktop.
Redirect to a page after payment success
$method = ['paypal','stripe'];
foreach($method as $mode){
add_action('fluent_payment_frameless_'.$mode, 'afterPayment',10,1);
}
function afterPayment($data){
//$tansiction = FluentFormPro\Payments\PaymentMethods\BaseProcessor::getTransaction($data['transaction_hash'],'transaction_hash');
//dd($tansiction->status);
/*if($data['type']== 'success' && $tansiction->status){
echo "<script>
window.location.href='https://google.com';
</script>";
}*/
if($data['type']== 'success'){
$url = 'https://www.google.com';
wp_redirect($url);
exit();
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment