View Issue Details

IDProjectCategoryView StatusLast Update
0006145module PayPalmodule PayPal - subpublic2015-07-10 09:17
Reporterhendrikfreytag Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.2.2 
Summary0006145: IPN verification doesn't work with UTF8
DescriptionWith IPN PayPal sends information about a payment to the shop. This is verified by the shop with a call to PayPal. But if you have your shop installed in utf8 mode you get always the response "invalid", if there are any special characters in the user data.
Steps To Reproduce- install shop in utf8 mode (must be reachable from the internet, because paypal has to call the shop)
- setup paypal (sandbox)
- make sure the payment will not be completed immediately by setting "Review test payments before they're completed." in your sandbox account.
- order something
- use some special character, e.g streetname "Bertoldstraße"
- use paypal payment
- complete order
- login to your sandbox account to accept the payment

Now PayPal will notify your shop by IPN. But look in your log, it says "INVALID". Look in your shop admin "Administer Orders -> Orders". Shop payment status will remain at "Pending", but it should be "Completed" after you accepted the payment at paypal.
Additional InformationNo problems if there are no special characters in the user data or if the shop isn't installed in utf8 mode. So it must be a problem with utf8 character encoding.
In the paypal log you can see often 'charset' => 'windows-1252'. So maybe the problem is that the user data is send as utf8, but paypal expects windows-1252.
TagsUTF-8

Activities

martinwegele

2015-05-15 15:51

reporter   ~0010956

In the integration guide it says:
"Your listener should then HTTP POST the complete, unaltered message back to PayPal; the message must [...] be character encoded in the same way as the original message."
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNImplementation/

also see: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNTesting/#invalid
"Ensure that you use the same character encoding for your response string as the encoding specified in the charset field of the original IPN message. When testing using the IPN Simulator, the character encoding will always be UTF-8."

I propose an easy fix. In oePayPalService::doVerifyWithPayPal() add $oCurl->setDataCharset($sCharset); after or before $oCurl->setConnectionCharset($sCharset);

HR

2015-06-08 09:29

administrator   ~0011012

The encoding issue only affected verification of the IPN with PayPal.
There was an additional fix needed for IPN processing for PayPal transactions generated in PayPal backend and not directly via shop admin/PayPal module.