Created
August 6, 2020 05:58
-
-
Save ziyadparekh/fcbf138af03d5a6131ba0200ae334b1b to your computer and use it in GitHub Desktop.
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
<!-- Add this script tag to the <head> of the Checkout demo page !--> | |
<script type="text/javascript" src="https://storage.googleapis.com/safepayobjects/api/safepay-checkout.min.js"></script> | |
<!-- Add this script tag to the <head> of the Checkout demo page !--> | |
<!-- Add this script tag to the end of the <body> of the Checkout demo page !--> | |
<script type="text/javascript"> | |
safepay.Button.render({ | |
env: 'production', | |
amount: 100, | |
client: { | |
"sandbox": "sec_8dcac601-4b70-442d-b198-03aadd28f12b" | |
"production": "sec_eed0afc4-1893-45d5-83c3-c917f88838d3" | |
}, | |
payment: function (data, actions) { | |
return actions.payment.create({ | |
transaction: { | |
amount: 100, | |
currency: 'PKR' | |
} | |
}) | |
}, | |
onCancel: function (data, actions) { | |
console.log("payment cancelled") | |
}, | |
onCheckout: function(data, actions) { | |
console.log("You completed the payment!"); | |
} | |
}, '#safepay-demo-button'); | |
</script> | |
<!-- Add this script tag to the end of the <body> of the Checkout demo page !--> | |
<!-- | |
Remove the current Safepay Checkout demo button and instead | |
create an empty <div /> where the checkout demo button is and give it an id of "safepay-demo-button" | |
!--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there way to set prefill customer/billing details?