mike182uk / paypal-ipn-listener

A PayPal IPN (Instant Payment Notification) listener for PHP
MIT License
89 stars 31 forks source link

Feature request: recognize PayPal's fatal failures #38

Closed willemstuursma closed 5 years ago

willemstuursma commented 5 years ago

We occasionally get these exceptions:

Unexpected verification status encountered: <html>
<body>
Fatal Failure <br>
</body>
</html>

Apparently PayPal is sometimes experiencing a minor downtime. It would be great, if the library could recognize these errors and have map them to a \Mdb\PayPal\Ipn\Event\MessageVerificationFailureEvent.

mike182uk commented 5 years ago

Hey @willemstuursma

This is something that should already be happening unless I'am missing something?

https://github.com/mike182uk/paypal-ipn-listener/blob/3b3c99ad387349a64ae67db0a984ce5f7258f3bb/src/Listener.php#L51-L63

which is triggered by

https://github.com/mike182uk/paypal-ipn-listener/blob/3b3c99ad387349a64ae67db0a984ce5f7258f3bb/src/Verifier.php#L36-L40

willemstuursma commented 5 years ago

@mike182uk yes, you are right. I guess it would be nice to have a dedicated event, but on second thoughts its also not super useful because the IPN_VERIFICATION_FAILURE_EVENT already exist.