#kevin_reactnative-meta

1 messages ยท Page 1 of 1 (latest)

dense boltBOT
#

๐Ÿ‘‹ 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/1401939189682933852

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

solemn forge
#

๐Ÿ‘‹ happy to help

#

hmmm good question, I'm not sure you can, I'd have to check for you to be honest

#

but what are you trying to actually achieve?

ebon haven
#

Currently, when we book on the product I work with:

  • If we pay with an existing credit card, we create the booking for the customer with the existing credit card via back-end directly without validating anything on Stripe
  • If we pay via payment intent or setup intent, we validate it via Stripe before creating the booking

I want to migrate from CardElement to PaymentElement and wants to have the same behaviour ๐Ÿ™‚

solemn forge
#

via back-end directly without validating anything on Stripe
what do you mean by that?

#

off_session: true

#

like an MIT transaction

ebon haven
#

What we do is that we pass the selected payment method ID to the back-end if we pay with an existing credit card without doing stripe.confirmCardSetup or stripe.createPaymentMethod

#

What do you mean by off_session: true ?

ebon haven
solemn forge
#

you have the selectedPaymentMethod which is the equivalent of the PaymentMethod Result

ebon haven
#

What do you mean?

solemn forge
#

const {error, selectedPaymentMethod} = await elements.submit();

ebon haven
#

Ah yes but I don't understand how to differentiate an existing payment method and a new one ๐Ÿค”

solemn forge
#

I think the new one won't have the customer ID

ebon haven
solemn forge
#

can you please try to log the selectedPaymentMethod in both cases and see the difference?

ebon haven
#

Oh the thing is that I'm preparing the work so that product team know if it's a hard project before we prioritise this project or not so I can't log anything, all my threads are purely theorical ๐Ÿ˜ญ

dense boltBOT
finite elk
#

@ebon haven sadly it's hard to debug with a meta question here. I recommend taking a few hours to integrate the product end to end here

#

kevin_reactnative-meta

ebon haven
#

You lost me there, I asked how to differentiate an existing payment method from a new one when submitting elements or in confirmHandler in React native
What's the connection between this and prices / taxes?

finite elk
#

Ah sorry I mixed up my threads, my bad

ebon haven
#

Ah NP ๐Ÿ˜‚

#

I haven't tested yet but on React.js, selectedPaymentMethod only returns a string it seems, it's not the result of payment method like in React Native ๐Ÿ˜…

#

I have checked with these libs versions
"@stripe/react-stripe-js": "~3.9.0",
"@stripe/stripe-js": "~7.8.0",

finite elk
#

sadly our web and mobile SDKs have different interfaces. Something I keep fighting against internally but alas ๐Ÿ™

ebon haven
#

Hahahaha NP so on web SDK it's not possible to distinguish if a user selects an existing payment method or a new one? ๐Ÿ™

finite elk
#

what exact doc are you following end to end so I can grasp what you are asking?

finite elk
#

where is selectedPaymentMethod coming from on that doc? (for web)

ebon haven
#

In your doc, you only show this const {error: submitError} = await elements.submit(); but when I check the signature of submit I see the previous screenshot I showed you

finite elk
#

gotcha, never heard of this sadly. Best approach is really to test this end to end versus guessing from the type signature

ebon haven
finite elk
#

Not sure, those things are much easier to understand while running the code with logs.

ebon haven
#

Okay thanks anyway, will see that with product team ๐Ÿ˜„