Skip to content
This repository has been archived by the owner on Mar 21, 2020. It is now read-only.

is there an event for errors? #79

Open
pixelpaulaus opened this issue Apr 23, 2019 · 4 comments
Open

is there an event for errors? #79

pixelpaulaus opened this issue Apr 23, 2019 · 4 comments

Comments

@pixelpaulaus
Copy link

seems like there is no way to catch errors, such as "DUPLICATE_TRANSACTION"?
Unless i am mistaken?

@JuanGongora
Copy link

I would also like to know how to handle errors with this package. I know that there's payment-authorized, payment-completed, and payment-cancelled events. But what about one for errors? Even a generic one would be nice.

Is there a way to do this?

@nicholi
Copy link

nicholi commented Aug 18, 2019

Possible solution made in this PR: #90

The underlying dependency paypal-checkout has an onError event that simply wasn't tied into before. It should allow you to catch any errors in checkout process. However I noticed identifying the exact underlying error maybe somewhat impossible (for example if it were actually a DUPLICATE_TRANSACTION). I was only able to confirm my own errors were DUPLICATE_TRANSACTION by using the dev console in Chrome open and noticing the last failed XHR network request to paypal returned that in its response. The object you get from the onError event only has a message property filled with a very boring stacktrace (and no real mention of the failed response code). But you can at the least notify end-use there was an error.

@nicholi
Copy link

nicholi commented Aug 18, 2019

Apparently the lack of useful error object is a known thing, semi-discussion in this issue: https://github.com/paypal/paypal-checkout-components/issues/479

@nicholi
Copy link

nicholi commented Aug 18, 2019

I missed the big Note in the official docs, https://developer.paypal.com/docs/checkout/integration-features/handle-errors/.

Just a very general event.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants