Skip to content

Instantly share code, notes, and snippets.

@ziyadparekh
Last active September 16, 2020 06:33
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/e55a196ad343850b65be8f9e00308078 to your computer and use it in GitHub Desktop.
Save ziyadparekh/e55a196ad343850b65be8f9e00308078 to your computer and use it in GitHub Desktop.
Safepay Integration
safepay.Button.render({
env: 'sandbox',
amount: 6800.57,
client: {
"sandbox": "sec_4f84abd2-0bae-4476-be6b-22c8c9e35133"
"production": "<YOUR_CLIENT_KEY>"
},
payment: function (data, actions) {
return actions.payment.create({
transaction: {
amount: 6800.57,
currency: 'PKR'
}
})
},
onCancel: function (data, actions) {
console.log(data)
console.log(actions)
},
onCheckout: function(data, actions) {
console.log(data)
console.log("You completed the payment!");
}
}, '#container');
@HunzlaSheikh
Copy link

How can i use this code in angular typescript? It gives me error "cannot find name safepay"

@ziyadparekh
Copy link
Author

Hey you can check out this link for angular integration.
https://gist.github.com/ziyadparekh/62f04992b544566a9dc01181bf21b3e1

I don’t think we have typescript bindings at the moment though

@HunzlaSheikh
Copy link

Ok thanks. Got it.

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