---
name: react-native-pay
description: >-
  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.
license: MIT
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
title: react-native-pay
canonical_url: https://skilld.dev/gh/gmi-software/better-skills/react-native-pay
last_updated: 2026-09-29T07:59:41.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/api.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/api.md), [references/apple-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/apple-pay.md), [references/architecture.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/architecture.md), [references/contributing.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/contributing.md), [references/debugging.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/debugging.md), [references/google-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/google-pay.md), [references/security.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/security.md), [references/setup.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/setup.md), [references/testing.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/testing.md).
>
> If the user asked to install this Skill, run `npx skilld install gmi-software/better-skills/react-native-pay`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/react-native-pay`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/gmi-software/better-skills/react-native-pay) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/react-native-pay`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/react-native-pay --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/react-native-pay --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# react-native-pay

Skill for **`@gmisoftware/react-native-pay`**. Presents the platform payment sheet (Apple Pay /
Google Pay) and returns a payment token to JavaScript.

**This library does not charge anyone.** It tokenizes. Everything after that is your backend.

Paths like `package/src/...` are relative to a **library checkout**, not this skills repo.

## Version verification

```text
Package:            @gmisoftware/react-native-pay
Version:            0.0.16
Commit:             2078fdda8bdef87b51d20039d7684a255f0baadc
Verification date:  2026-08-21
```

`0.0.x` — treat the API as unstable; re-verify against the installed copy.

```bash
npm view @gmisoftware/react-native-pay version
node -p "require('@gmisoftware/react-native-pay/package.json').version"
```

## When to use

- Adding Apple Pay or Google Pay to React Native / Expo
- Merchant IDs, entitlements, Expo config plugin
- Button missing / Google Pay unavailable
- Backend token handling and gateway choice
- Testing payments; judging whether an integration is safe to ship
- Changing Nitro specs / Swift / Kotlin / config plugin

## When NOT to use

| Situation | Instead |
| --- | --- |
| Card fields, PayPal, subscriptions billing | Your gateway's React Native SDK |
| Charging, refunds, webhooks, reconciliation | Gateway **server** SDK |
| Apple Pay on the web | Apple's web Payment Request docs |
| Wallet passes / loyalty cards | PassKit pass APIs |
| Showing backend decline inside the Apple Pay sheet | Not possible today — see limitations |

## Core architecture

```text
JS builds PaymentRequest
  → HybridPaymentHandler.startPayment(request)
  → OS sheet (PassKit / Google Pay)
  → encrypted token → PaymentResult
  → YOUR CODE → YOUR BACKEND → gateway charge
```

| Export | Role |
| --- | --- |
| `HybridPaymentHandler` | Availability + `startPayment` |
| `usePaymentCheckout` | Cart state, availability, status |
| `ApplePayButton` / `GooglePayButton` | Platform-exclusive native buttons |

`usePaymentCheckout` and the exported `HybridPaymentHandler` each call `createHybridObject` at
module scope — two native instances. Pick one; do not mix
([architecture.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/architecture.md)).

Full surface: [api.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/api.md). No subpath exports.

## Security boundary (read first)

| Question | Answer |
| --- | --- |
| Network requests in the library? | **No** |
| Stores credentials/tokens? | **No** |
| Contacts a payment gateway? | **No** (gateway name is OS config only) |
| Charges the card? | **No** |
| Raw token exposed to JS? | **Yes** — `PaymentResult.token.paymentData` |

```text
LIBRARY:  present sheet, return token
YOU:      send token to backend over TLS
BACKEND:  authorise/capture with SECRET keys
```

1. **Never put gateway secrets in the client** (source, `.env`, `app.config.js`, binary).
2. **Never trust client-reported amounts** — backend recomputes from its order record.
3. **Treat the token as short-lived** — do not log, persist, or send off-backend.
4. **Crash/analytics must not capture `paymentData`.**
5. **UI contract is `pending` → `succeeded` | `failed`** from the backend — not the sheet.
6. **Authorise the caller against the referenced order** before charging.

Details: [security.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/security.md).

## Critical behaviours

1. **Apple Pay sheet always reports success** — hardcoded `.success` after 1s; sheet success ≠
   payment succeeded ([apple-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/apple-pay.md)).
2. **Google Pay defaults to TEST** — omitting `googlePayEnvironment` → test tokens that cannot
   charge; set `'PRODUCTION'` explicitly ([google-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/google-pay.md)).
3. **`canMakePayments` differs** — iOS queries the device; Android is a string list check. Prefer
   `payServiceStatus().canMakePayments` on Android.
4. **Failures resolve, they do not reject** — check `result.success`, do not rely on `try/catch`.

## Problem → reference routing

| Problem | Start here |
| --- | --- |
| Safe to ship? Backend responsibilities | [security.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/security.md) |
| Token → gateway (Stripe / Braintree / Adyen) | security + [api.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/api.md) |
| TEST vs PRODUCTION Google Pay | [google-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/google-pay.md) |
| **Setup / Expo / native wiring** | [setup.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/setup.md) |
| Apple Pay from scratch | setup → [apple-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/apple-pay.md) |
| Google Pay from scratch | setup → [google-pay.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/google-pay.md) |
| Button missing / unavailable | [debugging.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/debugging.md) |
| Exact API / field names | [api.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/api.md) |
| Testing on simulator/device; release gate | [testing.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/testing.md) |
| Native architecture | [architecture.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/architecture.md) |
| Contributing to the library | [contributing.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/contributing.md) |

## Common mistakes

- Shipping Stripe/Braintree **secret** keys in the app
- Treating sheet success as a successful charge
- Omitting `googlePayEnvironment: 'PRODUCTION'`
- Gating Android UI on `canMakePayments` alone
- `try/catch` around `startPayment` for cancellation
- Using Expo Go (Nitro requires a development build)
- Logging or sending `PaymentResult` to crash/analytics
- Inventing APIs (`processPayment`, `stripeSecretKey`, `onPaymentCaptured` — none exist)
- Mixing `usePaymentCheckout` with the exported `HybridPaymentHandler.startPayment`

## Troubleshooting

1. Module missing / Expo Go → [setup.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/setup.md)
2. Availability / button → platform refs + [debugging.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/debugging.md)
3. Wrong money / token shape → [security.md](https://skilld.dev/api/skills-raw/gmi-software/better-skills/react-native-pay/references/security.md)
4. Confusing sheet result → critical behaviours above

## Known limitations

| Limitation | Consequence |
| --- | --- |
| iOS sheet always succeeds | Backend decline cannot appear in Apple Pay UI |
| Android ignores custom `supportedNetworks` | Hardcoded Visa/MC/Amex/Discover |
| One payment at a time | Second `startPayment` overwrites the first |
| Buttons are platform-exclusive | Branch on `Platform.OS` |
| `transactionId` is a client UUID | Not a gateway idempotency key |
| No Expo Go | Development build required |
| Simulator/emulator tokens unusable | Sheet may open; live charge needs a signed device |

## Accuracy

Never invent configuration keys or claim "PCI compliant". Describe what crosses the boundary.
Jest mocks Nitro — green tests do not prove a payment works.
