PlexySDK DOCS
React Native

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:

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,
  },
};
ParameterDescriptionRequired
merchantIDYour Apple Pay merchant identifier.Yes
merchantNameMerchant name used to generate a single payment summary item.Yes, unless summaryItems is provided
summaryItemsArray 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
allowOnboardingIf true, shoppers with no eligible cards can add one from the payment sheet. Defaults to false (Apple Pay hidden for them).No
requiredShippingContactFields / requiredBillingContactFieldsContact fields needed to process the transaction. Empty by default.No
billingContact / shippingContactPre-filled contact information.No
shippingTypeDisplay mode for shipping: shipping, pick up, deliver to. Defaults to shipping.No
shippingMethodsShipping methods available in the sheet.No
supportedCountriesLimit payment to cards issued in specific countries.No
supportsCouponCode / couponCodeShow or pre-fill a coupon code field (iOS 15+).No
recurringPaymentRequestSubscription 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,
  },
};
ParameterDescriptionRequired
merchantAccountMerchant account put in the payment token from Google to Plexy. Defaults to the value from brands.No
allowedCardNetworksCard networks to support, from those supported by the Google Pay API.No
allowedAuthMethodsAccepted card authentication methods.No
totalPriceStatusStatus of the total price. Defaults to "FINAL".No
allowPrepaidCards / allowCreditCardsSet to false to exclude prepaid or credit cards.No
billingAddressRequired / billingAddressParametersRequest a billing address; parameters control format (MIN/FULL) and phone number requirement.No
emailRequiredRequest an email address.No
shippingAddressRequired / shippingAddressParametersRequest a shipping address; parameters control allowed countries and phone number requirement.No
existingPaymentMethodRequiredInclude readiness information for the configured payment methods.No
googlePayEnvironmentOverride 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:

PropDescription
typeButton label. Apple Pay: BUY, CHECKOUT, SUBSCRIBE, DONATE, ORDER, TIP, CONTINUE, PLAIN, and more. Google Pay: BUY, PAY, CHECKOUT, ORDER, SUBSCRIBE, DONATE, BOOK, PLAIN.
themeApple Pay: BLACK, WHITE, WHITE_OUTLINE, AUTOMATIC. Google Pay: DARK, LIGHT.
radiusCorner radius in points.
onPressTap handler — typically start('applepay') / start('googlepay').
styleStandard 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.

On this page