贝宝IPN覆盖字符集 [英] Paypal IPN override charset

查看:174
本文介绍了贝宝IPN覆盖字符集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这个Paypal IPN有问题. 我看到了很多人.

i have a problem with this paypal IPN. I saw, a lot of people had.

我尝试以用户身份付款:ÁrvíztűrőTükörfúrógép 用这个名字,所有特殊字符,匈牙利ABC中都有.

I try to pay as a user: Árvíztűrő Tükörfúrógép In this name, there are all special chars, what are in hungarian ABC.

我是匈牙利的PHP开发人员.

I am a hungarian PHP developer.

好吧,我尝试在Google上搜索很多内容. 第一件事是检查贝宝语言设置: http://jlchereau.blogspot.hu/2006/10/paypal-ipn-with- utf8.html

Ok, i tried to search a lot of on google. The first thing was to check the paypal language settings: http://jlchereau.blogspot.hu/2006/10/paypal-ipn-with-utf8.html

每个设置都是UTF-8.

Every settings are UTF-8.

当Paypal呼叫我的通知URL时,我(以前的开发人员)构建了请求URL. 当我登录此URL时,我看到字符集不是UTF-8,因此我强制脚本使用该字符集.

When paypal called my notify url, i (previous developer) build the request URL. When i logged this url, i saw, the charset was not UTF-8, so i force the script to use that.

$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
   if ($key == 'charset') {
      $req .= "&charset=utf-8";
   } else {
      $value = urlencode(stripslashes($value));
      $req .= "&$key=$value";
   }

}

这是有趣的事情.我找回了一个完全格式的用户名. 因此,我逐个字符地将其丢弃.

And here is the intresting thing. I get back a totally mallformed username. So i dump it char by char.

名字将是: CHARS:193、114、118、237、122、116、26、114、26

The first name will be: CHARS: 193, 114, 118, 237, 122, 116, 26, 114, 26

吸. 我竭尽所能获得我的真实utf-8名称 mb_detect_encoding的编码为UTF-8.

Suck. I tried to everything to get my real utf-8 name The mb_detect_encoding is UTF-8 for it.

我尝试使用iconv,mb_convert_encoding,utf8_encode和解码. 没有成功尝试不对名称进行urlencode,再次失败.

I tried to use iconv, mb_convert_encoding, utf8_encode and decode. No success. Tried to not urlencode the name, no success again.

有人可以告诉我为什么吗,我怎么找回真正的utf8名称?

Can somebody tell me, why is it, and how can i get back the real utf8 name?

我发送的URL: cmd = _notify-validate& mc_gross = 10.00& protection_eligibility =合格& address_status =已确认& payer_id = JA3YMCJFKSCNJ& tax = 0.00& address_street = 1 + Main + St&付款日期= 07%3A41 %% 3A40 + C 2012 + PDT& payment_status =已完成* & charset = utf-8 *& address_zip = 95131& first_name =%C1rv%EDzt%1Ar%1A& mc_fee = 0.59& address_country_code = US& address_name =%C1rv%EDzt%1Ar%1A + T%FCk%F6rf%FAr%F3g%E9p& notify_version = 3.6&custom = lolka_bolka%3Bfalse%3B%3B%3B%3BHungary%3B%3B%3B%3B%3B %3B和放大器; payer_status =验证的&放大器;商业= vaso_1346830963_biz%40mydomain.hu和放大器; ADDRESS_COUNTRY =美+美国和放大器; ADDRESS_CITY =圣+何塞&放大器;数量= 1&安培; verify_sign = AVVJjJNeVwHbYcMDVfj2N1DqWwUdAtNQIpb9KIP99gZ2PY-LPoOYzSCc和放大器; PAYER_EMAIL = test_1346830232_per%40mydomain.hu和放大器; txn_id = 4J747779YW528551F和放大器; payment_type = instant& last_name = T%FCk%F6rf%FAr%F3g%E9p&address_state = CA& receiver_email = vaso_1346830963_biz%40mydomain.hu& payment_fee = 0.59& receiver_i d = TGEHBCMG336WE& txn_type = web_accept& item_name = 510 + Silk& mc_currency = USD& item_number =& residence_country = US& test_ipn = 1& handling_amount = 0.00& transaction_subject = 3ol% %3B%3B%3B%3B%3B& payment_gross = 10.00& shipping = 0.00& ipn_track_id = 6fe12a7a34b74

The URL what i sent: cmd=_notify-validate&mc_gross=10.00&protection_eligibility=Eligible&address_status=confirmed&payer_id=JA3YMCJFKSCNJ&tax=0.00&address_street=1+Main+St&payment_date=07%3A41%3A40+Sep+05%2C+2012+PDT&payment_status=Completed*&charset=utf-8*&address_zip=95131&first_name=%C1rv%EDzt%1Ar%1A&mc_fee=0.59&address_country_code=US&address_name=%C1rv%EDzt%1Ar%1A+T%FCk%F6rf%FAr%F3g%E9p&notify_version=3.6&custom=lolka_bolka%3Bfalse%3B%3B%3B%3BHungary%3B%3B%3B%3B%3B%3B&payer_status=verified&business=vaso_1346830963_biz%40mydomain.hu&address_country=United+States&address_city=San+Jose&quantity=1&verify_sign=AVVJjJNeVwHbYcMDVfj2N1DqWwUdAtNQIpb9KIP99gZ2PY-LPoOYzSCc&payer_email=test_1346830232_per%40mydomain.hu&txn_id=4J747779YW528551F&payment_type=instant&last_name=T%FCk%F6rf%FAr%F3g%E9p&address_state=CA&receiver_email=vaso_1346830963_biz%40mydomain.hu&payment_fee=0.59&receiver_id=TGEHBCMG336WE&txn_type=web_accept&item_name=510+Silk&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=lolka_bolka%3Bfalse%3B%3B%3B%3BHungary%3B%3B%3B%3B%3B%3B&payment_gross=10.00&shipping=0.00&ipn_track_id=6fe12a7a34b74

推荐答案

您应在Paypal上更改设置.

You should change your settings at Paypal.

  • go to your Paypal profile
  • click My selling tools in the sidebar
  • scroll to the bottom and click PayPal button language encoding
  • click More options and set the encoding to UTF-8

这篇关于贝宝IPN覆盖字符集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆