#refayet_62981
1 messages ยท Page 1 of 1 (latest)
Hi ๐
I'm a little lost by what you are trying to do here. Are you using Payment Methods you've created in Stripe?
And when your customers are interacting with your application, are you using Stripe.js to collect payment method information?
Hi,
I am still developing, so no live customer yet. Let me explain my scenario. All payments are off-sessions. One the frontend knows the amount to be charged, I want to follow below sequence.
-
The webpage/app lists the available payment methods from local DB, where I saved the payment methods if the setup intents are successful. OR customer wants to use another card which is not saved.
-
If customer want to use a new card, I want to render payment element with card fields and a checkbox if they want to save the card for future use (off-session). Handle necessary 3DS scenario.
-
I am sending a paymentIntent with payment_method if existing payment method is selected via backend and stripe returning "require_confirmation"
I am stuck there
should I change the flow .. that first create an intent .. then list the payment method or ask for new card then provide payment method (either card info or payment_method)
https://stripe.com/docs/payments/payment-element
I am following this .. however it only shows presenting card elements
not how to list the existing payment methods first
Okay so I would start with this guide: https://stripe.com/docs/payments/save-and-reuse
And build your interface to save payment methods configured for off-session usage. This will include an authentication step and should trigger 3DS initially to optimize your payment methods for use off-session
The customer must be on-session to save the payment method
But the charges occur off-session
that's what I am doing
I am using setupIntent first for card saving
but then I realized that why not to save card only when customer try to make payment with a new card
but when the time of payment comes ... i.e. sometime in future .. how to first show those payment method and then create paymentIntent based on either payment_method
I am unable to find it in any element guide
for now I am using local UI to list the PM from local DB .. which I am very ok with
problem is ... when it is returning "require_confirmation" .. I dont know how to rented that in frontend i.e. web
cause use of payment methods is selected from native UI .. not from any stripe elements
render**
I am unable to find it in any element guide
That is because we don't have any UI to show saved payment methods, yet.
Requires confirmation is not a 3DS response
Do you have an example Payment intent where this is occurring?
I just need the ID, thanks ๐
event ID?
No, you gave me the payment intent ID in the json
ah ok .. I am new to Discord and Stripe both .. didnt know you can lookup internally .. sorry
Okay for off-session payments you need to add a few parameters to your Payment Intent.
Here is the section of the doc that goes over how to do that: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
stripe.PaymentIntent.create(
amount=1099,
currency='usd',
# In the latest version of the API, specifying the `automatic_payment_methods` parameter is optional because Stripe enables its functionality by default.
automatic_payment_methods={"enabled": True},
customer='{{CUSTOMER_ID}}',
payment_method='{{PAYMENT_METHOD_ID}}',
return_url='https://example.com/order/123/complete',
off_session=True, // <- this part tells us the customer is not present
confirm=True, // <- this part confirms the paymentIntent on the first API call
)
and is return_url mandatory
Not if you only specify payment_method_types=['card'] https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_types
perfect .. thanks a lot .
appreciate it
I will try .. at least I have a clue to chase now
Sure thing! Happy to help ๐
One question though .. if 3DS is challenged (for some cards or if its more than some limit) ... how to handle that .. will web client render something ..
In that case you should re-collect your customers payment method using stripe Elements to trigger the 3DS challenge flow.
re-collect mean .. collecting the card information again ?
but in my apps .. I mean apps that I use like Uber etc. those just show me a webview .. to conform if I have authorized the payment via my banking app
Yes. There is a way to manually trigger the 3DS challenge flow but it is very complex and error prone so we don't recommend it
https://stripe.com/docs/payments/3d-secure#when-to-use-3d-secure
I do want to warn you that if you choose to do handle this we cannot offer any more guidance than what is written in that doc. We provide these details for users who want to take this on themselves but we don't offer in depth support for this workflow.
Understood.
But simply put, what if I want to deploy the same flow in other rideshare apps (my one is almost similar) ..
i.e. when there is a 3DS challenge .. I want to take confirmation from user if they had authorised the payment
In that case you may need to use that approach. You would just need to be ready to handle integrating 3DS yourself
I see
Are you planning on building a mobile integration?
thanks again. you've been very helpful
yes, with Dart (flutter)
not native Android or IoS
iOS
Ah, we also don't support Flutter directly. We have support for iOS,, Android, and React Native
hmm .. Stripe Support recommended me a packge from dart
and also saw a video in support channel
But I would focus on getting both server-side and client-side web versions working first. It's the most straightforward way to get familiar with how the APIs work