i have a problem with this paypal IPN. I saw, a lot of people had.
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.
I am a hungarian PHP developer.
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
Every settings are 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.
The first name will be: CHARS: 193, 114, 118, 237, 122, 116, 26, 114, 26
Suck. I tried to everything to get my real utf-8 name The mb_detect_encoding is UTF-8 for it.
I tried to use iconv, mb_convert_encoding, utf8_encode and decode. No success. Tried to not urlencode the name, no success again.
Can somebody tell me, why is it, and how can i get back the real utf8 name?
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¬ify_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
http_build_query($_POST)
instead offoreach
cycle and it seams to handle it well. Never had issues like this. – Sergey Romanov