#seth_code

1 messages · Page 1 of 1 (latest)

hollow mapleBOT
#

đź‘‹ 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/1287623738531123284

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

foggy creek
#

Here is a screen shot of the error, this appears after my server sends the clientSecret and applies it to intentCreationCallback on the mobile app:

hollow mapleBOT
copper cape
#

Hi there can you share with me the payment intent id?

foggy creek
#

Sure, one second

#

pi_3Q23VZBghRV4WpFM1ywjnuVh

copper cape
#

This is how you use FlowController

foggy creek
#

Yes, this is exactly what I am currently doing. I have tried using customFlow as well, however Apple Pay does not seem to work unless you pass back a payment method that has automatic confirmation.

copper cape
#

What's the PaymentIntent ID for the apple pay payment?

foggy creek
#

pi_3Q23c3BghRV4WpFM14GJODMi

#

Why is FlowController required?

copper cape
#

The PaymentIntent status is requires_confirmation, you haven't confirmed it

hollow mapleBOT
foggy creek
#

The user on the other end has the option to accept/reject a reservation. If they accept, the payment is confirmed. If they reject, it is cancelled.

copper cape
#

Ok. Then what's the problem with this apple pay payment?

foggy creek
#

intentCreationCallback fails when the PaymentIntent is manual confirmation method.

#

This is required to close the apple pay sheet on the UI

#

And it discloses to the user that the apple pay payment did not succeed, even though the intent has been created and it is just in the require_confirmation status

#

The highlighted line always fails, regardless of if customFlow is true or false

copper cape
#

Do you see any errors ?

foggy creek
#

No error is thrown.

#

However, the payment intent is created and set to status requires_confirmation

#

if I remove intentCreationCallback, the payment sheet does not dismiss

copper cape
#

Can you put some logs to confirm a valid clientSecret is returned?

foggy creek
#

secret returned: pi_3Q23sZBghRV4WpFM1GwnOwUa_secret_rvAodL2Hz13E18O8Cdn3Bh1NG
id created: pi_3Q23sZBghRV4WpFM1GwnOwUa

copper cape
#

Can you share with me a sample project that I can run and reproduce the problem?

foggy creek
#

Just a React Native project? It would be difficult to send you both client and server code

copper cape
#

Just react native

#

You can DM it to me

foggy creek
#

Sure, it will take me some time to send it

copper cape
#

No problem. If you need more time, you can also share the example project to Stripe supporthttps://support.stripe.com/contact/email, tell them you've spoke to the engineer on discord, and they'll forward your ticket to us.

foggy creek
#

The Stripe SDK requires publishable keys and a merchantIdentifier for apple pay...this is not something that I can easily set up for you. Would it be okay for me to just send a react native component?

copper cape
#

It's OK, I can use my publishable key and merchantIdentifier

foggy creek
#

I cannot send you the project in discord, it seems to be too large.

copper cape
#

Or can you upload it to a file sharing service (i.e., Google drive) and DM me the link to download?

foggy creek
#

Yup, I can do that.

copper cape
#

Thanks, let me download it

foggy creek
#

It's a very basic project with two buttons set up exactly how I have mine. "Select payment", and then "pay with ..." Of course to get it to work you have to enter your publishable key and merchantIdentifier, as well as a customerId and customerEphemeralKeySecret

copper cape
#

Thanks for waiting, I run into some compilation error but it's now building.

foggy creek
#

Of course, good to hear you got it building.

copper cape
#

Ok, I got the same issue, let me investigate

foggy creek
#

Thank you

copper cape
#

The PaymentIntent is in an unexpected state. If you pass confirmation_method = manual when creating the PaymentIntent, also pass confirm = true. If server-side confirmation fails, double check you are passing the error back to the client. I saw this error from confirmPaymentSheetPayment

#

Looks like need to confirm the PaymentIntent when creating it.

foggy creek
#

Okay. One second, let me set that param to true

copper cape
#

But this will confirm the payment immediately, but you requirement is to defer the confirmation until your user accept the reservation

foggy creek
#

Oh I see, yes we do not want the payment to be confirmed right away

#

I’m not sure that will work for us. I’m currently working on migrating the app to react native from native script, and this functionality I am seeking already exists. Am I completely unable to do what I need?

copper cape
#

Do you have a PaymentIntent that works with native script?

foggy creek
#

I do not have one at the moment, I didn’t build the native script app so I would need to set it up which would take a long time

copper cape
#

I believe the behaviour is the same regardless what client you use to confirm the payment

foggy creek
#

Why does the SDK require the payment to be confirmed immediately? What is the purpose of manual confirmation method if you cannot advance the user past the payment sheet?

copper cape
#

The main purpose of manual confirmation is to only allow the paymentIntent to be confirmed from backend using a secret API key, and that's why you need to set confirm=true in backend because the client app (react-native or native script) is unable to confirm it.

foggy creek
#

Right, but in that case it’s just an automatic confirmation acting as a manual confirmation. If it were truly manual, I’d expect there to be an event to trigger the confirmation (e.g. a user accepts the reservation)

#

But I guess what I’m hearing is that what I want cannot be done?

copper cape
#

Another workaround that you can consider is to use a setup mode PaymentSheet to collect the payment method, pass it to your backend and let it create a PaymentIntent, and confirm it later.

#

However, since the paymentIntent is confirmed in a later stage, your application still needs to handle 3DS when requested.

foggy creek
#

Our users have already stored payment methods, and we also use Apple Pay. I think that option won’t allow them to use those?

copper cape
#

You can also save a Apple Pay payment method

foggy creek
#

Is there documentation on the setup mode payment sheet?

copper cape
foggy creek
#

It says directly that Apple Pay and Google pay are not supported

#

I think I will just have to remove Apple Pay from the feature and use the customFlow. Very unfortunate but I don’t think there is another option, unless the issues I am running into can be fixed.

I really don’t get what the purpose of the payment sheet requiring a confirmed payment is. There doesn’t seem to be any logical reason for that, it would be nice to have the option to resolve the payment sheet without charging a card immediately.

copper cape
#

This supports Apple Pay and doesn't require you to confirm from client side

foggy creek
#

Isn’t that what we just tested, and you reproduce Apple Pay not working in this scenario? The credit card works great in this case as long as customFlow is true, but Apple Pay fails because a confirmed payment intent is not passed back.

copper cape
foggy creek
#

Okay, I see how it is different. In this case, it is creating a setup intent instead. What is the difference between a setup intent and a payment intent?

copper cape
#

SetupIntent allows you to collect a payment method without charging your customer.

foggy creek
#

That doesn’t feel right to me, because the user already has payment methods saved and ready to use. Would this create a new setup intent every time they make a payment with one of their saved cards or Apple Pay?