#refayet_62981

1 messages ยท Page 1 of 1 (latest)

modern frostBOT
fading shale
#

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?

placid whale
#

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.

  1. 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.

  2. 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.

  3. 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)

#

not how to list the existing payment methods first

fading shale
#

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

placid whale
#

But this one is for on-session

#

aha got it

fading shale
#

The customer must be on-session to save the payment method

#

But the charges occur off-session

placid whale
#

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**

fading shale
#

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.

placid whale
#

ok .. so believe .. it should be something like handleNextAction

#

in stripe,js

fading shale
#

Requires confirmation is not a 3DS response

#

Do you have an example Payment intent where this is occurring?

placid whale
#

a moment .. let me share

fading shale
#

I just need the ID, thanks ๐Ÿ™‚

placid whale
#

event ID?

fading shale
#

No, you gave me the payment intent ID in the json

placid whale
#

ah ok .. I am new to Discord and Stripe both .. didnt know you can lookup internally .. sorry

fading shale
#

Okay for off-session payments you need to add a few parameters to your Payment Intent.

placid whale
#

I see .. off_session: true .. etc.

#

got it

fading shale
#
 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
  )
placid whale
#

and is return_url mandatory

fading shale
placid whale
#

perfect .. thanks a lot .
appreciate it

#

I will try .. at least I have a clue to chase now

fading shale
#

Sure thing! Happy to help ๐Ÿ™‚

placid whale
#

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 ..

fading shale
#

In that case you should re-collect your customers payment method using stripe Elements to trigger the 3DS challenge flow.

placid whale
#

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

fading shale
#

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.

placid whale
#

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

fading shale
#

In that case you may need to use that approach. You would just need to be ready to handle integrating 3DS yourself

placid whale
#

I see

fading shale
#

Are you planning on building a mobile integration?

placid whale
#

thanks again. you've been very helpful

#

yes, with Dart (flutter)

#

not native Android or IoS

#

iOS

fading shale
#

Ah, we also don't support Flutter directly. We have support for iOS,, Android, and React Native

placid whale
#

hmm .. Stripe Support recommended me a packge from dart

#

and also saw a video in support channel

fading shale
#

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

placid whale
#

looks encouraging

#

yes.. thats why I choose web as frontend and node as backend first

fading shale
#

There are packages that exist if you are set on those frameworks but they are not actively supported through Discord

#

thats why I choose web as frontend and node as backend first

Very smart