{"id":2468,"date":"2012-09-17T10:11:42","date_gmt":"2012-09-17T09:11:42","guid":{"rendered":"http:\/\/www.simonbattersby.com\/blog\/?p=2468"},"modified":"2012-09-17T10:18:14","modified_gmt":"2012-09-17T09:18:14","slug":"opencart-paypal-failures-invalid-with-foreign-characters","status":"publish","type":"post","link":"https:\/\/www.simonbattersby.com\/blog\/2012\/09\/opencart-paypal-failures-invalid-with-foreign-characters\/","title":{"rendered":"Opencart Paypal failures\/INVALID with foreign characters"},"content":{"rendered":"<p>We&#8217;ve had occasional oddities with Paypal (Standard) payments showing as &#8216;Pending Paypal&#8217; on Opencart, with the Error Log showing an &#8220;INVALID&#8221; response from the Paypal IPN transaction. However, when we check on Paypal, the transaction has completed without a problem.<\/p>\r\n<img decoding=\"async\" src=\"\/images\/blog\/opencart_error.jpg\" width=\"358\" alt=\"Opencart error log\" title=\"Opencart error log\" \/>\r\n\r\n<p>The (seemingly) common factor with the payments that show like this is that originated in a foreign currency, so I&#8217;d assumed that was the problem, but in fact some orders from (the same) currencies went through OK. On Saturday I spotted that those that failed all included a &#8216;non-standard&#8217; character in the customer&#8217;s names: \u00e9, \u00f8 etc. And this suggested an issue with character sets.<\/p>\r\n\r\n<p>So, after a bit of digging, I discovered that Paypal, as a default, sends all IPN responses encoded as win-1252, whereas my website is in utf-8. You can change this, although it isn&#8217;t easy to find, via My Profile > My Selling Preferences > Paypal Button Language Encoding (link right at the bottom) and then the &#8216;More options&#8217; button. Set the encoding used on your website to utf-8 (or whatever you use, obviously&#8230;).<\/p>\r\n\r\n<img decoding=\"async\" src=\"\/images\/blog\/paypal_encoding.jpg\" width=\"500\" alt=\"Paypal screenshot showing encoding settings\" title=\"Paypal screenshot\" \/>\r\n<p>Testing this after making the change means no more failures with non-standard characters.<\/p>","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve had occasional oddities with Paypal (Standard) payments showing as &#8216;Pending Paypal&#8217; on Opencart, with the Error Log showing an &#8220;INVALID&#8221; response from the Paypal IPN transaction. However, when we check on Paypal, the transaction has completed without a problem. The (seemingly) common factor with the payments that show like this is that originated in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[28,31],"class_list":["post-2468","post","type-post","status-publish","format-standard","hentry","category-web-design-and-build","tag-opencart","tag-paypal"],"_links":{"self":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/2468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/comments?post=2468"}],"version-history":[{"count":5,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/2468\/revisions"}],"predecessor-version":[{"id":2472,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/2468\/revisions\/2472"}],"wp:attachment":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/media?parent=2468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/categories?post=2468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/tags?post=2468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}