gpt4 book ai didi

node.js - nodejs - 无法让 paypal-ipn 工作。 Paypal 一直返回 "INVALID"

转载 作者:太空宇宙 更新时间:2023-11-03 16:11:57 25 4
gpt4 key购买 nike

我正在尝试使用 nodejs 模块 paypal-ipn 来验证对 paypal 的付款。

我以下列格式传入验证方法数据...

{ tx: '60R52218GS3878125',
st: 'Completed',
amt: '0.01',
cc: 'GBP',
cm: '',
item_number: '' }

每次我使用它时,我都会收到“无效”作为 Paypal 返回的响应。

最佳答案

您回发到 Paypal 的内容是什么?根据 https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro 中的“示例 IPN 消息和响应”段落您需要将收到的完全相同的字符串 POST 回来。 IE。

PayPal sends a message, similar to the following one, for a $19.95 purchase made by Express Checkout:

mc_gross=19.95&protection_eligibility=Eligible&address_status=confirmed&payer_id=LPLWNMTBWMFAY&tax=0.00&address_street=1+Main+St&payment_date=20%3A12%3A59+Jan+13%2C+2009+PST&payment_status=Completed&charset=windows-1252&address_zip=95131&first_name=Test&mc_fee=0.88&address_country_code=US&address_name=Test+User&notify_version=2.6&custom=&payer_status=verified&address_country=United+States&address_city=San+Jose&quantity=1&verify_sign=AtkOfCXbDm2hu0ZELryHFjY-Vb7PAUvS6nMXgysbElEn9v-1XcmSoGtf&payer_email=gpmac_1231902590_per%40paypal.com&txn_id=61E67681CH3238416&payment_type=instant&last_name=User&address_state=CA&receiver_email=gpmac_1231902686_biz%40paypal.com&payment_fee=0.88&receiver_id=S8XGHLYDW9T3S&txn_type=express_checkout&item_name=&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=&payment_gross=19.95&shipping=0.00

Before you can trust the contents of the message, you must first verify that the message came from PayPal. To verify the message, you must send back the contents in the exact order they were received and precede it with the command _notify-validate, as follows:

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate&mc_gross=19.95&protection_eligibility=Eligible&address_status=confirmed&payer_id=LPLWNMTBWMFAY&tax=0.00&...&payment_gross=19.95&shipping=0.00

因此:在尝试验证之前不要更改您收到的数据。

关于node.js - nodejs - 无法让 paypal-ipn 工作。 Paypal 一直返回 "INVALID",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9933815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com