#rabbit-reactnativeexpo-applepay
1 messages ยท Page 1 of 1 (latest)
@jade heron do you have an exact PaymentIntent id I can look at?
I think this one: pi_3O9EdwKwGkja34pa1vCgcrFY
It's payment in test environment.
rabbit-reactnativeexpo-applepay
Additional info, payment using card works without any issue.
๐ are you using a development build?
yes
https://docs.expo.dev/versions/latest/sdk/stripe/#apple-pay
I followed this guide which says
Apple Pay is not supported in Expo Go. To use Apple Pay, you must create a development build. This can be done with EAS Build, or locally by running npx expo run:ios.
Yep that's correct
If you go to https://stripe.com/docs/stripe-js/elements/payment-request-button on safari with the device you are testing with do you see Apple Pay at the top of the page and can you successfully checkout?
Also can you show me your code for confirmPlatformPayPayment?
I see apple pay button
basically I am threating confirmPlatformPayPayment or confirmPlatformPaySetupIntent as exactly same functions which maybe wrong of me. But I am doing brute force attempt on whatever works.
So code for usage of confirmPlatformPayPayment would be same as I sent before but confirmPlatformPaySetupIntent is replaced with confirmPlatformPayPayment
Did you go through the flow on your device?
It is in test mode so you won't be charged
But can you confirm that your device can successfully go through that flow?
yes, it goes through the flow
Thanks
I mean by card
but when I click pay it fails just with an error
if say alert and console in my code
the error I receive I have posted above
Can your device complete an Apple Pay payment at that link in safari?
๐
You said:
basically I am threating confirmPlatformPayPayment or confirmPlatformPaySetupIntent as exactly same functions which maybe wrong of me. But I am doing brute force attempt on whatever works.
Is there a chance you are calling both of these functions at the same time? That is possibly the reason you are seeing the "payment is canceled" error.
no cause I was getting the same error with just one of them
I didn't called them at the same time
everytime I replaced and made sure only one of them is called.
Hmm okay. And to be clear, the Apple Pay payment modal opens but it is when you attempt to authorize that the error happens?
Or this error occurs when you attempt to open the payment sheet?
no, when I click apple pay button which is rendered but I don't get to see wallet to pay with
Okay so it errors immediately
Is there any other alert or anything that would be happening at the same time in your code?
Like something is causing the sheet to dismiss...
I have isolated my code so there is only 3 things happen
- isPlatformPaySupported return true
- fetch client secret and create payment intent or update intent
- call pay button that fails
I assume you are on this SDK version becuase you are pinned to Expo 48?
That is a decently old version of the SDK at this point... would be good to upgrade
Yes, just harder to debug mostly
I will but for now I need to resolve
I'm still looking/thinking
Nothing jumping out at the moment
I'm trying to reproduce but I can't - my sample is on 0.33.0 though
But really your code seems fine
Something is auto closing the sheet
Do you see it attempt to open at all?
Like does it blip opening and closing?
Really you want to upgrade your Stripe React Native SDK to 0.34.0
I'm actually not intimately familiar with Expo as I always just build via the RN CLI
But I think there is a way to not have to be pinned to a version and upgrade your Stripe React Native SDK?
You also have double checked that your merchant ID is set up correctly in both your config plugin and your <StripeProvider /> component, yes?
Really you would be getting a different error though if that wasn't the case...
The real issue is something is grabbing focus away from the Apple pay payment sheet
Like it is opening since it gets to the part of the code where it then errors due to being closed...
Oh wait. It is possible that amount and label aren't supported on 0.23.3: https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md#0330---2023-09-22
As those were added in 0.33.0