{"id":48473627,"url":"https://github.com/smarkets/react-native-paypal","last_synced_at":"2026-04-07T07:48:18.069Z","repository":{"id":33929289,"uuid":"152743333","full_name":"smarkets/react-native-paypal","owner":"smarkets","description":"React Native library that implements PayPal Checkout flow using purely native code","archived":false,"fork":false,"pushed_at":"2024-08-01T05:28:42.000Z","size":1291,"stargazers_count":117,"open_issues_count":38,"forks_count":54,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-04-07T07:48:14.887Z","etag":null,"topics":["android","braintree","ios","paypal","paypal-checkout","react-native"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smarkets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-12T11:53:04.000Z","updated_at":"2025-11-16T10:19:39.000Z","dependencies_parsed_at":"2023-01-15T03:30:28.905Z","dependency_job_id":null,"html_url":"https://github.com/smarkets/react-native-paypal","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/smarkets/react-native-paypal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarkets%2Freact-native-paypal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarkets%2Freact-native-paypal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarkets%2Freact-native-paypal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarkets%2Freact-native-paypal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarkets","download_url":"https://codeload.github.com/smarkets/react-native-paypal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarkets%2Freact-native-paypal/sbom","scorecard":{"id":832573,"data":{"date":"2025-08-11","repo":{"name":"github.com/smarkets/react-native-paypal","commit":"12a19bf745f5a037cfad96101a32ac2cb42bc66b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":4,"reason":"Found 6/13 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: paypalExample/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"56 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-f5x2-xv93-4p23","Warn: Project is vulnerable to: GHSA-gmpm-xp43-f7g6","Warn: Project is vulnerable to: GHSA-pf27-929j-9pmm","Warn: Project is vulnerable to: GHSA-327c-qx3v-h673","Warn: Project is vulnerable to: GHSA-x4cf-6jr3-3qvp","Warn: Project is vulnerable to: GHSA-mph8-6787-r8hw","Warn: Project is vulnerable to: GHSA-7mhc-prgv-r3q4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-4cpg-3vgw-4877","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-gff7-g5r8-mg8m","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T18:07:21.183Z","repository_id":33929289,"created_at":"2025-08-23T18:07:21.184Z","updated_at":"2025-08-23T18:07:21.184Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","braintree","ios","paypal","paypal-checkout","react-native"],"created_at":"2026-04-07T07:48:17.452Z","updated_at":"2026-04-07T07:48:18.062Z","avatar_url":"https://github.com/smarkets.png","language":"Objective-C","funding_links":["https://developer.paypal.com/docs/integration/direct/rest/currency-codes/","https://developer.paypal.com/docs/api/payments/v1/"],"categories":[],"sub_categories":[],"readme":"# react-native-paypal\n\n[![npm version](https://img.shields.io/npm/v/react-native-paypal.svg)](https://www.npmjs.com/package/react-native-paypal)\n![npm](https://img.shields.io/npm/dm/react-native-paypal.svg)\n[![GitHub license](https://img.shields.io/github/license/smarkets/react-native-paypal.svg)](https://github.com/smarkets/react-native-paypal/blob/master/LICENSE)\n\n\nReact Native library that implements PayPal [Checkout](https://developers.braintreepayments.com/guides/paypal/checkout-with-paypal/) flow using purely native code.\n\n![Demo](https://smrkts.co/2yqrDKT)\n\n## Getting started\n\n`$ npm install react-native-paypal --save` or `$ yarn add react-native-paypal`\n\n### Mostly automatic installation\n\n1. `$ react-native link react-native-paypal`. Check the result, if iOS and/or Android project files are unchanged, do the steps described in Manual installation. \n1. [Android] Add `implementation \"com.braintreepayments.api:braintree:3.+\"` and `implementation \"com.braintreepayments.api:data-collector:3.+\"` in `android/app/build.gradle`.\n1. [iOS] Add `pod 'Braintree', '~\u003e 4'` and `pod 'Braintree/DataCollector'` to your Podfile.\n1. [iOS] Run `pod install`\n1. [iOS] Register a URL scheme in Xcode (**must** always start with your Bundle Identifier and end in `.payments` - e.g. `your.app.id.payments`). See details [here](https://developers.braintreepayments.com/guides/paypal/client-side/ios/v4#register-a-url-type).\n1. [iOS] Edit your `AppDelegate.m` as follows:\n    ```objc\n    #import \"RNPaypal.h\"\n\n    - (BOOL)application:(UIApplication *)application \n      didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n    {\n      [[RNPaypal sharedInstance] configure];\n    }\n\n    // if you support only iOS 9+, add the following method\n    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url\n      options:(NSDictionary\u003cUIApplicationOpenURLOptionsKey,id\u003e *)options\n    {\n      return [[RNPaypal sharedInstance] application:application openURL:url options:options];\n    }\n    \n    // otherwise, if you support iOS 8, add the following method\n    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url\n      sourceApplication:(NSString *)sourceApplication annotation:(id)annotation\n    {\n      return [[RNPaypal sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];\n    }\n    \n    ```\n\nAt this point you should be able to build both Android and iOS.\n\n#### Extra setup step \n\nIf your application ID has underscores in it (e.g. `com.example_app`), an additional setup step is required. Otherwise, you can skip this section.\n\nInside `ApplicationManifest.xml` add a `BraintreeBrowserSwitchActivity`. Specify the `android:scheme` to be your application id without underscores and `.braintree` appended to it:\n\n```xml\n\u003cactivity android:name=\"com.braintreepayments.api.BraintreeBrowserSwitchActivity\"\n  android:launchMode=\"singleTask\"\u003e\n  \u003cintent-filter\u003e\n      \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n      \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n      \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n      \u003cdata android:scheme=\"com.exampleapp.braintree\" /\u003e\n  \u003c/intent-filter\u003e\n\u003c/activity\u003e\n```\n\n### Manual installation\n\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n1. Go to `node_modules` ➜ `react-native-paypal` and add `RNPaypal.xcodeproj`\n1. In XCode, in the project navigator, select your project. Add `libRNPaypal.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n1. In XCode, in the project navigator, select your project. Add `$(SRCROOT)/../node_modules/react-native-paypal/ios` to your project's `Build Settings` ➜ `Header Search Paths`\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n  - Add `import com.smarkets.paypal.RNPaypalPackage;` to the imports at the top of the file\n  - Add `new RNPaypalPackage()` to the list returned by the `getPackages()` method\n1. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-paypal'\n  \tproject(':react-native-paypal').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-paypal/android')\n  \t```\n1. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      implementation project(':react-native-paypal')\n  \t```\n\n\n## Usage\n\nFirst you need to get a valid token from your server. Refer to [this](https://developers.braintreepayments.com/start/hello-client/ios/v3#get-a-client-token).\n\nThen you can execute the following code, for example reacting to a button press.\n\n```javascript\nimport { requestOneTimePayment, requestBillingAgreement } from 'react-native-paypal'; \n\n// For one time payments\nconst {\n\tnonce,\n\tpayerId,\n\temail,\n\tfirstName,\n\tlastName,\n\tphone\n} = await requestOneTimePayment(\n  token,\n  {\n    amount: '5', // required\n    // any PayPal supported currency (see here: https://developer.paypal.com/docs/integration/direct/rest/currency-codes/#paypal-account-payments)\n    currency: 'GBP',\n    // any PayPal supported locale (see here: https://braintree.github.io/braintree_ios/Classes/BTPayPalRequest.html#/c:objc(cs)BTPayPalRequest(py)localeCode)\n    localeCode: 'en_GB', \n    shippingAddressRequired: false,\n    userAction: 'commit', // display 'Pay Now' on the PayPal review page\n    // one of 'authorize', 'sale', 'order'. defaults to 'authorize'. see details here: https://developer.paypal.com/docs/api/payments/v1/#payment-create-request-body\n    intent: 'authorize', \n  }\n);\n\n// For vaulting paypal account see: https://developers.braintreepayments.com/guides/paypal/vault\nconst {\n\tnonce,\n\tpayerId,\n\temail,\n\tfirstName,\n\tlastName,\n\tphone\n} = await requestBillingAgreement(\n  token,\n  {\n    billingAgreementDescription: 'Your agreement description', // required\n    // any PayPal supported currency (see here: https://developer.paypal.com/docs/integration/direct/rest/currency-codes/#paypal-account-payments)\n    currency: 'GBP',\n    // any PayPal supported locale (see here: https://braintree.github.io/braintree_ios/Classes/BTPayPalRequest.html#/c:objc(cs)BTPayPalRequest(py)localeCode)\n    localeCode: 'en_GB',\n  }\n);\n\n// For device data collection see: https://developers.braintreepayments.com/guides/advanced-fraud-management-tools/device-data-collection/\nconst { deviceData } = await requestDeviceData(token);\n```\n\n## Creating/Finding client token\nNote that the client token should be served via a backend service but can be hardcoded:\n1. Go to https://www.braintreegateway.com or https://sandbox.braintreegateway.com/ and login or create an account\n2. Click the gear at the top and select to API\n3. You can find your token under `Tokenization Keys`.  You will need to create one if none exists\n\n## Backend implementation\nFor an overview of the braintree payment flow see https://developers.braintreepayments.com/start/overview\n\nThis library covers the client setup here: https://developers.braintreepayments.com/start/hello-client\n\nIt does NOT however cover the server portion here: https://developers.braintreepayments.com/start/hello-server\n\nYou will need the server portion in order to complete your transactions.  See a simple example of this server in /exampleServer.  The example app is pointed to this on default\n\n## Troubleshooting\n* Check native code logs (in xCode for iOS or `adb logcat *:E` for Android).  These may give additional information about issues\n* Try comparing your app implementation to the example app.  It may help you find a step you missed.  If you experience any issues with the example app or instructions missing from the Readme, please open an issue (or fix with a PR :))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarkets%2Freact-native-paypal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarkets%2Freact-native-paypal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarkets%2Freact-native-paypal/lists"}