Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions RNBraintreeDropIn.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m}"
s.requires_arc = true
s.dependency 'React'
s.dependency 'Braintree', '5.26.0'
s.dependency 'BraintreeDropIn', '9.13.0'
s.dependency 'Braintree/DataCollector', '5.26.0'
s.dependency 'Braintree/ApplePay', '5.26.0'
s.dependency 'Braintree/Venmo', '5.26.0'
s.dependency 'Braintree', '6.32.0'
s.dependency 'BraintreeDropIn', '9.14.0'
s.dependency 'Braintree/DataCollector', '6.32.0'
s.dependency 'Braintree/ApplePay', '6.32.0'
s.dependency 'Braintree/Venmo', '6.32.0'
end
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repositories {
}

dependencies {
implementation 'com.braintreepayments.api:drop-in:6.16.0'
implementation 'com.braintreepayments.api:drop-in:6.17.0'
implementation 'com.facebook.react:react-native:+'
}

Expand Down
1 change: 1 addition & 0 deletions ios/RNBraintreeDropIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "BraintreeCore.h"
#import "BraintreeDropIn.h"
#import "BTCardNonce.h"
#import "BTPaymentMethodNonce.h"
#import "BTDataCollector.h"

#import "BraintreeApplePay.h"
Expand Down
29 changes: 14 additions & 15 deletions ios/RNBraintreeDropIn.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,21 @@ - (dispatch_queue_t)methodQueue
} else if (result.canceled) {
reject(@"USER_CANCELLATION", @"The user cancelled", nil);
} else {
if (threeDSecureOptions && [result.paymentMethod isKindOfClass:[BTCardNonce class]]) {
BTCardNonce *cardNonce = (BTCardNonce *)result.paymentMethod;
if (!cardNonce.threeDSecureInfo.liabilityShiftPossible && cardNonce.threeDSecureInfo.wasVerified) {
reject(@"3DSECURE_NOT_ABLE_TO_SHIFT_LIABILITY", @"3D Secure liability cannot be shifted", nil);
} else if (!cardNonce.threeDSecureInfo.liabilityShifted && cardNonce.threeDSecureInfo.wasVerified) {
reject(@"3DSECURE_LIABILITY_NOT_SHIFTED", @"3D Secure liability was not shifted", nil);
} else{
if (threeDSecureOptions) {
id<BTPaymentMethodNonce> paymentMethod = result.paymentMethod;
if ([paymentMethod respondsToSelector:@selector(threeDSecureInfo)]) {
BTThreeDSecureInfo *info = [paymentMethod performSelector:@selector(threeDSecureInfo)];
if (!info.liabilityShiftPossible && info.wasVerified) {
reject(@"3DSECURE_NOT_ABLE_TO_SHIFT_LIABILITY", @"3D Secure liability cannot be shifted", nil);
} else if (!info.liabilityShifted && info.wasVerified) {
reject(@"3DSECURE_LIABILITY_NOT_SHIFTED", @"3D Secure liability was not shifted", nil);
} else {
[[self class] resolvePayment:result deviceData:self.deviceDataCollector resolver:resolve];
}
} else {
// fallback en caso de que no tenga info de 3DS
[[self class] resolvePayment:result deviceData:self.deviceDataCollector resolver:resolve];
}
} else if(result.paymentMethod == nil && (result.paymentMethodType == 16 || result.paymentMethodType == 17 || result.paymentMethodType == 18)){ //Apple Pay
// UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
// [ctrl presentViewController:self.viewController animated:YES completion:nil];
UIViewController *rootViewController = RCTPresentedViewController();
[rootViewController presentViewController:self.viewController animated:YES completion:nil];
} else{
[[self class] resolvePayment:result deviceData:self.deviceDataCollector resolver:resolve];
}
}
}];
Expand Down Expand Up @@ -229,7 +228,7 @@ - (dispatch_queue_t)methodQueue
card.postalCode = postalCode;

[cardClient tokenizeCard:card
completion:^(BTCardNonce *tokenizedCard, NSError *error) {
completion:^(id<BTPaymentMethodNonce> tokenizedCard, NSError *error) {
if (error == nil) {
resolve(tokenizedCard.nonce);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spotahome/react-native-braintree-dropin-ui",
"version": "1.6.0",
"version": "2.0.0-1",
"description": "> React Native integration of Braintree Drop-in IOS V4 ANDROID V2 (Apple Pay &Android Pay Enabled)",
"main": "index.js",
"dependencies": {},
Expand Down