craftcms / commerce-paypal-checkout

PayPal Checkout gateway for Craft Commerce.
https://plugins.craftcms.com/commerce-paypal-checkout
MIT License
5 stars 10 forks source link

Better Error Response on Offsite Complete Purchase Request #51

Closed pdaleramirez closed 2 years ago

pdaleramirez commented 2 years ago

What are you trying to do? When PayPal encounters an error when submitting the payment request it throws PaymentException (https://github.com/craftcms/commerce-paypal-checkout/blob/37fadcf75cd684ee64c6a49774308d6c9be1a2dd/src/gateways/Gateway.php#L401) which creates a bad user experience.

What's your proposed solution? It would be good to implement the craft\commerce\base\RequestResponseInterface same as how Commerce Stripe Implement returned errors

aeu commented 2 years ago

Hi Dale,

Thanks for taking a look at this, but respectfully, an eCommerce site throwing a Internal Server error on a card decline is not an enhancement, it's a critical issue. This is what our customers are seeing on card declines, which can happen for something as simple as a typo during checkout or hitting PayPal fraud protection.

craft-exception

PayPal in particular takes a very aggressive stance on fraud protection (as they should) and card declines are not uncommon at all. A card decline should not crash an eCommerce platform.

Note also that when this happens the customers cart is cleared. Also a critical issue.

nfourtythree commented 2 years ago

Hi @aeu

Thank you for your message and extra information.

We have just pushed up an update that will fix this issue. Error messages from the API will now be returned and the user will be redirected to the payment page.

This update will be included in the next release of the plugin.

Thanks.

aeu commented 2 years ago

Hi @nfourtythree

This is excellent news, thank you!

Do you have a timeline for when that release will be?

nfourtythree commented 2 years ago

Hi @aeu

We have just published the 1.3.2 version of the plugin.

You will be able to update now.

Thanks!