stripe-react-native: CurrencyCode prop missing on ApplePay settings for initPaymentSheet
Describe the bug
We initialized a new payment sheet with support for Apple Pay. In the initPaymentSheet is a config object for Apple Pay with the ApplePayParams: https://stripe.dev/stripe-react-native/api-reference/modules/PaymentSheet.html#ApplePayParams
When we use the cartItems with the item (label, amount, paymentType), and we see this in the native Apple Pay sheet.
The issue is that ApplePayParams does not accept any currencyCode param and the value of cartItems is displayed only in USD. The Apple docs show that PkPaymentRequest received currencyCode (https://developer.apple.com/documentation/passkit/pkpaymentrequest/1619248-currencycode) .
Is there a way to get this working, to either enable currencyCode to be passed in or suggest another way of doing this?
To Reproduce
- Create a new initPaymentSheet
- Pass in ApplePay params
- Observe the Apple Pay native sheet always showing USD
Expected behavior
ApplePayParams enable you to pass the currencyCode param.
Screenshots
Smartphone (please complete the following information):
- Device: iPhone 14 (Simulator)
- OS: iOS 16
- Version: 0.26.0
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 5
- Comments: 16
@charliecruzan-stripe - any updates please?
Ah I see what you mean, yeah we do need to add support for that!
We also encountered this problem on our application. Apple is becoming more strict during the reviews and demands that all Apple Pay details are present and correct. We need to be able to customize the currency of the Apple Pay summary and/or cart items during a payment method configuration (setup intent created from server).
Will preface this with the following: This is in no way a good workaround, should be used just as a temporariy patch until this is fixed internally. Someone with a bit more time can probably make it nicer/more versatile so will leave this here.
Issue stemps from Pods -> StripePaymentSheet -> STPApplePayContext+PaymentSheet.swift where we have:
Considering SetupIntent does not allow for currency to be set nor we have that option within initPaymentSheet the quickest way i found is to actually just change the default based on need. This works for situations where single currency is needed.
Within podfile and under post_install do |installer| amend your post_install hook to include:
I’ve tested it both locally (device and simulator) and on a ci/cd built app and it works.
Replace “GBP” with desired currency as per need.
Again please use with caution.
@charliecruzan-stripe - any updates please?
No update yet, have not started work on this
@charliecruzan-stripe Hey Charlie, we are using Setup Intent (future payment instead of immediate payment intent on the server.
The NodeJS call for stripe.setupIntents.create does not include currency or amount.
Currently the only workaround was to handle Apple Pay payment outside of the initPaymentSheet call with confirmPlatformPaySetupIntent, where we could specify the currencyCode.