php-paypal-ipn icon indicating copy to clipboard operation
php-paypal-ipn copied to clipboard

PaypalIPN.php - Added missing "User-Agent" string

Open mooror opened this issue 2 years ago • 1 comments

Description

I found recently that my sandbox transactions were all returning INVALID for some reason. After hours of banging my head against the wall checking my code, IPN History logs, Listener logs, etc. I found the following note in the Paypal Documentation

Please ensure you provide a User-Agent header value that describes your IPN listener, such as, PHP-IPN-VerificationScript. For more information, see the User-Agent specification.

Ans after comparing this listener code to the official code found in the IPN Example code repository, I realized that this script was missing that user agent string. So I added it, an boom, the sandbox IPN came back as valid.

Changes

  • Added a "PHP-IPN-Verification-Script" User-Agent string to fix issues with Sandbox system

mooror avatar Jul 28 '22 20:07 mooror

It would be great if a new release could be made for this change so I don't have to use my fork

mooror avatar Jul 28 '22 20:07 mooror