Support Topics Documentation Slack YouTube Blog

Curl POST command in Codeless

Hi Backendless Forum,

I am working on a Curl command that I want to use in Codeless which is shown in the following example:

curl -X POST https://api.mollie.com/v2/payments
-H “Authorization: Bearer test_tqtF9bhsdDttwc5ngrNHDuT2MQp8xB”
-d “amount[currency]=EUR”
-d “amount[value]=10.00”
-d “description=Order #12345
-d “redirectUrl=https://webshop.example.org/order/12345/”
-d “webhookUrl=https://webshop.example.org/payments/webhook/”
-d “metadata={“order_id”: “12345”}”

This is used for the payment system from Mollie.
When I try this in Postman, I do get a correct respond with payment info.
I am trying to create this in Codeless with the HTTP/s method block,
but I don’t know if this is the correct way of doing so.
I hope you have a solution for my request, as I could not find any other similar questions.

Link to source: https://docs.mollie.com/reference/v2/payments-api/create-payment

Best regards,
Robin

Hi, @Robin_van_Kuijk!

We are exploring your problem. In order to make it quicker could you please provide us what is appId of your application? And send a screenshot of the Codeless method by which you tried to implement this functionality.

Regards,
Marina

Hi Marina,


The screenshot will show which block I am using, but because there is no detailed documentation of this block, I am not sure if this would be the correct solution.

Best regards,
Robin

Thanks, @Robin_van_Kuijk we will notify you when investigate this problem.

Regards,
Marina

1 Like

@Robin_van_Kuijk, try sending header and body using CreateObject as in the example. Also, note that you need to add Content-Type: application/x-www-form-urlencoded to the header.

Regards,

Marina

Thanks for your suggestion, I have tried your solution but I get the following error:

400 - The “string” argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object

I think it is in the body part.
So I probably need to use a string or Buffer or ArrayBuffer.
I’ll try to find the block required for this, since I have a feeling that we are getting closer to the solution.

Best regards,
Robin

@Robin_van_Kuijk, if you have any problems with this issue, please let us know, we will be pleased to help!

Regards,
Marina

1 Like

Solution:

Body needs to be in text and every field needs to be seperated with “&”
Which you can see in the screenshot above, except the last field.

Now Mollie payments can be added to Backendless!
I am so excited that it works, thanks to your idea’s Marina.

Best regards,
Robin

1 Like