gpt4 book ai didi

来自 return_url 的 Paypal IPN 验证无效,但来自 notify_url 的验证已验证

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

我正在使用 Paypal 订阅,标准网站按钮。所以对于这个问题,payment_type 是 subscr_signup,用于为您的新用户创建用户帐户。我的 HTML 按钮表单将“notify_url”的值设置为 http://domain.com/billing/ipn ,“返回”设置为http://domain.com/billing/thankyou , "rm"设置为 2

有了这个,当有人完成付款时,他/她将被重定向到我们的感谢页面,以及 POST 中的 IPN 数据。我明白了。但是当我用 Paypal 验证它时,我得到了一个无效的响应。现在,奇怪的是,我们还应该将数据发送到我们的 IPN notify_url,对吧?我们做到了,但这次,向 Paypal 验证它会返回 VERIFIED。

我注意到发送的数据有些不同。

RETURN 感谢页面的数据 - 无效(JSON 化)

{
"txn_type": "subscr_signup",
"subscr_id": "I-HHTJ0ANUHKRU",
"last_name": "Ismail",
"residence_country": "CA",
"mc_currency": "USD",
"item_name": "Individual eStudio Plan",
"business": "business@kengkawan.com",
"amount3": "99.00",
"recurring": "1",
"address_street": "1 Maire-Victorin",
"payer_status": "verified",
"payer_email": "customer@kengkawan.com",
"address_status": "confirmed",
"first_name": "Iszuddin",
"receiver_email": "business@kengkawan.com",
"address_country_code": "CA",
"payer_id": "LYRHTKFEH45M8",
"address_city": "Toronto",
"reattempt": "1",
"item_number": "IND",
"address_state": "Ontario",
"subscr_date": "22:52:19 Oct 29, 2014 PDT",
"address_zip": "M5A 1E1",
"charset": "windows-1252",
"period3": "1 Y",
"address_country": "Canada",
"mc_amount3": "99.00",
"address_name": "Iszuddin Ismail",
"auth": "AUjfQ4uRNLr22YfSNPGR1YLm5w81cYyFjf9PEu7mVGSLTp2cFD67opAIXJ-Dtsnw4KEXlF0Y268Ks9VmrwpDRrg",
"form_charset": "UTF-8"
}

NOTIFY_URL 的数据,后端 IPN 数据 - 已验证(JSON 化)

{
"txn_type": "subscr_signup",
"subscr_id": "I-HHTJ0ANUHKRU",
"last_name": "Ismail",
"residence_country": "CA",
"mc_currency": "USD",
"item_name": "Individual eStudio Plan",
"business": "business@kengkawan.com",
"amount3": "99.00",
"recurring": "1",
"address_street": "1 Maire-Victorin",
"verify_sign": "Ajiy6YmBz00sV0oT2S-obuaQ3kehAQO0-T8GJFKpiQnaRzRv7.oJ5Eqy",
"payer_status": "verified",
"test_ipn": "1",
"payer_email": "customer@kengkawan.com",
"address_status": "confirmed",
"first_name": "Iszuddin",
"receiver_email": "business@kengkawan.com",
"address_country_code": "CA",
"payer_id": "LYRHTKFEH45M8",
"address_city": "Toronto",
"reattempt": "1",
"item_number": "IND",
"address_state": "Ontario",
"subscr_date": "22:52:19 Oct 29, 2014 PDT",
"address_zip": "M5A 1E1",
"charset": "windows-1252",
"notify_version": "3.8",
"period3": "1 Y",
"address_country": "Canada",
"mc_amount3": "99.00",
"address_name": "Iszuddin Ismail",
"ipn_track_id": "698ae88a36ef9"
}

由于我确实得到了预期的响应(已验证或无效),我相信我的 Paypal IPN 验证码是正确的。但以防万一,这是我的 HTML 按钮代码。

            <form action="<?php echo $this->url?>" method="post" name="ppform">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="<?php echo $this->paypal_email; ?>">
<input type="hidden" name="item_name" value="<?php echo $selected_plan['name'] ?>">
<input type="hidden" name="item_number" value="<?php echo $selected_plan['code'] ?>">
<input type="hidden" name="a3" value="<?php echo $selected_plan['price']; ?>"> <!-- subscription price -->
<input type="hidden" name="p3" value="1"> <!-- rebill every x value -->
<input type="hidden" name="t3" value="<?php echo $selected_plan['recurring_period'] ?>"> <!-- interval M=month/W=week/Y=year -->
<input type="hidden" name="src" value="1"> <!-- Is this recurring 1=yes/0=no -->
<input type="hidden" name="currency_code" value="<?php echo $selected_plan['currency'] ?>">
<!-- <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> -->
<input type="hidden" name="rm" value="2">
<input type="hidden" name="notify_url" value="<?php echo site_url('billing/ipn') ?>">
<input type="hidden" name="return" value="<?php echo site_url('billing/thankyou') ?>">

</form>

最佳答案

return_url 没有收到任何付款/IPN 信息。通常它应该只是一个显示“谢谢,再来”的静态页面。

您应该使用 notify_url 验证 IPN 消息。您需要按照接收时的方式完全发送接收到的付款数据。如果您收到一个好的请求的 INVALID 错误,您应该仔细检查您收到请求的编码,存储在 php 中并发回。您可以使用 PayPal PHP SDK确保在付款代码中。

请注意,IPN 会发送一系列有关订阅用户注册、付款处理等的消息。

关于来自 return_url 的 Paypal IPN 验证无效,但来自 notify_url 的验证已验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26646359/

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