Elxis CMS Forum

Extensions => Bots and plugins => Topic started by: chongbing on August 31, 2015, 11:15:23

Title: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on August 31, 2015, 11:15:23
Hi datahell,

May i ask the plug-in "Paypal Buy Now version 1.1" is encoding as UTF-8 ? When I clicked a button of "buy", then page redirect to Paypal website but it's show up as below.
Link:http://easyapps.biz/paypal-buy-now-ver101-testing.html

Quote
Data does not match input character set or default encoding. For more information, please contact the merchant.

My "PayPal button language encoding" has setting UTF-8 in Paypal website. Could you please check that ? Thanks

Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: datahell on August 31, 2015, 18:15:14
Please add this line in Paypal Buy now form (around line 150) and tell me if the problem solved:

$html .= '<input type="hidden" name="charset" value="utf-8" /> '."\n";
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on August 31, 2015, 20:01:55
Thanks datahell,

After added the codes(in buynow.plugin.php) as you said. It works for English webpage if I change other webpage languages that doesn't worked.

For example:
http://easyapps.biz/en/paypal-buy-now-ver101-testing.html
-> It's works great !

http://easyapps.biz/zh/paypal-buy-now-ver101-testing.html
-> Got the same error message.

How to fix it? Thanks
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: datahell on August 31, 2015, 21:23:45
I found this article, read it (https://storeya.zendesk.com/hc/en-us/articles/203852788-Paypal-checkout-error-Data-does-not-match-input-character-set-or-default-encoding-), it might help.
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on August 31, 2015, 21:51:42
Hi datahell,

Yes, I've set it on Paypal's  encoding options, as blew
(http://easyapps.biz/files/encoding-on-Paypal.png)

Just others languages pages doesn't work, Is the form sending to Paypal as encoding UTF-8 as well?

Thanks,
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on September 01, 2015, 06:48:34
Hi datahell,

I found this problem was

$html .= '<input type="hidden" name="lc" value="'.$eLang->getinfo('REGION').'" />'."\n";

Change to
$html .= '<input type="hidden" name="lc" value="C2" />'."\n";

After this changed, It's work now. For your reference.  Thanks you.
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: ipghmagnet on September 01, 2015, 10:52:20
great job..
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: datahell on September 01, 2015, 20:23:53
Based on Paypal's instructions "CN" is for domestic transactions (china internal) and "C2" is for international transactions. I thought both should work, strange why that affects the page's encoding... I updated EDC listing with this fix, thanks for the report!

Countries and Regions Supported by PayPal (https://developer.paypal.com/docs/classic/api/country_codes/)
CN (For domestic Chinese bank transactions only)
C2 (For CUP, bank card and cross-border transactions)

BTW what is CUP?
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on September 02, 2015, 01:05:17
Hi datahell,

CUP (China Union Pay), all of the people reside in China that their credit card mostly supported CUP(http://en.unionpay.com/) already.

In other words, you can buy anything abroad via CUP If your card is CUP.
Title: Re: Paypal Buy Now 1.1 was encoding as UTF8?
Post by: chongbing on September 02, 2015, 01:42:48
A suggestion, the logo may change like this one.

(http://www.jollymap.com/img/AM_SbyPP_mc_vs_dc_ae.jpg)