简体   繁体   English

paypal express checkout - 付款页面中的问号

[英]paypal express checkout - questions marks in payment page

I just finished writing my php script for express checkout for my HEBREW website (database encoding is latin_swedish_ci, browser encoding windows-1255, files encoding in ANSI with notepad++). 我刚刚为我的HEBREW网站编写了用于快速结账的PHP脚本(数据库编码为latin_swedish_ci,浏览器编码为windows-1255,文件用ANSI编写,带有notepad ++)。

When I pass data (written in hebrew) from the database to paypal, instead of text I see question marks. 当我将数据(用希伯来语写成)从数据库传递到贝宝时,而不是文本,我看到了问号。 When I used utf8_encode on the text it showed gibberish. 当我在文本上使用utf8_encode时显示出乱码。

no utf8_encode: 没有utf8_encode:

不是utf8_encode

with utf8_encode: 使用utf8_encode:

用utf8_encode

Any ideas? 有任何想法吗?

The key is to set UTF-8 inside your account, by the quoted steps 关键是通过引用的步骤在您的帐户中设置UTF-8

  1. Login to your PayPal account 登录您的PayPal帐户
  2. Navigate to "My Account Overview -> Profile -> My Selling Tools" section. 导航到“我的帐户概述 - >个人资料 - >我的销售工具”部分。 Within "More Selling Tools" click the "PayPal Button Language Encoding" link. 在“更多销售工具”中,点击“PayPal按钮语言编码”链接。
  3. Ensure that setting for "Your website's language" is correct. 确保“您的网站的语言”设置正确。
  4. Click the "More Options" button, select the "UTF-8" option for "Encoding" and leave the "Yes" option selected for "Do you want to use the same encoding for data sent from PayPal to you (eg, IPN, downloadable logs, emails)?". 单击“更多选项”按钮,为“编码”选择“UTF-8”选项,并选择“是”选项为“您是否要对从PayPal发送的数据使用相同的编码(例如,IPN,可下载的日志,电子邮件)?“
  5. Click "Save" to save your changes. 单击“保存”以保存更改。

Optionally, you may add LocaleCode = he_IL in your setExpressCheckout API payload, to change the checkout page language to Hebrew as well (可选)您可以在setExpressCheckout API有效负载中添加LocaleCode = he_IL ,以将结帐页面语言更改为希伯来语

Can you try the following: 你能尝试以下方法吗?

  • Set <meta charset="utf-8"> inside your html <head> of your webpage. 在您的网页的html <head>中设置<meta charset="utf-8">
  • Set utf-8 inside your paypal account. 在您的PayPal帐户中设置utf-8

Log in to your PayPal Account click 'My selling preferences click on Update next to Language encoding on the next page choose Western European Languages and click on more Options Choose in both drop-down menues UTF-8 and click on save 登录您的PayPal帐户点击“我的销售偏好设置”点击下一页语言编码旁边的更新选择西欧语言并点击更多选项选择下拉菜单UTF-8并点击保存

Try to set utf-8 character inside your database: 尝试在数据库中设置utf-8字符:

/* change character set to utf8 */ 
if (!$mysqli->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $mysqli->error);
}

Also set file character to UTF-8 using your notepad++ 还可以使用记事本++将文件字符设置为UTF-8 在此输入图像描述

The idea is to set each element which contain a characters to UTF-8 我们的想法是将包含字符的每个元素设置为UTF-8

You need to customize paypal express checkout, specifically your locale. 您需要自定义paypal快速结账,特别是您的区域设置。 To change the language displayed on the PayPal pages to Hebrew, set the LOCALECODE parameter to he_IL in the SetExpressCheckout call. 要将PayPal页面上显示的语言更改为希伯来语, he_IL在SetExpressCheckout调用LOCALECODE参数设置为LOCALECODE

Source: Customizing Express Checkout (Scroll down to Changing the Locale section) 来源: 自定义快速结账 (向下滚动到更改区域设置部分)

Keep in mind that your database encoding is UTF-8. 请记住,您的数据库编码是UTF-8。 You still need to utf8_decode your texts before sending them to PayPal. 在将文本发送到PayPal之前,您仍需要对文本进行utf8_decode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM