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]; + } }]; } 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": [