Skip to content

Instantly share code, notes, and snippets.

@ziyadparekh
Created August 6, 2020 05:58
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 ziyadparekh/fcbf138af03d5a6131ba0200ae334b1b to your computer and use it in GitHub Desktop.
Save ziyadparekh/fcbf138af03d5a6131ba0200ae334b1b to your computer and use it in GitHub Desktop.
<!-- 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"
!-->
@muneebriaz
Copy link

is there way to set prefill customer/billing details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment