Index of every page on this site: llms.txt
All skills
gmi-software avatar

/react-native-pay

@443959a
Run it yourself

Expert guide to @gmisoftware/react-native-pay — Apple Pay and Google Pay for React Native through Nitro Modules, with a unified usePaymentCheckout hook and native ApplePayButton / GooglePayButton views. Use when adding Apple Pay or Google Pay, configuring merchant IDs, entitlements, or the Expo config plugin, when the pay button does not appear or Google Pay reports unavailable, when handling a payment token on a backend, when testing payments, and when reasoning about what this library does and does not do with money.

  • 10 files
  • 95.5 KB
  • MIT
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/gmi-software/better-skills/react-native-pay

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencessetup.md

≈1.9k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Setup and installation

Verified against v0.0.16 (2078fdd). Every requirement below is cited to where it is actually enforced, not merely documented.

Requirements

Requirement Value Enforced by
React Native New Architecture required Nitro Modules; no version floor is declared (react-native: "*")
react-native-nitro-modules >=0.36.0 peer dependency
expo >=53.0.0 peer dependency — needed for the config plugin, not at runtime
Android minSdk 26 android/gradle.properties
Android compileSdk / targetSdk 36 android/gradle.properties
Google Play Services Wallet 19.3.0 android/build.gradle
iOS deployment target RN's min_ios_version_supported NitroPay.podspec — it inherits rather than pinning
Expo Go Not supported Native Nitro code cannot load in Expo Go

The package declares no dependencies at all, and react / react-native peers are both "*". The real floor is whatever your Nitro Modules version needs.

Install

# Expo
npx expo install @gmisoftware/react-native-pay react-native-nitro-modules

# bare React Native
npm install @gmisoftware/react-native-pay react-native-nitro-modules
cd ios && pod install && cd ..

Then rebuild the native app — this is not a JavaScript-only change.

Expo configuration

The config plugin has exactly two options:

{
  "expo": {
    "plugins": [
      [
        "@gmisoftware/react-native-pay",
        {
          "merchantIdentifier": "merchant.com.yourcompany.app",
          "enableGooglePay": true
        }
      ]
    ]
  }
}
Option Type Default Effect
merchantIdentifier string | string[] none Adds the com.apple.developer.in-app-payments entitlement and the ReactNativePayApplePayMerchantIdentifiers key in Info.plist
enableGooglePay boolean false Adds com.google.android.gms.wallet.api.enabled meta-data to AndroidManifest.xml

Two failure modes are built into those defaults:

  • Omit merchantIdentifier and the Apple Pay half of the plugin returns the config untouched. No entitlement, no Info.plist key, and at runtime startPayment fails with No Apple Pay merchant identifier configured.
  • Omit enableGooglePay and it defaults to false, at which point the plugin actively removes the wallet meta-data. Google Pay then reports itself unavailable.

Apply the plugin and rebuild:

npx expo prebuild --clean
npx expo run:ios
npx expo run:android

--clean matters here: entitlements and manifest meta-data are written during prebuild, so an existing ios/ or android/ directory will keep the old values.

What the plugin does not do

  • No Gradle or minSdk changes.
  • No Apple Pay Payment Processing Certificate — that is a manual Apple Developer step.
  • No Google Pay merchant registration.
  • No gateway configuration.
  • Nothing for bare React Native; there you edit the native projects yourself.

Apple Pay setup (iOS)

Four steps, in order. Three are outside this library.

  1. Create a Merchant ID. Apple Developer → Certificates, Identifiers & Profiles → Identifiers → Merchant IDs. The format is merchant.<reverse-dns>.
  2. Create a Payment Processing Certificate for that Merchant ID. Your gateway supplies the CSR, or you generate one and give the gateway the private key. This is what allows the token to be decrypted server-side.
  3. Enable the Apple Pay capability on your app ID. The config plugin writes the entitlement; the capability must exist on the provisioning profile or the build fails to sign.
  4. Pass the Merchant ID. Either via the plugin (recommended) or per-request with applePayMerchantIdentifier.

Native resolution order for the merchant identifier — worth knowing because it contradicts the type's own JSDoc:

1. request.applePayMerchantIdentifier, if a non-empty string
2. Info.plist ReactNativePayApplePayMerchantIdentifiers — first non-empty entry
3. otherwise: startPayment fails with "No Apple Pay merchant identifier configured"

It never reads the entitlement directly. Details: apple-pay.md.

Google Pay setup (Android)

  1. Enable enableGooglePay: true in the plugin. Without it, nothing else matters.
  2. Register with Google Pay at the Google Pay & Wallet Console to obtain a merchant ID, and complete their integration review before going live.
  3. Get gateway values from your payment provider: the gateway name ('stripe', 'braintree', 'adyen', …) and your gateway merchant ID.
  4. Pass all four Google fields on the request for production:
googlePayEnvironment: 'PRODUCTION',
googlePayMerchantId: '...',
googlePayGateway: 'stripe',
googlePayGatewayMerchantId: '...',

In TEST, the last three are optional and fall back to the placeholders 'example' / 'exampleGatewayMerchantId'. In PRODUCTION all three are required and their absence throws — surfaced to JavaScript as Failed to start payment: ....

googlePayEnvironment defaults to TEST when omitted, silently. See google-pay.md.

There is a GOOGLE_PAY_ENVIRONMENT=TEST entry in the library's android/gradle.properties. It is dead configuration — no Kotlin or Java source reads it. Changing it does nothing.

Verifying the install

# the version actually installed
node -p "require('@gmisoftware/react-native-pay/package.json').version"

# native pieces present
ls node_modules/@gmisoftware/react-native-pay/ios
ls node_modules/@gmisoftware/react-native-pay/android/src

# iOS: the pod is named NitroPay, not the npm package name
grep -i nitropay ios/Podfile.lock

# Android: entitlement / manifest results after prebuild
grep -A2 in-app-payments ios/*/*.entitlements
grep wallet.api.enabled android/app/src/main/AndroidManifest.xml

Then, in the app:

import { HybridPaymentHandler } from '@gmisoftware/react-native-pay'

console.log(HybridPaymentHandler.payServiceStatus())

If that returns an object rather than throwing, the native module is linked. On Android, call it off the initial render path — it blocks (see google-pay.md).

Build failure checklist

Symptom Cause Fix
PaymentHandler not found / HybridObject missing New Architecture off, Expo Go, or no native rebuild Enable New Arch, use a development build, rebuild
Throws on import, before any call HybridPaymentHandler is created at module scope Native module missing — this is the same problem as above, surfacing earlier
iOS: unresolved NitroPay Pod not installed cd ios && pod install
iOS: code signing fails after adding the plugin Apple Pay capability missing from the provisioning profile Add the capability in the Developer portal, regenerate the profile
Android: prefab / CMake errors Nitro native library linkage The package ships android/fix-prefab.gradle, which reorders prefab publication after the .so build — confirm it is applied
Android: minSdkVersion 26 cannot be smaller Your app targets below 26 Raise your app's minSdkVersion
Jest: throws on import No Nitro mock See testing.md

What a successful build does not prove

Linking proves the module loads. It does not prove a payment works. Both platforms need a real signed device with a real card in the wallet before any of this is verified — see testing.md.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 443959a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 3 months ago
Other metadata
metadata
{
  "package": "@gmisoftware/react-native-pay",
  "version": "0.0.16",
  "commit": "2078fdda8bdef87b51d20039d7684a255f0baadc",
  "verified": "2026-08-21",
  "repository": "https://github.com/gmi-software/react-native-pay",
  "audience": "library users and library contributors",
  "tags": "react-native, payments, apple-pay, google-pay, passkit, wallet, nitro, expo, ios, android, checkout"
}

README badge

README badge for gmi-software/better-skills/react-native-pay