#Paul
1 messages · Page 1 of 1 (latest)
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?!
Thanks for the context, how do you intent to make this HTTP request from you application? are you using any network library?
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!
No worries, are you using Mac or Windows? The curl is a built-in tool in Mac.
ah, that explains it. I'm on windows
and our customers will be on windows, using the Delphi application
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
ok. is the request correct (in that I send it as json)?
i'm more familiar with https://domain.com?u=123?somethingelse=45454 etc
Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.
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?
I've tried the above json request but receive the error: Unrecognized request URL
So i wanted to make sure the syntax was correct
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
unfortunately, it isnt sohwing the request in the log
out of interest, should they be GET or POST requests?
For setupIntent creation, It's a POST
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
No problem! feel free to come back when you have more questions! we are happy to help.
ok, thats great, thanks again