Paypal Authentication migration to gem#165
Merged
Conversation
praweb
commented
Dec 11, 2018
lib/paypal_express/auth.rb
Outdated
| end | ||
|
|
||
| def do_express_checkout_payment | ||
| Retry.call(rescue_errors: ::ActiveMerchant::ConnectionError) { |
Contributor
Author
There was a problem hiding this comment.
If there are any connection errors, this method will be retried. By default it will retry twice.
praweb
commented
Dec 11, 2018
lib/paypal_express/auth.rb
Outdated
|
|
||
|
|
||
| def do_authorization(response) | ||
| Retry.call(rescue_errors: ::ActiveMerchant::ConnectionError) { |
Contributor
Author
There was a problem hiding this comment.
Same here. Any connection errors will be retried twice.
lib/retry.rb
Outdated
| retry if total_attempts < no_of_retries | ||
| ensure | ||
| if total_attempts == no_of_retries | ||
| # notity logging/monitoring system here |
Contributor
There was a problem hiding this comment.
Does this need addressing?
| end | ||
|
|
||
| def is_user_error?(response) | ||
| (USER_ERRORS.keys & response_error_codes(response)).present? |
Contributor
There was a problem hiding this comment.
I'm not sure about this conditional. Surely the USER_ERRORS.keys will always return an array of keys so there's no point in checking if it's present?.& will combine the arrays.
RichardWatkins1
approved these changes
Dec 11, 2018
added 7 commits
February 21, 2019 13:56
…aypal_polling_to_gem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR handles first part of https://github.com/shiftcommerce/matalan-rails-site/issues/2388#issuecomment-442129990
We have migrated the auth and order creation process to the gem. We also have introduced retries around the paypal process, as we know the Paypal Auth process is most time taking one, and the possibility of timeouts around it is more.