-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathapp.html
More file actions
68 lines (64 loc) · 2.37 KB
/
app.html
File metadata and controls
68 lines (64 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Razorpay Python Sample App</title>
</head>
<body>
<button id="rzp-button1">Pay with Razorpay</button>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<form action="charge" method="POST" name="razorpayForm">
<input type="hidden" id="payment_id" name="razorpay_payment_id" />
<input type="hidden" id="amount" name="amount" />
</form>
<script>
// Checkout details as a json
var amount = 5100;
var options = {
'key': '', // Add you key here
'amount': amount,
"name": "DJ Tiesto",
"description": "Tron Legacy",
"image": "https://s29.postimg.org/r6dj1g85z/daft_punk.jpg",
"prefill": {
"name": "Daft Punk",
"email": "customer@merchant.com",
"contact": "+919999999999",
},
"notes": {
"address": "Hello World",
"merchant_order_id": "12312321",
},
"theme": {
"color": "#F37254"
}
}
/**
* The entire list of Checkout fields is available at
* https://docs.razorpay.com/docs/checkout-form#checkout-fields
*/
options.handler = function (response) {
document.getElementById('payment_id').value = response.razorpay_payment_id;
document.getElementById('amount').value = amount;
document.razorpayForm.submit();
};
// Boolean whether to show image inside a white frame. (default: true)
options.theme.image_padding = false;
options.modal = {
ondismiss: function () {
console.log("This code runs when the popup is closed");
},
// Boolean indicating whether pressing escape key
// should close the checkout form. (default: true)
escape: true,
// Boolean indicating whether clicking translucent blank
// space outside checkout form should close the form. (default: false)
backdropclose: false
};
var rzp = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function (e) {
rzp.open();
e.preventDefault();
}
</script>
</body>
</html>