#JoelBermudez
1 messages · Page 1 of 1 (latest)
A SetupIntent is the object that you will use to collect billing details and save them as a PaymentMethod
You need it for its client_secret which is passed along until it is used in the confirmSepaDebitSetup call in step 4
So in that guide it is created before the page is rendered, but with that guide you only need it before you call confirmSepaDebitSetup
So you're telling me that I can do first Step 3 then when user complete the form and press down "Pay", then I call first setupIntent and then confirmSepaDebitSetup?
Yes, if you want to you can do that in that order
Ok, and last question. How do I call that curl function? With JS? Or PHP with curl_init();? Which would be more safe. I guess PHP cause it's server side and customer ID is local, and can not be changed like in JS right?
If you are using PHP we have a stripe-php library that you can use that has that function built in
API reference here: https://stripe.com/docs/api/setup_intents/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It has examples in PHP as well https://stripe.com/docs/api/setup_intents/create?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, but how cURL could be used in case I want to use it?
How do I execute a cURL function when an user clicks a button? In the Docs, cURL is intended to work with JS?
cURL is a command line utility for making HTTP requests, we just use it in our docs because it is widespread. You can use anything that makes an HTTP request to make a request to our API
Got it