我谷歌了这个问题并尝试了所有建议,但都没有成功。
我尝试了这段代码:https://developer.paypal.com/docs/classic/ipn/ht_ipn/,但它不起作用。只是复制粘贴并删除旧的magick_quotes路由程序。
我尝试了这段代码:http://samples.geekality.net/view-source.php?file=ipn/ipn_handler.class.php,但它也不起作用。
在所有情况下,我尝试做以下操作:
为了确保我向IPN发送的信息与其发送给我的信息完全一致,我使用了调试代理(Fiddler)并保存了IPN发送给我以及我发送给IPN的信息。请求体是逐字节相同的,除了我的请求前面有
是的,我检查过我使用了正确的沙箱URL。以下是整个请求体:
IPN发送给我的内容:(我只是用XXX替换了个人数据)
我尝试了这段代码:https://developer.paypal.com/docs/classic/ipn/ht_ipn/,但它不起作用。只是复制粘贴并删除旧的magick_quotes路由程序。
我尝试了这段代码:http://samples.geekality.net/view-source.php?file=ipn/ipn_handler.class.php,但它也不起作用。
在所有情况下,我尝试做以下操作:
$req = 'cmd=_notify-validate&' . file_get_contents('php://input');
为了确保我向IPN发送的信息与其发送给我的信息完全一致,我使用了调试代理(Fiddler)并保存了IPN发送给我以及我发送给IPN的信息。请求体是逐字节相同的,除了我的请求前面有
cmd=_notify-validate&
字符串。是的,我检查过我使用了正确的沙箱URL。以下是整个请求体:
IPN发送给我的内容:(我只是用XXX替换了个人数据)
POST http://localhost.loc/en/payment/success/1 HTTP/1.1
Host: localhost.loc
Connection: keep-alive
Content-Length: 921
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
mc_gross=1.00&protection_eligibility=Ineligible&payer_id=5XNKM66NSDKC4&tax=0.00&payment_date=05%3A34%3A11+Jun+01%2C+2015+PDT&payment_status=Completed&charset=utf-8&first_name=XXX&mc_fee=0.33¬ify_version=3.8&custom=topup%3A262262%3A1%3A1433162020&payer_status=verified&business=XXX&quantity=1&payer_email=XXX&verify_sign=AG58dBsn5g2z8O8NEjotbuJGP14PAIpZ4k26VL8IyhaDPkcDRj002Keq&memo=hmgvjgjhgfjhfggjhfjtfgjh&txn_id=4CN141026K278934Y&payment_type=instant&last_name=XXX&receiver_email=XXX&payment_fee=0.33&receiver_id=DCMXPXGX4QX6J&txn_type=web_accept&item_name=Account+top+up&mc_currency=USD&item_number=Account+262262+top+up&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=topup%3A262262%3A1%3A1433162020&payment_gross=1.00&shipping=0.00&auth=ANSTBwT3znll-gJQZO2cLoV5QJFW9v8W.FqyWxffdtI0L-9mfsoe2xRL44M86Sn2XtYGtcqG4Fjjel1kdYZyxpQ
我发送给IPN的内容:
POST https://www.sandbox.paypal.com/cgi-bin/webscr HTTP/1.1
Host: www.sandbox.paypal.com
Accept: */*
Content-Length: 942
Content-Type: application/x-www-form-urlencoded
cmd=_notify-validate&mc_gross=1.00&protection_eligibility=Ineligible&payer_id=5XNKM66NSDKC4&tax=0.00&payment_date=05%3A34%3A11+Jun+01%2C+2015+PDT&payment_status=Completed&charset=utf-8&first_name=XXX&mc_fee=0.33¬ify_version=3.8&custom=topup%3A262262%3A1%3A1433162020&payer_status=verified&business=XXX&quantity=1&payer_email=XXX&verify_sign=AG58dBsn5g2z8O8NEjotbuJGP14PAIpZ4k26VL8IyhaDPkcDRj002Keq&memo=hmgvjgjhgfjhfggjhfjtfgjh&txn_id=4CN141026K278934Y&payment_type=instant&last_name=XXX&receiver_email=XXX&payment_fee=0.33&receiver_id=DCMXPXGX4QX6J&txn_type=web_accept&item_name=Account+top+up&mc_currency=USD&item_number=Account+262262+top+up&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=topup%3A262262%3A1%3A1433162020&payment_gross=1.00&shipping=0.00&auth=ANSTBwT3znll-gJQZO2cLoV5QJFW9v8W.FqyWxffdtI0L-9mfsoe2xRL44M86Sn2XtYGtcqG4Fjjel1kdYZyxpQ
有人能帮我看看我做错了什么吗? 谢谢。