#Sergio Sánchez
1 messages · Page 1 of 1 (latest)
Hello Hanzo!
Not sure I understand the usecase, you can't accept a payment without creating a PaymentIntent
Hello 👋
let me provide you a bit of context
in our use case we have the following steps:
- We ask for the customer about the payment method (client side)
2 We validate the payment method and hold the required funds and if everything goes well we create the "booking request" entity we use to follow the process (server side)
- After a couple of days we capture the funds
I have seen that the standard workflow proposed here https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements you need to confirm the payment in the client side, and them a redirection is done. It makes difficult for use to control the step 2 I describe
so as alternative we have seen that it is possible this workflow https://stripe.com/docs/payments/accept-a-payment-synchronously which match perfectly with our current workflow (where we dont use webhook)
so the first question would be, are we right? I mean if we want to define something similar to our current workflow, https://stripe.com/docs/payments/accept-a-payment-synchronously would be a the right solution ?
and second question would be, following https://stripe.com/docs/payments/accept-a-payment-synchronously approach, can we use PaymentElements instead of CardElements. Mainly we want to use Klarna among other payment methods
Wouldn't it be easier to use a SetupIntent to store the payment method and then charge the payment method via server-side off-session PaymentIntents?
and when you confirm the payment itself, I mean, we want to get the payment method but also hold an amount of money and confirm customer has enough money to be capture later, is it possible with a SetupIntent?
You can't hold an amount with SetupIntent but you can place a hold via creating a PaymentIntent server-side with this flow
https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
amount: 1099,
currency: 'eur',
payment_method_types: ['card'],
capture_method: 'manual',
});```
is this call (including the payment method) going to say "Your customer does not have enough funds" in case that we can not hold the money?
Yeah the authorization should fail if they don't have enough funds
ok so create = authorization in that specific case
capture_method: 'manual', specifies the hold
and then if something fails we can sync go back to our customer and say "you dont have enouhg funds"
ok I guess that more clear now, we are going to try a SetupIntent then so we avoid the limitation describe here https://stripe.com/docs/payments/accept-a-payment-synchronously
last request, could you provide me the right documentation page to understand how to use SetupIntent?
I have seen that confirmSetup also have a redirection.... we would like to avoid this because is in the same page where we call to the server in order to create the booking reuquest and confirm the payment intent
last request, could you provide me the right documentation page to understand how to use SetupIntent?
https://stripe.com/docs/payments/save-and-reuse this one ?
Correct.
I have seen that confirmSetup also have a redirection.... we would like to avoid this because is in the same page where we call to the server in order to create the booking reuquest and confirm the payment intent
You can setredirecttoif_requiredwhich prevents it from redirecting (unless the payment method requires it)
ok understood
👍