#mindsetinmeta
1 messages ยท Page 1 of 1 (latest)
hey orakaro
thanks for your help again
I'm trying to create a checkout session with authorization only but capture the payment later.
according to the documentation, "before continuing to capture, attach a payment method with card details to the PaymentIntent, and authorize the card by confirming the PaymentIntent. You can do this by setting the payment_method and confirm fields on the PaymentIntent."
I cannot confirm the PaymentIntent in API "Create a Session".
what to do?
please advise.
๐
That statement is for Payment Intent flow. Now you are using Checkout flow, you don't need to bother ๐
cool
When you create a Checkout Session, and user pays, the Checkout Session will create a Payment Intent inside it, and when it get confirmed it will automatically has the Payment Method attached
For the purpose of Auth and Capture later, for Checkout, what you want to do is
- Create Checkout Session with payment_intent_data.capture_method = manual
- Later on, find the PaymentIntent inside the Checkout Session, then call Capture on it
besides setting payment_intent_data[capture_method]=manual, do I need to also set payment_method_types[]=card when create a session ?
as the documentation mentioned that Auth and Caputure only support card?
Card should be set by defaults, so I think you don't need to. But it's no harm to test ๐
If you don't specify that parameter, Checkout will automatically takes all enabled PaymentMethods in your Dashboard, so you probably have a Checkout Session accepting a lot of PaymentMethods. But in step 2, you can filter out if the Checkout Session was paid by a card to call capture
If you do specify that parameter, you will have a Checkout Session only accepts cards, and in step 2 no need to filter out. But it would be harder in the future in case you want to enlarge the list of accepting PaymentMethods
just want to confirm, what I'm doing, setting payment_method_types[]=card when create a session, is to set the payment to be Card ONLY, right?
yep
cool