Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better error handling to button_actions.js #89

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

seand7565
Copy link
Contributor

Previously, if an error occurred in the send_order function - like if
the order does not total up correctly - the user would see the PayPal
loading screen forever. This handles the error - closing the PayPal screen
when they occur - and logging the error + debug ID both to console and to
the Rails logger. This also ensures that an address is rejected if there is
an issue sending the updated order details to PayPal, otherwise PayPal would
allow paying for an order with address issues.

Previously, if an error occurred in the send_order function - like if
the order does not total up correctly - the user would see the PayPal
loading screen forever. This handles the error - closing the PayPal screen
when they occur - and logging the error + debug ID both to console and to
the Rails logger. This also ensures that an address is rejected if there is
an issue sending the updated order details to PayPal, otherwise PayPal would
allow paying for an order with address issues.
@seand7565 seand7565 requested a review from elia August 10, 2020 15:59
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐞⚡🕵️

console.log("PayPal Debug ID: " + error.debug_id)
alert("There was a problem connecting with PayPal.")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ This is great for capturing errors with error-tracking services!

actions.order.patch([response]);
});
actions.order.patch([response]).catch(function() {
actions.reject()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@elia elia merged commit 8d35862 into solidusio:master Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants