#Sergio Sánchez
1 messages · Page 1 of 1 (latest)
Hello! Can you clarify? What specific questions do you have?
sure 😉
I am trying to follow this use case https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
but I am missing some steps that maybe you can help to clarify, let me share further details
our use case is:
- The customer access to our checkout funnel to provide a payment method
- We need to validate the payment method and "block" the amount of money we require for the payment
- After some extra process which could take 2 days, we want to charge the payment
What I understand following the documentation is:
- I create a payment intent with capture=manual
- We present to our user the PaymentElement providing the client_secret as option
- We handle the submit making a elements.submit() to validate the payment method
- After 2 days we execute stripe.paymentIntents.capture to charge the amount we need
I am not pretty sure of this process and if this work as I say, could you give me some highlevel steps in order to cover our use case properly?
I am also using https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements this document as reference to define the solution
Yeah what you're describing will work fine with the doc (https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements) you're following
You'll just change the PaymentIntent creation code to set capture_method: manual
and then you'll need to implement your own thing to do the capturing of the paymentIntent after the two days
ok so a couple of extra questions
following this process, should I skip the stripe.confirmPayment call in the submit? Will it capture the payment?
or confirmPayment is what is used in order to validate and block the payment intent defined?
You should still be calling confirmPayment (you need that to be successful to capture the payment in the future)
ok understood, so only stripe.paymentIntents.capture is actually use for the charge
the rest of call defined in the documention are basically to define the payment, authorize and block, right?
Yup
ok so now more clear for me 😉 last question
if I want to avoid "guess" customer, waht I need to do is create the customer before the payment intent and then pass to the payment intent the customer id. Or is there any option to create the customer at the same time you are collecting the payment method using the payment elements?
You'd have to create the Customer ahead of time