PHP paypal ipn 返回 INVALID,但是 payment_status=Completed,这是为什么呢?

php中文网
发布: 2016-06-06 20:51:59
原创
2403人浏览过

这是记录的日志:
[08/22/2012 9:53 PM] - FAIL: IPN Validation Failed.
IPN POST Vars from Paypal:

mc_gross=1.00, protection_eligibility=Eligible, address_status=confirmed, payer_id=N9MJ3E2F72RSA, tax=0.00, address_street=1 Main St, payment_date=21:53:35 Aug 22, 2012 PDT, **payment_status=Completed**, charset=windows-1252, address_zip=95131, first_name=buyer, mc_fee=0.33, address_country_code=US, address_name=buyer buyer, notify_version=3.6, custom=3ba049446d1a922fccf9233c32794f16, payer_status=verified, business=775357_1345694569_biz@qq.com, address_country=United States, address_city=San Jose, quantity=1, verify_sign=ALJkApMs7H6RB6yOv.fdCxcGTa-tANEn6Te6SHeQgyIYAwZVU3TIrY0A, payer_email=775357_1345694424_per@qq.com, txn_id=60Y885950A771745Y, payment_type=instant, last_name=buyer, address_state=CA, receiver_email=775357_1345694569_biz@qq.com, payment_fee=0.33, receiver_id=BPFVTFG92JFY4, txn_type=web_accept, item_name=xxx,
 mc_currency=USD, item_number=, residence_country=US, test_ipn=1, handling_amount=0.00, transaction_subject=3ba049446d1a922fccf9233c32794f16, payment_gross=1.00, shipping=0.00, ipn_track_id=f9305268979, 

**IPN Response from Paypal Server:**
 HTTP/1.1 200 OK
Date: Thu, 23 Aug 2012 04:53:40 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=H9KuMTssqUu_tJf3Dam9rchmDS6GUQFouM5-KC3TtpHU199YtckVmNrqgSLfY9uIOFULbrXej6jtUILOdz4ImR-ruvjgSDh7RWeuAzPIVo40F7nN8Jxn1xVY2n-Ak8kFLmkUEm%7cSrCbIFQ6eG7qVUKiU5gXgRuZnXVRhIVr3AsqzO7z4At6yvgs588DjotxRox8tl_hJ4qi30%7cptKiyBJFIzge516dKd0-8zfnmTwVxF8Viz_QKeMZPIZPZ5Iu9OcdYiQyE8g861Be04KEt0%7c1345697620; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Sun, 21-Aug-2022 04:53:40 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Wed, 18-Aug-2032 04:53:40 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.109.11.1345697620182214; path=/; expires=Sat, 16-Aug-42 04:53:40 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

7
**INVALID**
0
登录后复制

回复内容:

这是记录的日志:
[08/22/2012 9:53 PM] - FAIL: IPN Validation Failed.
IPN POST Vars from Paypal:

mc_gross=1.00, protection_eligibility=Eligible, address_status=confirmed, payer_id=N9MJ3E2F72RSA, tax=0.00, address_street=1 Main St, payment_date=21:53:35 Aug 22, 2012 PDT, **payment_status=Completed**, charset=windows-1252, address_zip=95131, first_name=buyer, mc_fee=0.33, address_country_code=US, address_name=buyer buyer, notify_version=3.6, custom=3ba049446d1a922fccf9233c32794f16, payer_status=verified, business=775357_1345694569_biz@qq.com, address_country=United States, address_city=San Jose, quantity=1, verify_sign=ALJkApMs7H6RB6yOv.fdCxcGTa-tANEn6Te6SHeQgyIYAwZVU3TIrY0A, payer_email=775357_1345694424_per@qq.com, txn_id=60Y885950A771745Y, payment_type=instant, last_name=buyer, address_state=CA, receiver_email=775357_1345694569_biz@qq.com, payment_fee=0.33, receiver_id=BPFVTFG92JFY4, txn_type=web_accept, item_name=xxx,
 mc_currency=USD, item_number=, residence_country=US, test_ipn=1, handling_amount=0.00, transaction_subject=3ba049446d1a922fccf9233c32794f16, payment_gross=1.00, shipping=0.00, ipn_track_id=f9305268979, 

**IPN Response from Paypal Server:**
 HTTP/1.1 200 OK
Date: Thu, 23 Aug 2012 04:53:40 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=H9KuMTssqUu_tJf3Dam9rchmDS6GUQFouM5-KC3TtpHU199YtckVmNrqgSLfY9uIOFULbrXej6jtUILOdz4ImR-ruvjgSDh7RWeuAzPIVo40F7nN8Jxn1xVY2n-Ak8kFLmkUEm%7cSrCbIFQ6eG7qVUKiU5gXgRuZnXVRhIVr3AsqzO7z4At6yvgs588DjotxRox8tl_hJ4qi30%7cptKiyBJFIzge516dKd0-8zfnmTwVxF8Viz_QKeMZPIZPZ5Iu9OcdYiQyE8g861Be04KEt0%7c1345697620; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Sun, 21-Aug-2022 04:53:40 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Wed, 18-Aug-2032 04:53:40 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.109.11.1345697620182214; path=/; expires=Sat, 16-Aug-42 04:53:40 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

7
**INVALID**
0
登录后复制

其实ipn才是推荐使用的,因为它是异步处理的,可以避免因为网络问题带来的交易状态更新失败等状况。

你接收到invalid的Response,官方的检查方法如下:

  1. Check that your are posting your response to the correct URL, which is https://www.sandbox.paypal.com/cgi-bi... or https://www.paypal.com/cgi-bin/webscr... depending on whether you are testing in the Sandbox or you are live, respectively.
  2. Verify that your response contains exactly the same IPN variables and values in the same order, preceded with cmd=_notify-validate.
  3. Ensure that you are encoding your response string and are using the same character encoding as the original message.

突然看到你的response里面,test_ipn=1,意思就是你是用来测试paypal的,可是你的response确是从paypal.com收到的,当然Invalid了。把你的接收地址改成sandbox.paypal.com再试试吧。

IPN并不安全,建议用PDT~

猫眼课题宝
猫眼课题宝

5分钟定创新选题,3步生成高质量标书!

猫眼课题宝 262
查看详情 猫眼课题宝

您好,您的这个IPN是怎么获取到的呢?我的一直无法获取。。麻烦您能告诉下我么?很急,谢谢!!

立即学习PHP免费学习笔记(深入)”;

相关标签:
php
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号