diff --git a/README.md b/README.md index 3e90aac7..7cd69bc1 100644 --- a/README.md +++ b/README.md @@ -570,7 +570,7 @@ The sandbox environment is a great way to test offline implementation of Apple P ## Apple Pay Button Provides a button that is used either to trigger payments through Apple Pay or to prompt the user to set up a card. -[Detailed docs and examples](packages/react-native-payments/docs/ApplePayButton.md) +[Detailed docs and examples](docs/ApplePayButton.md) ## Add-ons Here's a list of Payment Processors that you can enable via add-ons: @@ -580,10 +580,10 @@ Here's a list of Payment Processors that you can enable via add-ons: 🚨 _Note: On Android, Payment Processors are enabled by default._ ## API -### [NativePayments](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/NativePayments.md) -### [PaymentRequest](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentRequest.md) -### [PaymentRequestUpdateEvent](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentRequestUpdateEvent.md) -### [PaymentResponse](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentResponse.md) +### [NativePayments](docs/NativePayments.md) +### [PaymentRequest](docs/PaymentRequest.md) +### [PaymentRequestUpdateEvent](docs/PaymentRequestUpdateEvent.md) +### [PaymentResponse](docs/PaymentResponse.md) ## Resources ### Payment Request diff --git a/js/PaymentRequest/PaymentRequestUpdateEvent.js b/js/PaymentRequest/PaymentRequestUpdateEvent.js index c079a343..af1cd137 100644 --- a/js/PaymentRequest/PaymentRequestUpdateEvent.js +++ b/js/PaymentRequest/PaymentRequestUpdateEvent.js @@ -126,8 +126,10 @@ export default class PaymentRequestUpdateEvent { } if ( - target._details.shippingOptions && - target._details.shippingOptions.length > 0 + target._details.shippingOptions + && target._details.shippingOptions.length > 0 + && value.shippingOptions + && ((value.shippingOptions.find(op => op.selected) || {}).id || null) !== target._shippingOption ) { target._handleShippingOptionChange({ selectedShippingOptionId: target._details.shippingOptions[0].id diff --git a/js/PaymentRequest/index.js b/js/PaymentRequest/index.js index a0bfd1c2..cd05a4c8 100644 --- a/js/PaymentRequest/index.js +++ b/js/PaymentRequest/index.js @@ -485,16 +485,13 @@ export default class PaymentRequest { } // Try to dismiss the UI - NativePayments.abort(err => { - if (err) { - return reject(new Error('InvalidStateError')); - } - - this._closePaymentRequest(); - - // Return `undefined` as proposed in the spec. - return resolve(undefined); - }); + NativePayments.abort() + .then((_bool) => { + this._closePaymentRequest(); + // Return `undefined` as proposed in the spec. + return resolve(undefined); + }) + .catch((_err) => reject(new Error('InvalidStateError'))); }); } diff --git a/package-lock.json b/package-lock.json index 089fe986..d921683b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-native-payments", - "version": "0.8.0", + "version": "0.8.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11291,9 +11291,9 @@ } }, "validator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-7.2.0.tgz", - "integrity": "sha512-c8NGTUYeBEcUIGeMppmNVKHE7wwfm3mYbNZxV+c5mlv9fDHI7Ad3p07qfNrn/CvpdkK2k61fOLRO2sTEhgQXmg==" + "version": "9.4.1", + "resolved": "https://hqo.jfrog.io/artifactory/api/npm/npm/validator/-/validator-9.4.1.tgz", + "integrity": "sha1-q/Rm05i1Yc0kMFARLG/x3mzBJmM=" }, "vary": { "version": "1.1.2", diff --git a/package.json b/package.json index d263d884..0402d187 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "dependencies": { "es6-error": "^4.0.2", "uuid": "^3.1.0", - "validator": "^7.0.0" + "validator": "^9.4.1" }, "devDependencies": { "babel-eslint": "^10.1.0", diff --git a/react-native-payments.podspec b/react-native-payments.podspec index 0398b173..52e6d00e 100644 --- a/react-native-payments.podspec +++ b/react-native-payments.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.license = pkg["license"] s.homepage = pkg["homepage"] s.author = pkg["author"] - s.source = { :git => pkg["repository"]["url"] } + s.source = { :git => pkg["repository"] } s.source_files = 'ios/**/*.{h,m}' s.platform = :ios, "8.0" s.requires_arc = true