{"id":4747,"url":"https://github.com/alanhhwong/react-native-braintree","last_synced_at":"2025-08-04T02:31:37.371Z","repository":{"id":57335827,"uuid":"43669446","full_name":"alanhhwong/react-native-braintree","owner":"alanhhwong","description":"A react native interface for integrating payments using Braintree's v.zero SDK","archived":false,"fork":false,"pushed_at":"2020-05-06T03:04:52.000Z","size":27471,"stargazers_count":112,"open_issues_count":17,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-23T06:27:52.447Z","etag":null,"topics":[],"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/alanhhwong.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":"2015-10-05T06:53:48.000Z","updated_at":"2024-03-04T09:50:01.000Z","dependencies_parsed_at":"2022-09-14T19:42:06.908Z","dependency_job_id":null,"html_url":"https://github.com/alanhhwong/react-native-braintree","commit_stats":null,"previous_names":["alawong/react-native-braintree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alanhhwong/react-native-braintree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanhhwong%2Freact-native-braintree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanhhwong%2Freact-native-braintree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanhhwong%2Freact-native-braintree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanhhwong%2Freact-native-braintree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanhhwong","download_url":"https://codeload.github.com/alanhhwong/react-native-braintree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanhhwong%2Freact-native-braintree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267670237,"owners_count":24125110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-01-05T20:17:22.068Z","updated_at":"2025-08-04T02:31:37.064Z","avatar_url":"https://github.com/alanhhwong.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Integrations"],"readme":"# react-native-braintree\n\nA react native interface for integrating payments using [Braintree's v.zero SDK](https://developers.braintreepayments.com/start/overview).\n![Accepts Credit/Debit Cards](/Screenshots/vzero.png)\n\n## Sample\nFull Client + Server sample can be found here:\n[https://github.com/alawong/BTRNSample](https://github.com/alawong/BTRNSample)\n\n## Usage\n\n### Setup\n```js\nvar BTClient = require('react-native-braintree');\nBTClient.setup(\u003ctoken\u003e);\n```\nYou can find a demo client token [here](https://developers.braintreepayments.com/start/hello-client/ios/v3).\n\n### Show Payment Screen\nv.zero\n```js\nBTClient.showPaymentViewController().then(function(nonce) {\n  //payment succeeded, pass nonce to server\n})\n.catch(function(err) {\n  //error handling\n});\n```\n\nPayPal only\n```js\nBTClient.showPayPalViewController().then(function(nonce) {\n  //payment succeeded, pass nonce to server\n})\n.catch(function(err) {\n  //error handling\n});\n```\n\n## Custom Integration\nIf you only want to tokenize credit card information, you can use the following:\n```js\nBTClient.getCardNonce(\"4111111111111111\", \"10\", \"20\").then(function(nonce) {\n  //payment succeeded, pass nonce to server\n})\n.catch(function(err) {\n  //error handling\n});\n```\n\n### One Touch\nTo take advantage of [One Touch](https://developers.braintreepayments.com/guides/one-touch/overview/ios/v3), there are additional setup required:\n\n1. Register a URL scheme in Xcode (should always start with your Bundle ID)\n  ![Register URL Scheme](/Screenshots/urlscheme.png)\n\n2. Use setupWithURLScheme instead, passing the url scheme you have registered in previous step\n  ```js\n  var BTClient = require('react-native-braintree');\n  BTClient.setupWithURLScheme(\u003ctoken\u003e, \u003curl scheme\u003e);\n  ```\n\n3. Add this delegate method (callback) to your AppDelegate.m\n  ```objc\n  #import \u003cRNBraintree.h\u003e\n\n  - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {\n    return [[RNBraintree sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];\n  }\n  ```\n\n4. Optionally, install the [fake PayPal wallet app](https://github.com/braintree/fake-wallet-app-ios) in your simulator to simulate and test responses\n\n## Installation\n1. `react-native init BTRNSample` (skip for existing projects)\n2. Run `npm install react-native-braintree --save` to add the package\n3. Inside the ``ios/`` directory, create a Podfile:\n\n  ```ruby\n  # Podfile for cocoapods 1.0\n  source 'https://github.com/CocoaPods/Specs.git'\n  target 'yourAppTarget' do\n    pod 'React', :path =\u003e '../node_modules/react-native', :subspecs =\u003e [\n      'Core',\n      'RCTImage',\n      'RCTNetwork',\n      'RCTText',\n      'RCTWebSocket'\n    ]\n    pod 'react-native-braintree', :path =\u003e '../node_modules/react-native-braintree'\n  end\n  ```\n\n  Or if you use an older CocoaPods version:\n  ```ruby\n  source 'https://github.com/CocoaPods/Specs.git'\n  pod 'React', :path =\u003e '../node_modules/react-native', :subspecs =\u003e [\n    'Core',\n    'RCTImage',\n    'RCTNetwork',\n    'RCTText',\n    'RCTWebSocket'\n  ]\n  pod 'react-native-braintree', :path =\u003e '../node_modules/react-native-braintree'\n  ```\n\n4. Run `pod install`.  This installs the Braintree iOS SDK and a new workspace is created.\n\n5. Open `BTRNSample.xcworkspace`\n\n6. Under your app target -\u003e build settings, look for `Other Linker Flags` and add `$(inherited)`\n\n  ![Accepts Credit/Debit Cards](/Screenshots/linker.png)\n\n7. Build and run project!  If it fails the first time, clean and rebuild.\n\nBecause React Native's iOS code is now pulled in via CocoaPods, you also need to remove the ``React``, ``RCTImage``, etc. subprojects from your app's Xcode project.\n\n![Remove Libraries](/Screenshots/removeLibraries.png)\n\n\n## Requirements\n\nTested with:\n* Node 4.1.0\n* npm 2.14.3\n* react-native 0.8.0\n\n## License\n\nreact-native-braintree is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanhhwong%2Freact-native-braintree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanhhwong%2Freact-native-braintree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanhhwong%2Freact-native-braintree/lists"}