Steps | What to do |
---|---|
| Register with Razorpay and get an API key |
| Create the app |
| Set up basic app information |
| Set up app authentication |
| Add the "create payment link" action and edit action information and inputs |
| Edit subflow for the action and get action outputs |
| Edit action outputs |
| Install the draft app and test it |
| Add a one-time URL to receive the payment result |
10. Triggers | Add a trigger to send payment result |
11. Testing | Test again |
Users can view your app information before they download your app.
According to Razorpay Auth Document, key_id
and key_secret
are required with Basic Auth authentication.
key_id
and key_secret
:Now we have set up the authentication part of your app, let's add actions!
API used: Create payment link.
Click on Add Items in the Inputs section:
We suggest you fill in the Inputs first and left the Outputs after we finish the subflow for this action.
Put on the necessary description and guidance, and have a check on the preview section for your inputs.
Always remember to click on Save instead of cancel before you exit the action editing.
After editing the action information and inputs, create a sub flow to run when users call this action:
Go to the Flows section and enter the Sub flow we just created:
POST
type, paste the URL, select Body
- raw
- JSON
and then copy the 2 parameters, amount and currency.1000
and INR
with the amount and currency app fields by hitting the </>
button on the right side. In the pop-up, search the field by name and click to select:1000
and the currency to AUD
:{{
to call a field, make sure there is no character like "
right behind it. See the screenshot below.Select Basic Auth, fill in app fields and do remember to put your test key_id
and test key_secret
.
Seems all good now, hit the Test button:
Excellent! The request is completed, and we've got the payment_link_id
and payment_link
that we need from the response data.
payment_link_id
is an ID to track a payment link and payment_link
stores the link itself.
Try visiting the payment link:
Perfect! Now how do we return the payment link and the ID to the chatbot? Don't forget that we haven't set up the Action Outputs yet!
Save and publish your subflow, then let's get back to the Actions section:
On your dashboard, follow the screenshots below to install your app in the draft version since it hasn't been published yet:
TIP - When a message is displayed in Live Chat conversation, it means the system has sent it out.
The action seems working just fine!
Your app is almost there! Wait, the payment is done on Razorpay's website, how do I know was the payment paid or failed? Well, payment providers usually provide a parameter called Callback URL:
According to the documentation, callback_url
is where Razorpay sends back the payment result. So that means, we need to give Razorpay a callback_url
, telling them where to send the information back.
A One Time URL can be used as a Callback URL here.
Follow steps 1 to 5 in the above screenshot to create and edit the One Time Url.
Let's open up another webpage of the app before you enter the one-time URL editing page.
We've now finished the first section, parameters, in a "One Time Url".
Web Forms is to collect extra information via a web form, which is not a must for the case. Let's go direct to design our Web Page:
The app now can receive payment results from Razorpay, let's send the result back to the chatbot via a trigger.
payment_status
and the whole payment_result
JSON.TIP - Since your app is still in the draft version, any changes made to the app will be updated to all installed apps as well. Simply refresh the webpage to get the most updated version of the app.
Nothing to edit in the previous chatbot flow but the trigger needs to be set up in Automation before you test the payment process again: