iOS (Apple Pay)
Configure your app and Apple Developer account for Apple Pay.
1. Expo plugin
In app.json (or app.config.js), add the plugin with your Merchant ID:
{
"expo": {
"plugins": [
["@gmisoftware/react-native-pay", { "merchantIdentifier": "merchant.com.yourcompany.app" }]
]
}
}
The runtime API reads this Merchant ID from the native app entitlements automatically. You only need applePayMerchantIdentifier in code if you want to override the configured value at runtime.
2. Apple Developer setup
Create a Merchant ID
- Open Certificates, Identifiers & Profiles.
- Create a new Merchant ID (e.g.
merchant.com.yourcompany.app). - Note it exactly; it must match the plugin and your code.
Enable Apple Pay on your App ID
- In Identifiers, select your App ID.
- Enable Apple Pay Payment Processing.
- Associate the Merchant ID you created.
Payment Processing Certificate
- In the Merchant ID page, create a Payment Processing Certificate.
- Follow Apple’s steps (CSR, etc.) and download the certificate.
- Install it in your payment processor (e.g. Stripe, Braintree) as per their docs. The library does not process payments; your gateway uses this certificate to validate tokens.
If you are integrating with Przelewy24, see Przelewy24 for an end-to-end app + backend flow.
3. Name your business on the sheet
Apple Pay shows the total as "Pay merchant". Pass your business name as merchantName:
import { usePaymentCheckout } from '@gmisoftware/react-native-pay'
usePaymentCheckout({
merchantName: 'Your Store',
currencyCode: 'USD',
countryCode: 'US',
})
The sheet lists your cart items and then the total line "Pay Your Store", which the library adds for you. If you omit merchantName, the total uses your app's display name (CFBundleDisplayName).
4. Prebuild and run
npx expo prebuild --clean
npx expo run:ios
Testing
- The iOS Simulator shows the Apple Pay sheet without a card, but its token can't be charged. See what the Simulator can't verify.
- On an iPhone, test with an Apple Pay sandbox tester and Apple's test cards. See Sandbox on an iPhone.
- Before each release, run the release checklist.
Troubleshooting
- Button not showing / “Cannot make payments”: Ensure Merchant ID matches exactly, entitlements are present after prebuild, and the device has Wallet & Apple Pay set up with a valid card.
- See Troubleshooting for more.