MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / pay

Function pay

Video 131/components/PaymentPage.js:57–85  ·  view source on GitHub ↗
(amount)

Source from the content-addressed store, hash-verified

55
56
57 const pay = async (amount) => {
58 // Get the order Id
59 let a = await initiate(amount, username, paymentform)
60 let orderId = a.id
61 var options = {
62 "key": currentUser.razorpayid, // Enter the Key ID generated from the Dashboard
63 "amount": amount, // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise
64 "currency": "INR",
65 "name": "Get Me A Chai", //your business name
66 "description": "Test Transaction",
67 "image": "https://example.com/your_logo",
68 "order_id": orderId, //This is a sample Order ID. Pass the `id` obtained in the response of Step 1
69 "callback_url": `${process.env.NEXT_PUBLIC_URL}/api/razorpay`,
70 "prefill": { //We recommend using the prefill parameter to auto-fill customer's contact information especially their phone number
71 "name": "Gaurav Kumar", //your customer's name
72 "email": "gaurav.kumar@example.com",
73 "contact": "9000090000" //Provide the customer's phone number for better conversion rates
74 },
75 "notes": {
76 "address": "Razorpay Corporate Office"
77 },
78 "theme": {
79 "color": "#3399cc"
80 }
81 }
82
83 var rzp1 = new Razorpay(options);
84 rzp1.open();
85 }
86
87
88 return (

Callers 1

PaymentPage.jsFile · 0.85

Calls 1

initiateFunction · 0.90

Tested by

no test coverage detected