Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nabilfreeman committed May 25, 2021
2 parents 472493e + 2ec7f2b commit 9cc30fc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions js/PaymentRequest/PaymentRequestUpdateEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 7 additions & 10 deletions js/PaymentRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
});
}

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion react-native-payments.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cc30fc

Please sign in to comment.