Apple Pay & Google Pay
Configure wallets and native pay buttons in the Plexy React Native SDK
Apple Pay & Google Pay
Both wallets require amount and countryCode in your root configuration, plus one-time platform setup:
- Apple Pay setup — create a merchant identifier and payment processing certificate, enable the Apple Pay capability. With Expo, the
merchantIdentifierplugin option writes the entitlement for you. - Google Pay setup — enable Google Pay on your Plexy account.
Inside Drop-in, both wallets appear automatically once enabled — the configuration below tunes their behavior. As standalone components, start them with start('applepay') / start('googlepay').
Apple Pay configuration
const configuration: Configuration = {
// ...root options
applepay: {
merchantID: 'merchant.com.your-merchant-id',
merchantName: 'Your Store',
allowOnboarding: true,
},
};| Parameter | Description | Required |
|---|---|---|
merchantID | Your Apple Pay merchant identifier. | Yes |
merchantName | Merchant name used to generate a single payment summary item. | Yes, unless summaryItems is provided |
summaryItems | Array of payment summary items shown on the Apple Pay sheet. The last item's amount must equal the payment amount. Note: Plexy uses integer minor units, Apple uses decimal numbers. | Yes, unless merchantName is provided |
allowOnboarding | If true, shoppers with no eligible cards can add one from the payment sheet. Defaults to false (Apple Pay hidden for them). | No |
requiredShippingContactFields / requiredBillingContactFields | Contact fields needed to process the transaction. Empty by default. | No |
billingContact / shippingContact | Pre-filled contact information. | No |
shippingType | Display mode for shipping: shipping, pick up, deliver to. Defaults to shipping. | No |
shippingMethods | Shipping methods available in the sheet. | No |
supportedCountries | Limit payment to cards issued in specific countries. | No |
supportsCouponCode / couponCode | Show or pre-fill a coupon code field (iOS 15+). | No |
recurringPaymentRequest | Subscription setup — requires paymentDescription, regularBilling, and managementURL; optional trialBilling, tokenNotificationURL, billingAgreement. | No |
Dynamic updates on the sheet
React to shopper choices in the Apple Pay sheet with resolver callbacks:
applepay: {
merchantID: 'merchant.com.your-merchant-id',
merchantName: 'Your Store',
onShippingContactChange: (contact, resolve) => {
resolve({
paymentSummaryItems: recalculateTotals(contact),
shippingMethods: methodsFor(contact),
});
},
onShippingMethodChange: (method, resolve) => {
resolve({ paymentSummaryItems: recalculateTotals(method) });
},
onCouponCodeChange: (code, resolve) => {
resolve({ paymentSummaryItems: applyDiscount(code) });
},
},Each resolver updates the sheet in place; omit a field to keep its current value, or pass an empty shippingMethods array to signal that no shipping is available.
Google Pay configuration
const configuration: Configuration = {
// ...root options
googlepay: {
merchantAccount: 'YOUR_MERCHANT_ACCOUNT',
billingAddressRequired: true,
},
};| Parameter | Description | Required |
|---|---|---|
merchantAccount | Merchant account put in the payment token from Google to Plexy. Defaults to the value from brands. | No |
allowedCardNetworks | Card networks to support, from those supported by the Google Pay API. | No |
allowedAuthMethods | Accepted card authentication methods. | No |
totalPriceStatus | Status of the total price. Defaults to "FINAL". | No |
allowPrepaidCards / allowCreditCards | Set to false to exclude prepaid or credit cards. | No |
billingAddressRequired / billingAddressParameters | Request a billing address; parameters control format (MIN/FULL) and phone number requirement. | No |
emailRequired | Request an email address. | No |
shippingAddressRequired / shippingAddressParameters | Request a shipping address; parameters control allowed countries and phone number requirement. | No |
existingPaymentMethodRequired | Include readiness information for the configured payment methods. | No |
googlePayEnvironment | Override the Google Pay environment (WalletConstants.ENVIRONMENT_TEST or ENVIRONMENT_PRODUCTION). Defaults to match the root environment. | No |
Native pay buttons
Apple and Google both require their branded buttons for wallet entry points. The SDK ships native implementations:
import { Platform } from 'react-native';
import {
ApplePayButton,
GooglePayButton,
usePlexyCheckout,
} from '@plexy/react-native';
function WalletButton() {
const { start } = usePlexyCheckout();
return Platform.OS === 'ios' ? (
<ApplePayButton
type="BUY"
theme="BLACK"
radius={8}
style={{ height: 48 }}
onPress={() => start('applepay')}
/>
) : (
<GooglePayButton
type="PAY"
theme="DARK"
radius={8}
style={{ height: 48 }}
onPress={() => start('googlepay')}
/>
);
}Both buttons accept:
| Prop | Description |
|---|---|
type | Button label. Apple Pay: BUY, CHECKOUT, SUBSCRIBE, DONATE, ORDER, TIP, CONTINUE, PLAIN, and more. Google Pay: BUY, PAY, CHECKOUT, ORDER, SUBSCRIBE, DONATE, BOOK, PLAIN. |
theme | Apple Pay: BLACK, WHITE, WHITE_OUTLINE, AUTOMATIC. Google Pay: DARK, LIGHT. |
radius | Corner radius in points. |
onPress | Tap handler — typically start('applepay') / start('googlepay'). |
style | Standard React Native view style (set an explicit height). |
Testing
Wallets need real devices for end-to-end tests: Apple Pay requires a device with a card in Wallet (sandbox tester accounts work in the test environment), and Google Pay requires Play Services with a card added. See Test vs live payments.