Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from lytvynserhii/master
Browse files Browse the repository at this point in the history
 bugfix/handle_apple_pay_cancel
  • Loading branch information
vasylnahuliak authored Nov 9, 2022
2 parents ebbed99 + 8132b1b commit 4a59312
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions ios/RNBraintreeApplePay.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ @implementation RNBraintreeApplePay
- (void)handleTokenizationResult: (BTApplePayCardNonce *)tokenizedApplePayPayment
error: (NSError *)error
completion: (void (^)(PKPaymentAuthorizationStatus))completion{
if (!tokenizedApplePayPayment) {
if (!tokenizedApplePayPayment && self.reject) {
self.reject(error.localizedDescription, error.localizedDescription, error);
completion(PKPaymentAuthorizationStatusFailure);
[self resetPaymentResolvers];
return;
}
[self.dataCollector collectDeviceData:^(NSString * _Nonnull deviceData) {
self.resolve(@{@"deviceData": deviceData,
@"nonce": tokenizedApplePayPayment.nonce});
completion(PKPaymentAuthorizationStatusSuccess);
[self resetPaymentResolvers];
if (self.resolve) {
self.resolve(@{@"deviceData": deviceData,
@"nonce": tokenizedApplePayPayment.nonce});
completion(PKPaymentAuthorizationStatusSuccess);
[self resetPaymentResolvers];
}
}];
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ekreative/react-native-braintree",
"title": "React Native Braintree",
"version": "1.2.0",
"version": "1.3.0",
"description": "TODO",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 4a59312

Please sign in to comment.