#sindev_error

1 messages · Page 1 of 1 (latest)

grand spindleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1476699265886720040

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

vocal mural
#

Hi there

#

looking

solemn flare
#

the components shown on the screen are custom, just some TouchableOpacity
before they triggered presentPaymentSheet (which opens a modal with all payment methods)
now I want to skip the popup and immediately proceed with the selected payment method

#

maybe I just don't understand very well how it works for Stripe, but I also have an Adyen integration which works that way

vocal mural
#

Let me look - we offer something like this in Stripe.js, but I'm not sure if the React Native SDK supports it.

Because what you're looking to do is just provide your own option of payment method types and then immediately try to confirm the PaymentIntent with that Payment Method type on the frontend, correct? Like you already know you want to use Link, for example, and then you want to go straight to confirming the Link payment with the user's input

solemn flare
#

yes exactly

#

if this isn't possible, then could you suggest what would be the best alternative? (without grouping everything in a single sheet)

vocal mural
#

looking at the React Native SDK to see what I can find

solemn flare
#

hmm, I think it's working for web on our product. But I'm not in much details of the implementation

vocal mural
#

I think what you need to do here is just to decide what payment method you want on the custom component you mentioned and then pass that to payment_method_types on the PaymentIntent when you create the PaymentIntent before presenting the Payment Sheet

#

and based on my testing, it works like I think you want it to if there is only one payment method type

solemn flare
#

so payment intent should be created with specified payment method types? Becaused wehn I asked the BE earlier, they said they use .setAutomaticPaymentMethods( so the payment_method_types are not needed

vocal mural
#

If you want to let the Customer decide, then yes, but that isn't what you want to do in this flow, right?

#

Or you want to let them decide, but not on the Payment Sheet

solemn flare
#

they can decide on the custom UI between the payment methods list, after choosing one then the payment should proceed automatically without some intermediate popups for choosing payment method again

#

also on the web they told me they can verify the supported payment methods via:
const { paymentIntent: retrievedIntent } = await stripeInstance.retrievePaymentIntent(clientSecret);
    const paymentMethodTypes: string[] = (retrievedIntent as any)?.payment_method_types || [];
    console.log(‘paymentMethodTypes’, paymentMethodTypes);

I tried similar thing on RN and I got the response I attached to this issue, it doesn't contain any payment methods

vocal mural
#

Okay, let me try to explain again

#

So we agree that what you want to do is to decide the payment method to be used on your custom ui component, and then proceed to collecting payment method details/confirming the payment without an intermediate step where the customer has to choose the payment method again on Stripe's UI, right?

solemn flare
#

yes

#

and just to clarify, BE is the same for both web and mobile in this case
so payment intent is being created the same way

vocal mural
#

And how do you handle the Payment Method selection on web?

solemn flare
vocal mural
#

What's your account id? It would be easier for me to find what I need from that

solemn flare
#

where can I find the account Id

vocal mural
solemn flare
#

I only have access to test env, I hope that doesn't matter

acct_1M1RE0L7ip0GbFi3

vocal mural
#

Your web integration is using automatic payment method types, which would present the user with all the payment methods that are available in the Payment Element.

I tried going through your flow but I can't find a date that has tickets at this step: https://www.flibco.com/en/distribusion/timing

#

okay it works with Frankfurt airport

solemn flare
#

please choose CRL to Brussels Airport

vocal mural
#

Yeah so despite selecting card in the previous step, I am still offered other payment methods, because you are using automatic payment methods

solemn flare
#

no, please select amazon pay

#

because the Card option is the old approach which is to be removed

#

Amazon pay on the other side is the new approach

#

satispay as well

#

there is also a custom popup with Confirm button when going with these 2 payment methods, it's to be removed as well

vocal mural
#

Do you have access to the client side code for Elements on your web payments?

solemn flare
#

for now not, I can ask for it tomorrow

vocal mural
#

like what code is called when you click the amazon pay button?

#

ok

solemn flare
#

can you keep this thread opened til tomorrow?

vocal mural
#

No, we close them for inactivity, but when you come back, we'll have a reference to this thread that one of my team can use.

I still think that, most likely what you need to do on mobile is to use payment_method_types when creating a PaymentIntent and only passing the value that you get at the select payment method stage, then you can get the behavior you're looking for.

#

But also, what is the advantage of handling the payment method selection yourself instead of letting Stripe's Elements handle it? They're highly optimized for this purpose

#

If you have a narrow subset of Payment Method types you want to allow, that is easily achievable

solemn flare
#

I don't know, I'm really tired of it lol
spent all day trying different stuff out

vocal mural
#

We've all been there

solemn flare
#

okay then I will come back tomorrow when I have access to web as well
thank you very much for your support

vocal mural
#

Yeah, no problem. I know I said that, but I would seriously consider just letting Stripe's Elements handle the Payment Method selection step unless you have a compelling reason not to.

#

Have a good one!