#mdcopley08
1 messages · Page 1 of 1 (latest)
You can wait to pass off_session to True on confirmation: https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-off_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah sorry I misunderstood. One sec. Re-reading the original thread for more context
When you are pre-authing a card, will the customer be on-session at that time?
If not the same applies. 3ds is prompted at confirmation time, not capture time, so you can pass off_session to True even with manual capture
Hi, reading through this now
And this is for our phone sales, so our team is on the phone with the customer for this flow
But just so I understand, when we do the second request to actually capture it, we can still pass in "off_session=True" ?
No you still pass off_session=True when confirming, not capturing. 3ds is prompted on confirmation. So, if the card is going to require 3ds, that would come up when confirming and passing off_session=True will just decline the transaction immediately even though it's the auth part
Here's an example in Python to show what I mean:
amount=2000,
currency="usd",
payment_method_types=["card"],
customer='cus_123',
payment_method='pm_123',
confirm=False,
capture_method='manual'
)```
stripe.PaymentIntent.confirm('pi_123', off_session=True)
Above creates a payment intent, setting capture method to manual (which means you will be using the separate auth and capture flow)
Then, you confirm (auth) the payment intent passing off_session=True. It will error out here if 3ds is required, never going into a requires_action state
If 3ds isn't required, the authorization will be successful
Then, you would be able to capture funds later with this endpoint when it comes time to do so: https://stripe.com/docs/api/payment_intents/capture
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Does that make sense? You could also pass confirm=True when creating the payment intent. I just separated it out to illustrate how confirmation really is a separate step from payment intent creation under the hood
This might help too: https://stripe.com/docs/payments/intents
Okay got it, thanks for the example - that answers my original question
Just to clarify around capturing PaymentIntents though - from my understanding for our normal flows when someone books on our website and we create a PaymentIntent with "confirm=True", it will also capture the payment and create a charge?
Here's our code snippet for that flow - what I described above is what seems to be happening in our Stripe dashboard from my understanding:
That's correct. If you're passing confirm=True, it will also capture unless you explicitly pass capture_method='manual'