Skip to content

Commit 9cc30fc

Browse files
committed
2 parents 472493e + 2ec7f2b commit 9cc30fc

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ The sandbox environment is a great way to test offline implementation of Apple P
570570
## Apple Pay Button
571571
572572
Provides a button that is used either to trigger payments through Apple Pay or to prompt the user to set up a card.
573-
[Detailed docs and examples](packages/react-native-payments/docs/ApplePayButton.md)
573+
[Detailed docs and examples](docs/ApplePayButton.md)
574574
575575
## Add-ons
576576
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:
580580
🚨 _Note: On Android, Payment Processors are enabled by default._
581581
582582
## API
583-
### [NativePayments](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/NativePayments.md)
584-
### [PaymentRequest](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentRequest.md)
585-
### [PaymentRequestUpdateEvent](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentRequestUpdateEvent.md)
586-
### [PaymentResponse](https://github.com/naoufal/react-native-payments/blob/master/packages/react-native-payments/docs/PaymentResponse.md)
583+
### [NativePayments](docs/NativePayments.md)
584+
### [PaymentRequest](docs/PaymentRequest.md)
585+
### [PaymentRequestUpdateEvent](docs/PaymentRequestUpdateEvent.md)
586+
### [PaymentResponse](docs/PaymentResponse.md)
587587
588588
## Resources
589589
### Payment Request

js/PaymentRequest/PaymentRequestUpdateEvent.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ export default class PaymentRequestUpdateEvent {
126126
}
127127

128128
if (
129-
target._details.shippingOptions &&
130-
target._details.shippingOptions.length > 0
129+
target._details.shippingOptions
130+
&& target._details.shippingOptions.length > 0
131+
&& value.shippingOptions
132+
&& ((value.shippingOptions.find(op => op.selected) || {}).id || null) !== target._shippingOption
131133
) {
132134
target._handleShippingOptionChange({
133135
selectedShippingOptionId: target._details.shippingOptions[0].id

js/PaymentRequest/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,16 +485,13 @@ export default class PaymentRequest {
485485
}
486486

487487
// Try to dismiss the UI
488-
NativePayments.abort(err => {
489-
if (err) {
490-
return reject(new Error('InvalidStateError'));
491-
}
492-
493-
this._closePaymentRequest();
494-
495-
// Return `undefined` as proposed in the spec.
496-
return resolve(undefined);
497-
});
488+
NativePayments.abort()
489+
.then((_bool) => {
490+
this._closePaymentRequest();
491+
// Return `undefined` as proposed in the spec.
492+
return resolve(undefined);
493+
})
494+
.catch((_err) => reject(new Error('InvalidStateError')));
498495
});
499496
}
500497

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"dependencies": {
3636
"es6-error": "^4.0.2",
3737
"uuid": "^3.1.0",
38-
"validator": "^7.0.0"
38+
"validator": "^9.4.1"
3939
},
4040
"devDependencies": {
4141
"babel-eslint": "^10.1.0",

react-native-payments.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.license = pkg["license"]
1010
s.homepage = pkg["homepage"]
1111
s.author = pkg["author"]
12-
s.source = { :git => pkg["repository"]["url"] }
12+
s.source = { :git => pkg["repository"] }
1313
s.source_files = 'ios/**/*.{h,m}'
1414
s.platform = :ios, "8.0"
1515
s.requires_arc = true

0 commit comments

Comments
 (0)