stripe-react-native
stripe-react-native copied to clipboard
Production issue with Apple Pay
Hello,
One year ago I made a thread having an issue with Apple Pay: https://github.com/stripe/stripe-react-native/issues/945. One year later I'm working back on that project and I'm trying to fix things but nothing seems to have changed.
A bit of context
My customer is "renting" power banks, for free in fact, but I need to take a Hold of 35€ in case people don't bring back the power bank after two days to the station.
I followed the doc using initPaymentSheet
from https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-apple-pay.
Google pay
For Google Pay, everything works so far.
Apple pay
- I've no issue in staging (com.stride.power.staging), the validation seems to pass.
- But in production, things get worse… And this is really annoying because we are losing a lot of user conversions due to this case.
The only difference is the PUBLISHABLE_KEY (pk_test vs real one) and the bundle identifier (between apps). I've shared a lot of screenshots with the configuration and code below.
Here is the log from Stripe, I've no idea what the CVC has to do with apple pay, this is not asked anywhere. (https://dashboard.stripe.com/logs/req_fMMpcFFZtn0oFh)
Thanks !
Side note
- I'm using two app IDs:
com.stride.power.staging
(works with that config) andcom.stride.power
(production, doesn't work) - ✅ I've been able to use Apple Pay without any issue from the Stripe customer portal (now it's proposed, but some months ago it wasn't). So I guess it's related to some configuration. This can be a workaround for waiting for a fix of my issue
Context
- App link (if you want to try) https://apps.apple.com/fr/app/stride-recharge-%C3%A0-linfini/id1596882572
- OS: iOS
- "@stripe/stripe-react-native": "0.23.3",
Additional screenshots
hey @ScreamZ , do you only get this error when attempting to use apple pay? Inputting the card data directly into payment sheet results in a success?
If it's not working in production then I do think there's an actual validation issue happening here...
Yes, this works most on time with payment sheet, but Apple Pay fails (and sometime works I don't know why). Invalid CVC they said but it's never prompted and the whole user base is getting this error.
Not only my card, what I don't get is how it can be related to cvc using Apple Pay this is non-sens
Hm, I'm not sure what could be causing that in the Stripe React Native library. Maybe you have some radar rules set that are causing this?
Could you share an example setup intent ID with me that I can look into?
Hm, I'm not sure what could be causing that in the Stripe React Native library. Maybe you have some radar rules set that are causing this?
No radar on this account enabled
Could you share an example setup intent ID with me that I can look into?
Yeah you have one on first screenshot isn't ?
I've exactly the same error.
Have you found a solution?
I've switched to the customer portal to add card, this way stripe manage the signature and this works on their side
Hey folks, I did some digging and the decline is not from Stripe, but from the card network. It shouldn't have anything to do with your iOS certs either. If you try a non-visa card, does it work?
I don't have access to a non-visa card.
But: I've tried two different visa cards, same error (invalid_cvc). Both cards work fine when you pay directly with the card and not trough ApplePay. Both cards even work with ApplePay when you pay for something (createStripePayment). The payment method is saved afterwards, so I can do paments in the future without getting the Stripe payment sheet. The error (invalid_cvc) only appears if you want to add the card as a payment method without paying for something (createSetupIntent).
EDIT: The problem really only exists with visa cards. A mastercard works fine. Thus, the deadly combination is ApplePay + createSetupIntent + Visa card.
I don't have access to a non-visa card.
But: I've tried two different visa cards, same error (invalid_cvc). Both cards work fine when you pay directly with the card and not trough ApplePay. Both cards even work with ApplePay when you pay for something (createStripePayment). The payment method is saved afterwards, so I can do paments in the future without getting the Stripe payment sheet. The error (invalid_cvc) only appears if you want to add the card as a payment method without paying for something (createSetupIntent).
I didn't had this case, i was only setting setupIntent, but sometimes its works, its very random, even on my own visa card, sometime it works, sometime it doesn't. (I've made multiple try).
Maybe stripe you should reach visa network and escalade the issue with them. There is no CVC involved in apple payment. Also i can confirm that using apple pay with a visa on the customer portal interface (from your) works.
@charliecruzan-stripe Can you escalate this?
I have, we've reached out to the card networks
Also having this problem. Comparing the UX of the Stripe sheet vs another app where this exact flow works (register visa card as a payment method using Apple Pay "without payment") I see this potential hint:
- Stripe Apple Pay sheet shows "{CompanyName}\nAmount Pending".
- Other app shows "Pay {CompanyName}\n0 {Currency}".
Not sure if that makes any difference behind the scenes, but at least VISA cards seem to work in the other app and not ours. Note, the other app is not using Stripe, or at least not Stripe's payment sheet.
EDIT: Found a workaround. Pass paymentSummaryItems
(or I guess cartItems
in the latest version) to initPaymentSheet
with the "Immediate" paymentType. This works for me:
await initPaymentSheet({
applePay: {
merchantCountryCode,
paymentSummaryItems: [
{
paymentType: 'Immediate',
amount: '0',
label: 'Some Label',
isPending: true,
},
],
},
})
This shows the same UI as before but you can also skip isPending
to show a payment of 0. We have yet to deploy this and I don't know if there are side effects of this change.
Also having this problem. Comparing the UX of the Stripe sheet vs another app where this exact flow works (register visa card as a payment method using Apple Pay "without payment") I see this potential hint:
- Stripe Apple Pay sheet shows "{CompanyName}\nAmount Pending".
- Other app shows "Pay {CompanyName}\n0 {Currency}".
Not sure if that makes any difference behind the scenes, but at least VISA cards seem to work in the other app and not ours. Note, the other app is not using Stripe, or at least not Stripe's payment sheet.
EDIT: Found a workaround. Pass
paymentSummaryItems
(or I guesscartItems
in the latest version) toinitPaymentSheet
with the "Immediate" paymentType. This works for me:await initPaymentSheet({ applePay: { merchantCountryCode, paymentSummaryItems: [ { paymentType: 'Immediate', amount: '0', label: 'Some Label', isPending: true, }, ], }, })
This shows the same UI as before but you can also skip
isPending
to show a payment of 0. We have yet to deploy this and I don't know if there are side effects of this change.
Stripe is generally not working well with payment intent = 0 because they don't support it as it doesn't allow them to proceed money cut on their purpose. This could be nice if this is working.
Stripe is generally not working well with payment intent = 0 because they don't support it as it doesn't allow them to proceed money cut on their purpose. This could be nice if this is working.
Well it is working for me. Maybe because we have a custom pricing plan.
@ScreamZ sorry for the of top question, but maybe you can leave some recommendations for me in my question
https://github.com/stripe/stripe-react-native/issues/1494
Thank you a lot in advance :)