#miguel-m-a_react-native-apple-pay

1 messages ยท Page 1 of 1 (latest)

fathom bladeBOT
#

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

frozen rose
#

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?

heady lynx
heady lynx
frozen rose
#

ok, can you paste in the part of your code that is calling confirmPlatformPayPayment() ?

heady lynx
#

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.

frozen rose
#

hmm ok. and are you using the latest version of the react native sdk?

heady lynx
#

I'm using stripe-react-native 0.38.6

frozen rose
#

can you try updating to latest and see if you have the same issue?

heady lynx
#

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?

frozen rose
#

can you double check your package.json file to see if you're locking the version?

heady lynx
#

I have this line in dependencies in my package.lock: "@stripe/stripe-react-native": "^0.38.6"
What do I have to check?

fathom bladeBOT
frozen rose
#

try changing that to ^0.55.0

heady lynx
#

Only in package.json or also in package-lock.json?

twin zinc
#

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?

heady lynx
#

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.

heady lynx
#

Changing to lowercase did nothing

twin zinc
#

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()?

fathom bladeBOT