Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
390aa0a
Customize text for call to action button
adrianchinghc Aug 10, 2016
18d6945
Optional call to action text
adrianchinghc Aug 13, 2016
a05a5f7
Merge pull request #5 from adrianchinghc/feature/customize_call_to_ac…
kraffslol Aug 16, 2016
f48181d
Bump version
kraffslol Aug 16, 2016
85635cd
v2.0.0
kraffslol Aug 16, 2016
6f3c9c2
RN 0.30+ Fix
kraffslol Aug 16, 2016
e7493bc
v2.0.1
kraffslol Aug 16, 2016
829ee25
Pass CV in iOS
edvinasbartkus Aug 10, 2016
d875757
Pass CVV in Android
edvinasbartkus Aug 10, 2016
20a8239
Example with CVV
edvinasbartkus Aug 10, 2016
518901f
Merge pull request #6 from edvinasbartkus/cvv
kraffslol Aug 25, 2016
4dfcea5
Version 2.1.0
kraffslol Aug 25, 2016
6f13a4f
rnpm deprecated. Updated readme to reflect this.
kraffslol Sep 2, 2016
4735296
added advanced fraud tool (data collector)
Sep 11, 2016
73e33f9
pass paypal user info back to javascript
faceyspacey Sep 30, 2016
4e175bb
Fix #16
FerdinandvHagen Oct 1, 2016
00798db
Merge pull request #17 from FerdinandvHagen/master
kraffslol Oct 3, 2016
3ba1f52
Merge pull request #14 from faceyspacey/patch-2
kraffslol Oct 3, 2016
3b3c771
Merge pull request #8 from iosipeld/master
kraffslol Oct 3, 2016
303f3a2
fix comilation error in ios.js
the-simian Oct 7, 2016
6f9532f
Merge pull request #18 from the-simian/fix-broken-ios
kraffslol Oct 8, 2016
b722e69
Version 2.2.0
kraffslol Oct 8, 2016
fd968c3
Using more unique ActivityEventListener requestCode to prevent collis…
kylejones Oct 17, 2016
6016c4a
Merge pull request #19 from kylejones/more-unique-request-code
kraffslol Oct 19, 2016
340c90d
Version 2.2.1
kraffslol Oct 19, 2016
5893cd9
change the CardBuilder Validate to false
the-simian Dec 9, 2016
08642d4
Update version
the-simian Dec 9, 2016
bd0519a
feat(android): add compatible showPayPalViewController function
Dec 15, 2016
96264f8
Merge pull request #23 from the-simian/patch-1
kraffslol Dec 16, 2016
5a3d11e
Merge pull request #25 from Massagio/feat/android_paypal
kraffslol Dec 16, 2016
de59ab3
2.4.0
kraffslol Dec 16, 2016
e914893
add some ios one touch notes
darron-haworth Jan 2, 2017
2cbe3a5
edit readme One Touch notes
darron-haworth Jan 2, 2017
3c5f257
Merge pull request #29 from darron-haworth/master
kraffslol Jan 3, 2017
6f2819d
Push modal onto presentedViewController
BlakeWilliams Jan 11, 2017
cd84eba
Fix dismissal
BlakeWilliams Jan 11, 2017
04ebd59
Handle nil tokenizedPayPalAccount
BlakeWilliams Jan 11, 2017
df3255b
Merge pull request #30 from BlakeWilliams/bmw-modal-fix
kraffslol Jan 14, 2017
cda4183
Merge pull request #31 from BlakeWilliams/bmw-paypal-fix
kraffslol Jan 14, 2017
3a1b61a
introduce runCallback to check if should call callback
TSMMark Jan 18, 2017
3127165
Merge pull request #32 from Vydia/fix-paypal-triggering-callback-too-…
kraffslol Jan 20, 2017
5b4f37e
2.4.1
kraffslol Jan 20, 2017
8747602
Fixed bug where callback does not get fired, hence no promise fulfill…
StevePotter Feb 7, 2017
0e95871
Merge pull request #33 from Vydia/master
kraffslol Feb 8, 2017
bc4c3dc
2.4.2
kraffslol Feb 8, 2017
e6cb14c
Update for 0.40
VansonLeung Feb 23, 2017
1f668a4
Merge pull request #35 from VansonLeung/patch-1
kraffslol Mar 2, 2017
75036a6
Version 3.0.0 - RN 0.40 support
kraffslol Mar 2, 2017
6440ec6
Fix "Non-portable path" error in Xcode 8.3
iancanderson Mar 28, 2017
6f7c3e3
Check if phone is nil before adding it to args
BlakeWilliams Mar 13, 2017
90789f7
Merge pull request #36 from iancanderson/patch-1
kraffslol Apr 1, 2017
11fe781
Merge pull request #37 from BlakeWilliams/bmw-phone-fix
kraffslol Apr 1, 2017
90bb3a2
Card validation in iOS
edvinasbartkus May 24, 2017
7f32a6b
added credit card validation for android
May 24, 2017
698aff1
Add support for title, description and amount options.
aroth May 26, 2017
06aee2c
iOS option fixes.
aroth May 26, 2017
f381070
Version 3.1.0
kraffslol Jul 5, 2017
f9d00b9
Merge pull request #47 from edvinasbartkus/patch-1
kraffslol Jul 5, 2017
0853ad3
Merge pull request #48 from arnsa/master
kraffslol Jul 5, 2017
5c78c99
Merge pull request #49 from aroth/master
kraffslol Jul 5, 2017
fbf87e3
Version 3.2.0
kraffslol Jul 5, 2017
547e5e5
Add CancelListener
Aug 7, 2017
386dfb6
Bug fixed - import correct header to support rn0.40 or above
gameboyVito Aug 11, 2017
343bd3c
Remove createJSModules @ovveride - RN 0.47 compatibility
damathryx Aug 17, 2017
77764f1
Merge pull request #55 from kakakalot/master
kraffslol Aug 24, 2017
15f3af1
Merge pull request #57 from gameboyVito/fix-wrong-header
kraffslol Aug 24, 2017
36223f8
Merge pull request #59 from damathryx/master
kraffslol Aug 24, 2017
4345c38
Braintree Latest version changes
umars-menlo Nov 1, 2017
71c0134
Version 3.3.0
kraffslol Nov 6, 2017
ac619d1
Merge pull request #67 from phanir-menlo/master
kraffslol Nov 6, 2017
d59a8e0
v3.4.0
kraffslol Nov 6, 2017
be185fc
Invoke callback when user cancels payment
tsubery Nov 18, 2017
c05fbd2
Merge pull request #70 from tsubery/master
kraffslol Nov 24, 2017
ad89030
Homogenize cancellation errors
Minishlink Nov 28, 2017
1fac613
Merge pull request #71 from Minishlink/homogenize/cancellationEvent
kraffslol Nov 28, 2017
e0ef037
v3.5.0
kraffslol Dec 1, 2017
0c74625
Single "map" argument for `getCardNonce` (#72)
Andreyco Dec 1, 2017
ff92d6c
v4.0.0
kraffslol Dec 1, 2017
96fd6a0
[iOS] Add 3DSecure (#74)
Minishlink Dec 19, 2017
cbf4def
[Android] Add 3DSecure (#75)
Minishlink Dec 19, 2017
0b73665
Update documentation for 3DSecure (#76)
Minishlink Dec 20, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example
111 changes: 101 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
An effort to merge react-native-braintree and react-native-braintree-android

## iOS Installation
You can use [`rnpm`](https://github.com/rnpm/rnpm) to add native dependencies automatically:
You can use the React Native CLI to add native dependencies automatically:

`$ rnpm link`
`$ react-native link`

or do it manually as described below:

Expand Down Expand Up @@ -153,23 +153,29 @@ BTClient.showPaymentViewController(options).then(function(nonce) {
//error handling
});
```
**Options (iOS only)**
- bgColor - Background color for the view.
- tintColor - Tint color for the view.
- barBgColor - Background color for the navbar.
- barTintColor - Tint color for the navbar.
**Options**
- [iOS] bgColor - Background color for the view.
- [iOS] tintColor - Tint color for the view.
- [iOS] barBgColor - Background color for the navbar.
- [iOS] barTintColor - Tint color for the navbar.
- [iOS] callToActionText - Text for call to action button. (Works for both Android and iOS)
- threeDSecure - If you want to enable [3DSecure](https://developers.braintreepayments.com/guides/3d-secure/client-side/android/v2), pass an object with an `amount` key that takes a number value

Example:
```js
const options = {
bgColor: '#FFF',
tintColor: 'orange'
tintColor: 'orange',
callToActionText: 'Save',
threeDSecure: {
amount: 1.0
}
}
```

___

PayPal only (iOS only)
PayPal only
```js
BTClient.showPayPalViewController().then(function(nonce) {
//payment succeeded, pass nonce to server
Expand All @@ -181,15 +187,100 @@ BTClient.showPayPalViewController().then(function(nonce) {

## Custom Integration
If you only want to tokenize credit card information, you can use the following:

```js
BTClient.getCardNonce("4111111111111111", "10", "20").then(function(nonce) {
const card = {
number: "4111111111111111",
expirationDate: "10/20", // or "10/2020" or any valid date
cvv: "400",
}

BTClient.getCardNonce(card).then(function(nonce) {
//payment succeeded, pass nonce to server
})
.catch(function(err) {
//error handling
});

// Full list of card parameters:
type Card = {
number: string,
cvv: string,
expirationDate: string,
cardholderName: string,
firstName: string,
lastName: string,
company: string,
countryName: string,
countryCodeAlpha2: string,
countryCodeAlpha3: string,
countryCodeNumeric: string,
locality: string,
postalCode: string,
region: string,
streetAddress: string,
extendedAddress: string,
}
```

## One Touch on iOS
To take advantage of [One Touch](https://developers.braintreepayments.com/guides/one-touch/overview/ios/v3), there are additional setup required:

1. Register a URL scheme in Xcode (should always start with YOUR Bundle ID)
[More info here](https://developers.braintreepayments.com/guides/paypal/client-side/ios/v3#register-a-url-type) TL;DR


#### Add CFBundleURLTypes to Info.Plist
```js
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>your.bundle.id</string>
<key>CFBundleURLSchemes</key>
<array>
<string>your.bundle.id.payments</string>
</array>
</dict>
</array>
```
#### WhiteList
If your app is built using iOS 9 as its Base SDK, then you must add URLs to a whitelist in your app's info.plist
```js
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.paypal.ppclient.touch.v1</string>
<string>com.paypal.ppclient.touch.v2</string>
<string>com.venmo.touch.v2</string>
</array>
```

2. For iOS: Use setupWithURLScheme instead, passing the url scheme you have registered in previous step
```js
var BTClient = require('react-native-braintree');
BTClient.setupWithURLScheme(token, 'your.bundle.id.payments');
```
#### For xplat, you can do something like this:

```js

if (Platform.OS === 'ios') {
BTClient.setupWithURLScheme(token, 'your.bundle.id.payments');
} else {
BTClient.setup(token);
}
```

3. Add this delegate method (callback) to your AppDelegate.m
```objc
#import "RCTBraintree.h"

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[RCTBraintree sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
```
## Credits

Big thanks to [@alanhhwong](https://github.com/alanhhwong) and [@surialabs](https://github.com/surialabs) for the original ios & android modules.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dependencies {
compile "com.facebook.react:react-native:+"
compile 'com.braintreepayments.api:braintree:2.+'
compile 'com.braintreepayments.api:drop-in:2.+'
compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
}
Loading