# Indian Payment Gateway Solution/ RazorPay Checkout

**URL:** <https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888>\
**Category:** Project Showcase\
**Created:** [August 28, 2020, 1:13pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888 "2020-08-28T13:13:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [August 28, 2020, 1:13pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/1 "2020-08-28T13:13:18Z")

</div>

Hello there, I’m showcasing you how we can able to integrate Razorpay checkout & API.

RazorPay Supports **UPI, Debit Cards, Credit Cards, Pay Later/ EMI, Netbanking, Wallet**

I’ve integrated Razorpay’s payment link API.  
Implemented on one glide’s template.

[https://razorpay.glideapp.io](https://razorpay.glideapp.io)

There are multiple ways to integrate this,

1. In this demo app, App will send the Payment link on mobile no.as a text SMS as well as on email address just in 4-5 sec. Customers can pay directly from that unique link.

2. Retrieving custom url to app itself. So, generating real-time link is so easy, but fetching that link to glide needs in-app load facility. Only Pro Apps will allow that, you’ve to wait 7-10 Seconds for that. You can put a loader gif even. And then you can also put webview this pay link.

3. If your products are less, then you can generate links at the time of registration for the first time.

I found it so easy and flexible with RazorPay. Even it’s API Documentation is too easy to implement.  
You can generate unlimited links.

Here you can create Razorpay account [https://rzp.io/i/ordIOjC](https://rzp.io/i/ordIOjC)

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [October 26, 2020, 8:46pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/2 "2020-10-26T20:46:10Z")

</div>

Hey @Purvang_Joshi,

This is really awesome work. I have been trying to integrate Paytm into my app, but only half way there.

what I did was, create a Paytm business account. then used the dashboard to create a set of payment links, 50,100,200,300. ( since all my products are within that range) then attached those links to buttons and make them appear based on what product users selects. this either takes them directly to Paytm website or open the app for direct payment with the amount pre selected.

The only issue i have is gettign the order status back into my google sheet. I dont any experiece with API integration and dont know how to call the API via JSON into the sheet with appscripts. **Is there a way you could help me on this?** If i can call the api value of transaction ID/Order ID into the sheet, i can match that with the mobile or email user registerted with and credit the amount into the app.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [October 27, 2020, 12:18am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/3 "2020-10-27T00:18:38Z")

</div>

Sure. Will look into this. Based on my experience with Indian payment gateway, the api infrastructure of razorpay is too good other than new in the market. You’ve more flexibility in terms of transaction management.  
I’ve one client who wants to transfer 40% of the transaction value to the merchant on the product bases. I’ve implemented this type of cases and it worked best for me.  
I’ll sure work on paytm case asap. ✌

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [November 30, 2020, 10:45am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/4 "2020-11-30T10:45:07Z")

</div>

@Purvang_Joshi and @Manan_Mehta I just came across [https://www.pabbly.com/](https://www.pabbly.com/) which integrates various payment gateway with Google Sheet using Webhook.

They also have easy to understand videos on how it works.

> **[Pabbly](https://www.youtube.com/channel/UCVA5GKy8qpDxQR5xSt_zcJg)**
>
> Pabbly is an application which allows you to manage all your sales and marketing task from a single platform. Whether its managing subscription for your customers, sending bulk emails, creating subscription forms, verifying email list and much more;...

Just thought to share it with you.

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [December 2, 2020, 8:08am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/5 "2020-12-02T08:08:55Z")

</div>

Hi @Purvang_Joshi can you please share a tutorial or documentation, on how to integrated razorpay into glide?

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [December 2, 2020, 12:54pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/6 "2020-12-02T12:54:01Z")

</div>

Hey, will share you for sure next week.

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [December 6, 2020, 11:58am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/7 "2020-12-06T11:58:48Z")

</div>

Hey Bro, sorry to bother but any update on this?

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [December 8, 2020, 9:04am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/8 "2020-12-08T09:04:55Z")

</div>

Hey, I’m away from work. Will be back after 12th.

---

<div class="post-metadata">

**Author:** ![wtzr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wtzr/32/14870_2.png) [@wtzr](https://community.glideapps.com/u/wtzr)\
**Post date:** [February 8, 2021, 12:18pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/9 "2021-02-08T12:18:26Z")

</div>

HI Purvang,

Thanks for this topic. A few questions.

- Does razorpay include all common online payment methods for India? (i’m from Europe, and diving into the Indian market right now).
- Do Indian people generally prefer their prices in Rupee or would Dollar work as well?
- Can I see an integration of Razorpay in an app? (I checked your app in the comments, but for me it just functions as a form. I’m not being redirected, maybe i’m missing something)

Thanks!  
Wouter

---

<div class="post-metadata">

**Author:** ![wtzr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wtzr/32/14870_2.png) [@wtzr](https://community.glideapps.com/u/wtzr)\
**Post date:** [February 8, 2021, 2:45pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/10 "2021-02-08T14:45:04Z")

</div>

Just noticed razorpay does not accept companies outside India ☹

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [February 8, 2021, 3:18pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/11 "2021-02-08T15:18:55Z")

</div>

Yes. I think you may need registration of indian company. You can establish foreign unit if your company matured enough.

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [February 10, 2021, 9:43am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/12 "2021-02-10T09:43:04Z")

</div>

Hi @Purvang_Joshi

Can you please share a tutorial on this? I am trying to integrate Razorpay in my app but I have no idea how API works.

Thanks

Pratik

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [February 10, 2021, 11:46am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/13 "2021-02-10T11:46:24Z")

</div>

Hey,  
I’m on my way to do this. You’ll receive it shortly.

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [February 10, 2021, 12:44pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/14 "2021-02-10T12:44:47Z")

</div>

Thanks Purvang. Would be really helpful.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 2, 2021, 7:14pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/15 "2021-03-02T19:14:45Z")

</div>

Hey @Pratik_Shah  
RazorPay has introduced a new version for Payment Links API. I was figuring out last week how we can integrate in such a way that it interacts with us faster and smoother process.

In this method, we’ll be sending Payment Links (UPI & Standard) to customers.  
When a button clicks, we’ll fire an API that is located at Apps Script. Then, the Customer will receive a text message or email message of the payment procedure.

**Types of Payment Links:**  
First of all, we need to check, we have a legacy API Contract configured or a new one.  
For that, you need to refer to this [Payment Links](https://razorpay.com/docs/api/payment-links/)  
For mine, it’s a new API contract

**UPI:** It’s working on Android Only as of now. When the customer clicks the payment link, all UPI apps installed on the phone will appear.  
**Standard:** For all type of payment methods.

# Fire an API
**Step: 1** Create API key from RazorPay Dashboard  
**Step: 2** We're going to create UPI enabled payment link. Copy this code  
  
`
function doGet(e) {
    //Displays the text on the webpage.
    return ContentService.createTextOutput("This is a GET Request!");
}
function doPost(e) {
```
var body = JSON.parse(e.postData.contents);
var name = body["params"]["Name"]["value"];
var email = body["params"]["Email"]["value"];
var number = body["params"]["Number"]["value"];
var Desc = body["params"]["Description"]["value"];
var Fees = body["params"]["Fees"]["value"];
var Rfrnc = body["params"]["Reference"]["value"];

```
var headers = {
“Authorization”: Basic ${Utilities.base64Encode("API KEY:VALUE")}
};
var customer = {
“name”: name,
“email”: email,
“contact”: number
};
var payload = {
“amount”: Fees,
“currency”: “INR”,
“description”: Desc,
“customer”: customer,
“notify”: {
“sms”: true,
“email”: true
},
“upi_link”: “true”,
“callback_url”: “https://example-callback-url.com/”,
“callback_method”: “get”
}
var options = {
“method” : “post”,
“payload” : JSON.stringify(payload),
‘headers’: headers,
‘contentType’: ‘application/json’,
};
`

`var url = “https://api.razorpay.com/v1/payment_links”;
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);
}
`

**Step 3:** Click deploy button on right top corner of the apps script. Click on setting button then deploy it as a web app. Then select access as anyone. After final clicking on deploy button, you’ll have a URL. Copy that URL.

**Step: 4** Make a Webhook Action Button on Glide App.  
Paste URL to API Input Value.  
Add the Following Values and Link them with your tables.  
`Name
Email
Number
Description
Fees
Reference`  
**Note:** You can add more parameter. Here is API Reference, [Payment Links](https://razorpay.com/docs/api/payment-links/new/#create-payment-link) Copy Parameters from Request body. Add them to Payload and also fetch it from postdata.  
**Note:** If you want to make a link for 245 Rs then the value of your fees will be 24500. You’ve to add paise as two figure value. Don’t add (.)  
**Note:** Reference ID Should be Unique. You can even assign Row ID.

# Getting Back to the Sheets
**Whenever user pays successfully, razorpay's webhook will send us data.**  
**Step: 1** Create a new Apps Script Project. Don't add to the existing File. Because Already one web app deployed over there.  
**Step: 2** Copy this code, enter the fields you need to print in sheet. Enter extra parameters from this sample payload,   
https://razorpay.com/docs/webhooks/payloads/#payment-link-paid   

Code:  
`
function doGet(e) {
//Displays the text on the webpage.
return ContentService.createTextOutput(“This is a GET Request!”);
}`

`
function doPost(e) {
```
var body = JSON.parse(e.postData.contents);
var amount = body["payload"]["payment_link"]["entity"]["amount"];
var description = body["payload"]["payment_link"]["entity"]["description"];
var email = body["payload"]["payment_link"]["entity"]["customer"]["email"];
var contact = body["payload"]["order"]["entity"]["customer"]["contact"];
var created_at = body["payload"]["payment_link"]["entity"]["created_at"];
// Add Extra Fields you need

```
//Converting Created Date (Unix) to GMT Formatted
```
var formattedDate = Utilities.formatDate(created_at, "GMT+5:30", "MM-dd-yyyy HH:mm:ss");
var sheet = SpreadsheetApp.getActive().getSheetByName("Webhook");

sheet.appendRow([amount,description,email,contact,formattedDate]);  

```
`

`}
`

**Step: 3**  
Deploy it as a web app and copy url.

**Step: 4**  
Go to RazorPay Dashboard → Settings → Webhook → Add New Webhook → Paste COPIED URL → Scroll to the last → Activate “payment\_link.paid” Action

Now it’ll automatically send data to the sheets.

Let me know If any error occurs. This also can be integrate with Integromat and it’s also so much easy. But this saves a lot of bucks. There are many methods/ API you can integrate with razorpay and glide. It depends upon your usecase.

@Manan_Mehta Hey Dude, Check this. I’ve made it through Webhook Actions.  
@Amal Hey, Sorry for the late. This tutorial will surely help you to understand how this works.

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [March 3, 2021, 3:35am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/16 "2021-03-03T03:35:54Z")

</div>

🤯

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [March 3, 2021, 4:03am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/17 "2021-03-03T04:03:45Z")

</div>

Thank you @Purvang_Joshi for your time to share the details. Simply amazing!

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sam1/32/24823_2.png) [@sam1](https://community.glideapps.com/u/sam1)\
**Post date:** [April 17, 2021, 4:41pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/18 "2021-04-17T16:41:47Z")

</div>

is razorpay free?

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [April 18, 2021, 11:08am UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/19 "2021-04-18T11:08:05Z")

</div>

No. Each payment gateway charges 1 to 5 percentage on transaction.  
Its vary on payment mode.

Razorpay offers 3 months of zero convenience fee. Don’t know whether its working currently or not.

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sam1/32/24823_2.png) [@sam1](https://community.glideapps.com/u/sam1)\
**Post date:** [April 22, 2021, 4:11pm UTC](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888/20 "2021-04-22T16:11:57Z")

</div>

Do they charge for integrating them to our app? Or only on transactions?

[Next page](https://community.glideapps.com/t/indian-payment-gateway-solution-razorpay-checkout/14888.md?page=2)
