Skip to content

Instantly share code, notes, and snippets.

@fayazara
Created April 21, 2020 09:46
Show Gist options
  • Save fayazara/f77fe35d075cfc8b8f390ec6181fddd1 to your computer and use it in GitHub Desktop.
Save fayazara/f77fe35d075cfc8b8f390ec6181fddd1 to your computer and use it in GitHub Desktop.
Make Payments with Razorpay
order() {
const rzp_options = {
key: "YOUR_RAZORPAY_KEY",
amount: this.product.price * 100,
name: "The Bollywood Store",
description: this.product.title,
handler: function(response) {
alert(`Payment Succesful ${response.razorpay_payment_id}`)
},
modal: {
ondismiss: function() {
alert(`Payment Failed`)
}
},
prefill: {
email: 'test@email.com',
contact: +914455667788
},
notes: {
name: "Customer Name",
item: self.product.title,
},
theme: {
color: "#667eea"
}
};
const rzp1 = new Razorpay(rzp_options);
rzp1.open();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment