npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rnw-community/react-native-payments

v2.13.0

Published

Accept Payments with Apple Pay and Android Pay using the Payment Request API.

Readme

ReactNative Payments

npm version coverage npm downloads PRs Welcome

Accept Payments with Apple Pay and Android Pay using the Payment Request API.

TurboModule-based implementation of the W3C Payment Request API (08 September 2022) for React Native — full TypeScript, a unified iOS/Android API, and an Expo config plugin. A rewrite of naoufal/react-native-payments; see Migrating from upstream if you are porting an existing integration.

For AI agents

Start with llms.txt for a curated, agent-oriented index of this package's docs and AGENTS.md for architecture and contributor conventions.

Install

yarn add @rnw-community/react-native-payments

Autolinking picks up the TurboModule on both architectures — no manual react-native link step. Complete the one-time platform setup before writing any code: iOS · Android · Expo.

Quickstart

import {
    PaymentComplete,
    PaymentMethodNameEnum,
    PaymentRequest,
    SupportedNetworkEnum,
} from '@rnw-community/react-native-payments';

const methodData = [
    {
        supportedMethods: PaymentMethodNameEnum.ApplePay,
        data: {
            merchantIdentifier: 'merchant.com.your-app.namespace',
            supportedNetworks: [SupportedNetworkEnum.Visa, SupportedNetworkEnum.Mastercard],
            countryCode: 'US',
            currencyCode: 'USD',
        },
    },
    // Add a matching AndroidPay entry to the same array to support both platforms.
];
const paymentDetails = { total: { label: 'Total', amount: { currency: 'USD', value: '10.00' } } };

const paymentRequest = new PaymentRequest(methodData, paymentDetails);

if (await paymentRequest.canMakePayment()) {
    const paymentResponse = await paymentRequest.show();
    const isConfirmed = await sendToYourBackend(paymentResponse.details); // your own gateway call

    await paymentResponse.complete(isConfirmed ? PaymentComplete.SUCCESS : PaymentComplete.FAIL);
}

Only call complete(PaymentComplete.SUCCESS) once your backend has actually confirmed the charge. A PaymentRequest is single-use — build a new one per payment attempt rather than reusing a settled request; see docs/architecture.md. For the full two-platform methodData shape, shipping/coupon change events, and payment details modifiers, see the doc map below.

Screenshots

Recording is deferred, not dropped — capture needs the on-device Maestro fleet, tracked in docs/roadmap.md. Once captured, an Apple Pay and a Google Pay sheet GIF replace this placeholder.

Doc map

Migrating

W3C compliance

This package implements the W3C Payment Request API — change events, PaymentDetailsModifier, hasEnrolledInstrument(), retry(), toJSON() and the event-handler attributes are all implemented, with a small set of documented platform deviations (Android has no in-sheet change events, iOS ignores shippingOption.selected, PaymentRequest is single-use). See the full W3C compliance checklist and each platform's known deviations in docs/platforms/.

Architecture & contributing

See AGENTS.md for the source layout, TurboModule/Expo-plugin architecture, and coverage. For end-to-end verification, see react-native-payments-example/e2e/readme.md.

License

This library is licensed under The MIT License.