Help with cURL Implementation, Instamojo Payment gateway

Hi, So I looked at various tutorials (@Taifun Dropbox example) and somewhat understood how to use cURL (Still not that clear). Please have a look at the screenshot below:


I am trying to implement Instamojo Payment gateway in my app.
So far what I think is right is this:

  1. Set url of web component to :https://www.instamojo.com/api/1.1/payment-requests/
  2. Use request headers block to pass on API key & auth token.
    Now how can I post the rest of the data like amount, purpose etc? What block should I use? And in which format?
    And also, is my logic so far is correct? I am a total beginner to API and stuff…

Using CURL , with terminal Extension :

aia example:

:point_down:t2: :point_down:t2: :point_down:t2:

1 Like

How can I pass on url, api key and auth token (headers) using terminal extension? What is ‘-F’ in the curl? Instamojo website hasn’t given any example like that? I really can’t understand… I’ve been trying for the past two days… So I don’t have to use web component? I have to use the terminal extension? Can you please,please just tell how to create the request (please look at the screenshot)? Please it would be really helpful if you let me know how to do this properly…

Looking at the part of the CURL example above, can you identify the parameters amount, buyer_name, email, phone and their values ​​(compared to the bottom - return)? Try to remove some non-mandatory parameters and send the CURL

1 Like

That is what I don’t know how to do. How can I send the cURL? So far what I have done is:

  1. I set the url of web component to https://www.instamojo.com/api/1.1/payment-requests/
  2. I used request headers block for sending Api key and auth key
    I did these after following @Taifun 's dropbox tutorial. Now how can I send the rest of the parameters (amount, buyer_name)? Should I use build request data or post text blocks of the Web component? Can you walk me through it?

Did You Read my answers ?
Please , Read.
There is a aia example.

2 Likes

I did look at the aia file. It uses a different format than what is given in the docs of Instamojo. For example, what is -F used in that curl command in the aia?
How can I convert :
*curl https://www.instamojo.com/api/1.1/payment-requests/ *

  • –header “X-Api-Key: d82016f839e13cd0a79afc0ef5b288b3” *
  • –header “X-Auth-Token: 3827881f669c11e8dad8a023fd1108c2” *
  • –data “allow_repeated_payments=False&amount=2500&buyer_name=John+Doe&purpose=FIFA+16&redirect_url=http%3A%2F%2Fwww.example.com%2Fredirect%2F&phone=9999999999&send_email=True&webhook=http%3A%2F%2Fwww.example.com%2Fwebhook%2F&send_sms=True&email=foo%40example.com”*

into something like:
curl -F [email protected] -F email=YOUREMAILHERE https://srv-file6.gofile.io/uploadFile

Look your CURL example. Did It need -F ?

1 Like

No, but it needs header and data. So what should I put? -H & -D?

you said, you used the web component and you already set up the request header… fine…
now just put the data into the PostText block and find out, what will be returned in the GotText event

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

2 Likes

Try …
I haven’t tested it. I didn’t sign up for istamojo (I don’t think I can).

Always observe the required parameters.
parametrosrequeridos

“-d, --data
(HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button”
.

1 Like

YES! Did it!!! I know how some basics of working with API. I didn’t really know how to use web component, so I spent so much time figuring how to work with it. Now let me see how I can apply this knowledge to work with other APIs. Thanks a lot! Your Dropbox tutorial also helped a lot!!!

I didn’t have to use terminal since I got it working with web component. Now I have two methods to work with API! Thanks a lot for your help, I got to learn about API, cURL etc just from this…

1 Like

please provide a screenshot of your working solution to help others with the same question in future.
thank you

Taifun

I will post it, my code isn’t exactly readable though. I will post the proper tutorial if I can to help others. Many of the tutorials on the internet is not free.

It’s simple Use PHP code. Host The Files , and Use Web component.

2 posts were split to a new topic: Which blocks to use for this Post request?

4 posts were split to a new topic: How to use the Web.Post method?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.