#Paul

1 messages · Page 1 of 1 (latest)

viral sandal
#

Hi there, what kind of HTTP syntax do you want to check?

somber mist
#

I've spent the last 5000 years writing desktop applications, and now were doing http! I've been looking through the online docs to set up MOTO payments, and came across this:

#

curl https://api.stripe.com/v1/setup_intents
-u

sk_test_51Gt7r2EWXPoCJtoXr3beVCnPcSaVm3UPRwNLbsTkVJzm6GbhcPCCeVXnLy5dSDvgOildl9FdqdshoRTUMnDRXQjc00FSBti4n8
:
-d "payment_method_data[type]"="card"
-d "payment_method_data[card][number]"=4242424242424242
-d "payment_method_data[card][exp_month]"=4
-d "payment_method_data[card][exp_year]"=24
-d "payment_method_data[card][cvc]"=242
-d "payment_method_options[card][moto]"=true
-d "confirm"=true

#

so I created this:

#

https://api.stripe.com/v1/payment_intents -u sk_test_***8:{"amount":"1099","currency":"eur","payment_method_data":{"type":"card","card":[{"number":"4242424242424242","exp_month":"4","exp_year":"24","cvc":"242"}]},"payment_method_options":{"card":{"moto":"true"}},"confirm":"true"}

#

Am i on the right tracks or should i become a tesco delivery driver?!

viral sandal
#

Thanks for the context, how do you intent to make this HTTP request from you application? are you using any network library?

somber mist
#

I'm using and Indy http library, which, to be fair, I've used successfully before. Its part of the Delphi language

#

allows https, etc

#

all the references use curl(?) which I assume allows for command line requests?

#

I'm not familiar with Curl, or whether it is something we need to install

#

forgive my ignorance!

viral sandal
#

No worries, are you using Mac or Windows? The curl is a built-in tool in Mac.

somber mist
#

ah, that explains it. I'm on windows

#

and our customers will be on windows, using the Delphi application

viral sandal
#

I see, you can install curl in powershell so that you can run the example command in your Windows/

#

But I'm not familiar with Delphi language, so I'm not sure what is the equivalent statement for Delphi

somber mist
#

ok. is the request correct (in that I send it as json)?

viral sandal
#

Stripe accepts request in json (i.e., via node.js library), but I'm not sure whether Delphi can do the same trick. Have you tested it out?

somber mist
#

I've tried the above json request but receive the error: Unrecognized request URL

#

So i wanted to make sure the syntax was correct

viral sandal
somber mist
#

unfortunately, it isnt sohwing the request in the log

#

out of interest, should they be GET or POST requests?

viral sandal
#

For setupIntent creation, It's a POST

somber mist
#

well, there's my first schoolboy error!

#

Let me have another play with it to see if I can make progress rather than waste your time. THanks for your help so far

viral sandal
#

No problem! feel free to come back when you have more questions! we are happy to help.

somber mist
#

ok, thats great, thanks again