#miguel-m-a_react-native-apple-pay
1 messages ยท Page 1 of 1 (latest)
๐ 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/1430913704022638744
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, looking into this now
have you checked for any failing requests in your dashboard? if there are any, can you paste the request ID here?
also, you've probably already checked this, but I want to confirm that you're using a real card with Apple Pay for testing as described here https://docs.stripe.com/apple-pay?platform=react-native#test-apple-pay
There's no failing requests in the dashboards, nor webhooks with errors. We're using the stripe sandbox.
The apple payment sheet doesn't appear so I can't put any card
ok, can you paste in the part of your code that is calling confirmPlatformPayPayment() ?
const clientSecret = await createPaymentIntent(selectedPrice.totalPrice, selectedPrice.currency);
const taxAmount = selectedPrice.totalPrice * (selectedPrice.percentage/100);
const { error, paymentIntent } = await confirmPlatformPayPayment(
clientSecret,
{
applePay: {
cartItems: [
{
label: selectedPrice.priceId,
amount: selectedPrice.totalPrice,
paymentType: PlatformPay.PaymentType.Immediate,
},
{
label: 'Tax',
amount: taxAmount,
paymentType: PlatformPay.PaymentType.Immediate,
},
{
label: selectedPrice.priceId,
amount: selectedPrice.totalPrice * taxAmount,
paymentType: PlatformPay.PaymentType.Immediate,
},
],
merchantCountryCode: 'ES',
currencyCode: selectedPrice.currency.toUpperCase(),
requiredBillingContactFields: [PlatformPay.ContactField.PhoneNumber],
}
}
)
The createPaymentIntent function calls the server and I checked that it returns a clientSecret. The selectedPrice variable is an object containing various information about the product.
hmm ok. and are you using the latest version of the react native sdk?
I'm using stripe-react-native 0.38.6
can you try updating to latest and see if you have the same issue?
I try npm @stripe/stripe-react-native update and it tells me I'm up to date, do I have to update it in another way?
that's odd, I'm seeing 0.55.0 as the latest release https://github.com/stripe/stripe-react-native
can you double check your package.json file to see if you're locking the version?
I have this line in dependencies in my package.lock: "@stripe/stripe-react-native": "^0.38.6"
What do I have to check?
try changing that to ^0.55.0
Only in package.json or also in package-lock.json?
Hi there ๐ jumping in as my teammate needs to step away.
I believe only in package.json, but you will know your project's file structure better than we will.
Bear with me a moment while I review the rest of the thread.
I'm pretty sure when I've seen this before the issue has been either the merchant ID or the certificate. Can you share your code for initializing the StripeProvider component?
The other thing that I think I recall messing with this flow is the currencyCode. I see you're casting that to upper case, does the issue persist if you leave that lowercase instead?
This goes in the App.js of the app:
<StripeProvider
publishableKey="pk_test_ourID"
merchantIdentifier='merchant.ourID'
I changed the real IDs to "ourID" since I'm not allowed to share them over Discord for safety reasons. The IDs are different and we've checked them.
I will try changin the currencyCode to lowercase now.
Changing to lowercase did nothing
Hm, then I'd suggest regenerating the certificate you're using for the project.
Just to double check, you are first making sure Apple Pay is supported and setup on the device via isPlatformPaySupported()?