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

@nekenaraonimanana/cordova-plugin-purchase-braintree

v14.0.2

Published

Cordova Braintree adapter for cordova-plugin-purchase (iOS 7.x, Android SDK 5.x).

Readme

Braintree for Cordova

This is a Cordova plugin for the Braintree mobile payment processing SDK. It extends the Cordova Purchase Plugin to add Braintree support via native payment flows (card, PayPal, Venmo, Google Pay, 3DS).

This plugin requires cordova-plugin-purchase version 13 or newer (tested with 13.15.4).

Version 14.x requirements

| Platform | Minimum | |----------|---------| | cordova-android | 12+ | | cordova-ios | 7+ | | Android API | 23 (android-minSdkVersion) | | iOS | 16.0 (deployment-target) | | Xcode (iOS build) | 16.2+ |

Braintree SDK versions bundled or resolved by this plugin:

See CHANGELOG.md for migration notes from 13.x.

Installing

From npm

cordova plugin add @nekenaraonimanana/[email protected]
cordova plugin add [email protected]

See PUBLISHING.md to publish updates.

The Cordova plugin id remains cordova-plugin-purchase-braintree (see plugin.xml).

From git

cordova plugin add https://github.com/Nekena12345/cordova-plugin-purchase-braintree-renovo.git#master
cordova plugin add [email protected]

Android — set minimum SDK in config.xml:

<platform name="android">
    <preference name="android-minSdkVersion" value="23" />
</platform>

iOS — set deployment target in config.xml:

<platform name="ios">
    <preference name="deployment-target" value="16.0" />
</platform>

On first install, the iOS hook downloads Braintree XCFrameworks into plugins/cordova-plugin-purchase-braintree/lib/ios (requires network access).

Usage

Initialization

When initializing the purchase plugin, add Platform.BRAINTREE at initialization.

CdvPurchase.store.initialize([{
    platform: CdvPurchase.Platform.BRAINTREE,
    options: { ... }
}]);

The options object should contain:

  • a clientTokenProvider or a tokenizationKey string.
  • optional configuration options for Apple Pay, Google Pay and 3DSecure.

Client Token or Tokenization Key

Check the Braintree documentation to understand the difference.

clientTokenProvider is a function that takes a callback as a parameter, this callback will accept either:

  • a string: the Client Token
  • a CdvPurchase.IError object ({isError: true, code: ErrorNumber, message: string}).

The CdvPurchase.Iaptic object contains the implementation of a client token provider. If you are using https://www.iaptic.com:

const iaptic = new CdvPurchase.Iaptic({
  url: 'https://validator.iaptic.com', appName: 'MY_APP_NAME', apiKey: 'MY_PUBLIC_KEY',
});

store.initialize([Platform.APPLE_APPSTORE, Platform.GOOGLE_PLAY, {
    platform: Platform.BRAINTREE,
    options: {
        clientTokenProvider: iaptic.braintreeClientTokenProvider
    }
}]);

tokenizationKey is just a string.

Making a purchase

Use the store.requestPayment() method to initiate a payment with Braintree.

  • amountMicros and currency are required.
  • If result.isError is set, the returned value is an error.
    • Check result.code, PAYMENT_CANCELLED means the user closed the modal window.
store.requestPayment({
  platform: CdvPurchase.Platform.BRAINTREE,
  email: GetEmailAddress(),
  items: [{
    id: 'item_id',
    title: 'An Item',
    pricing: {
        priceMicros: 11 * 1000000,
        currency: 'USD',
    }
  }],
  description: 'An item delivered before Christmas',
})
.cancelled(() => {})
.failed(error => {})
.approved(transaction => {})
.finished(transaction => {});

The native layer presents a custom payment sheet (not the deprecated Braintree Drop-In SDK). The JavaScript contract (launchDropIn result shape) is unchanged for cordova-plugin-purchase compatibility.

3DSecure

Add threeDSecure into the platform options. See ThreeDSecure.Request.

Google Pay

Add googlePay into the platform options (Android). See GooglePay.Request.

Apple Pay

The cordova-plugin-purchase-braintree-applepay extension adds Apple Pay through Braintree.

Testing

Manual QA checklist: TEST_MATRIX.md.

Integration notes with cordova-plugin-purchase: INTEGRATION.md.

Licence

The MIT License — see LICENSE.