From 7232874d481cabc240d6787f261b092f3b22e012 Mon Sep 17 00:00:00 2001 From: Serhii Lytvyn Date: Wed, 9 Nov 2022 14:46:53 +0200 Subject: [PATCH 1/2] fix: handle cancelling apple pay --- ios/RNBraintreeApplePay.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ios/RNBraintreeApplePay.m b/ios/RNBraintreeApplePay.m index 3753b7f..8572304 100644 --- a/ios/RNBraintreeApplePay.m +++ b/ios/RNBraintreeApplePay.m @@ -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]; + } }]; } From e7832eb5f2a7ef4d9bdadcfe18929118abd01f3b Mon Sep 17 00:00:00 2001 From: Serhii Lytvyn Date: Wed, 9 Nov 2022 14:47:48 +0200 Subject: [PATCH 2/2] build: bump package version to 1.3.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a04e2f..7aed330 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ekreative/react-native-braintree", - "version": "1.2.0", + "version": "1.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f27b2e..886a5b0 100644 --- a/package.json +++ b/package.json @@ -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": [