From 107ad3df0e3aede732ecd8e43cc1827e2630c6f3 Mon Sep 17 00:00:00 2001 From: Rakesh Arunachalam Date: Mon, 1 Mar 2021 13:15:44 +0000 Subject: [PATCH 1/6] Update broken links (#275) * Update broken links * Use relative links Co-authored-by: Rakesh Arunachalam --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 From 296ecb92636ded24b8f5958f0a4903445533692b Mon Sep 17 00:00:00 2001 From: nmilcoff Date: Tue, 13 Apr 2021 11:32:48 -0300 Subject: [PATCH 2/6] Do not trigger a ShippingOption reset if the original event is actually a ShippingOption change (#290) * Do not trigger a ShippingOption reset if the original event is actually a ShippingOption change * Add missing && --- js/PaymentRequest/PaymentRequestUpdateEvent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/PaymentRequest/PaymentRequestUpdateEvent.js b/js/PaymentRequest/PaymentRequestUpdateEvent.js index c079a343..3f21e40b 100644 --- a/js/PaymentRequest/PaymentRequestUpdateEvent.js +++ b/js/PaymentRequest/PaymentRequestUpdateEvent.js @@ -127,7 +127,9 @@ export default class PaymentRequestUpdateEvent { if ( target._details.shippingOptions && - target._details.shippingOptions.length > 0 + target._details.shippingOptions.length > 0 && + value.shippingOptions && + value.shippingOptions.find(op => op.selected)?.id !== target._shippingOption ) { target._handleShippingOptionChange({ selectedShippingOptionId: target._details.shippingOptions[0].id From 3390fd89a760f661b83bf7e103bd2753d1faf1df Mon Sep 17 00:00:00 2001 From: Michael Bova Date: Tue, 13 Apr 2021 10:33:46 -0400 Subject: [PATCH 3/6] Bump validator dependency version to remove vulnerability. (#278) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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", From 99feafd307d74fccdbd9267af35bb490f9c63193 Mon Sep 17 00:00:00 2001 From: Freeman Date: Tue, 13 Apr 2021 15:40:23 +0100 Subject: [PATCH 4/6] ? syntax doesn't work, changed to pure JS --- js/PaymentRequest/PaymentRequestUpdateEvent.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/PaymentRequest/PaymentRequestUpdateEvent.js b/js/PaymentRequest/PaymentRequestUpdateEvent.js index 3f21e40b..af1cd137 100644 --- a/js/PaymentRequest/PaymentRequestUpdateEvent.js +++ b/js/PaymentRequest/PaymentRequestUpdateEvent.js @@ -126,10 +126,10 @@ export default class PaymentRequestUpdateEvent { } if ( - target._details.shippingOptions && - target._details.shippingOptions.length > 0 && - value.shippingOptions && - value.shippingOptions.find(op => op.selected)?.id !== target._shippingOption + 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 From 68cadfda7095dbda136102e8bded728e4eaae656 Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Tue, 13 Apr 2021 07:47:12 -0700 Subject: [PATCH 5/6] fix: make PaymentRequest.abort actually return Promise (#282) * fix: make abort method on PaymentRequest actually return a Promise, thereby properly cancelling event listeners * chore: use single quotes * chore: fix accidental removal of get shippingAddress getter --- js/PaymentRequest/index.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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'))); }); } From 2ec7f2bced88cec26adb73878007fb6417c3b033 Mon Sep 17 00:00:00 2001 From: Marek Kowalski Date: Tue, 25 May 2021 12:57:53 +0200 Subject: [PATCH 6/6] Wrong repository URL in podspec (#291) --- react-native-payments.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-payments.podspec b/react-native-payments.podspec index 4d96312d..4ec6548c 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