Created
August 4, 2021 22:50
-
-
Save rafiahmedd/01c6d0c303727781badf5b770c526cb6 to your computer and use it in GitHub Desktop.
Redirect to a page after payment success
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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