#padek
1 messages · Page 1 of 1 (latest)
when a client register a card it creates a payment method on stripe
How are you creating a PaymentMethod? Are you using SetupIntents?
yes i use first stripe.PaymentMethod.create and then stripe.SetupIntent.create
Ah, I see. Is there a particular reason why you're creating the PaymentMethod separately? Ideally, you'd create the SetupIntent first and then collect the payment details and confirm the SetupIntent client side: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
If any 3DS authentication is required, confirming the SetupIntent should kick off that flow
so the flow that i tried setting up is the following: client register a card (can be more than one) , makes an order and then select what card he wants to pay with and then we hold that amount for 3 days with a PaymentIntent with manual settings then on the third day we charge that same paymentIntent
and when we charging that payemtnIntent is when i have encounter that error warning
Can you share the PaymentIntent ID?
give me one sec
could you copy one of those IDs here, in text form?
Ahh, looks like they're both slightly off:
pi_3NL9F7AbKEfBp83O0GHSD6bQ
pi_3NL9DbAbKEfBp83O0QDPSqLO
for next time, you can also grab these from the URL after clicking into each payment
oh i apologize for that
no problem!
Okay, so it's as I thought (and as you described). The PaymentMethod used for these charges were created directly server side: https://stripe.com/docs/api/payment_methods/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.
Since you're essentially asking your customers to share their payment details now but plan to charge them later/at a later date, you should reorder your flow a bit: create the SetupIntent first, use the SetupIntent's client secret + Elements to collect the customer's payment details client side, then confirm the SetupIntent client side. This will create the PaymentMethod automatically and trigger any additional authentication if the customer's bank requires it
okay so when i first receive the clients card information y should create a setupintent
yes, that's correct
This is the flow you want to follow: https://stripe.com/docs/payments/save-and-reuse
okay let me give that a good read and think about it so i can understand but basically the only part im a little confused is if i create a setupIntent does that alone create a paymentMethod
Ah, let me clarify. Creating a SetupIntent alone does not create a PaymentMethod. You will use the SetupIntent's client secret to collect payment details from your customer client side. Those payment details will be used to create a PaymentMethod when you use confirmSetup: https://stripe.com/docs/js/setup_intents/confirm_setup