-
-
Save Sarfroz/f5d94230dec442819e98de86e8b677e8 to your computer and use it in GitHub Desktop.
Revisions
-
Sarfroz created this gist
Dec 5, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ //Process.php $txn='121221|544545'; // any value that you want to get in webhook $sku='sku_G8srn2mAbnQI8k'; // get product id $data=['sku'=>$sku,'email'=>$email,'txn'=>$txn]; // pass this values to php file //redirect.php <html> <head> <title> - Redirecting Please Wait...</title> <!-- Load Stripe.js on your website. --> <script src="https://js.stripe.com/v3"></script> </head> <body> <script> (function() { var stripe = Stripe('');//live key stripe.redirectToCheckout({ items: [{sku: '{{ $data['sku'] }}', quantity: 1}], clientReferenceId:'{{$data['txn']}}', // to get some values in webhook customerEmail: '{{$data['email']}}', // pass email value billingAddressCollection: 'required', // must for indian users successUrl: 'https://www.xyz.com/payments/orders/success', cancelUrl: 'https://www.xyz.com/payments/cancel/true', }) .then(function (result) { if (result.error) { var displayError = document.getElementById('error-message'); displayError.textContent = result.error.message; } }); })(); </script> </body> </html>