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

来自return_url的Paypal IPN验证无效,但来自notify_url的验证无效,paypal,paypal-ipn,Paypal,Paypal Ipn,我使用贝宝订阅,标准的网站按钮。所以对于这个问题,付款类型是subscr\u signup,用于为新用户创建用户帐户。我的HTML按钮表单的“notify_url”值设置为,“return”值设置为,而“rm”值设置为2 这样,当有人完成付款时,他/她将被重定向到我们的感谢页面,以及POST中的IPN数据。我明白了。但当我与Paypal验证时,我得到了一个无效的响应。现在,奇怪的是,我们还应该将数据发送到我们的IPN通知url,对吗?我们做到了,但这一次,向Paypal验证后,返回验证结果 我注

我使用贝宝订阅,标准的网站按钮。所以对于这个问题,付款类型是subscr\u signup,用于为新用户创建用户帐户。我的HTML按钮表单的“notify_url”值设置为,“return”值设置为,而“rm”值设置为2

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

我注意到发送的数据中存在一些差异

返回感谢页面的数据-无效(JSON)

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

由于我确实得到了预期的响应(已验证或无效),我相信我的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>     

返回\u url不接收任何付款/IPN信息。通常它应该只是一个静态页面,显示“谢谢,再来”

您应该使用notify_url验证IPN消息。您需要以与接收相同的方式发送已接收的付款数据。如果您在一个好的请求中收到无效错误,您应该仔细检查获取请求的编码,将其存储在php中并发回。您可以在付款代码中使用“确保”


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

谢谢您的帮助。在一个论坛上,我被建议使用PDT来处理返回流量。我就是这么做的。我的系统仍然在后端记录IPN数据,接收SubCr_注册和SubCr_支付交易类型。但为了在付款后处理用户,我现在使用PDT数据。它需要在Paypal帐户中进行一些设置更新。然后,基于我的GET tx参数和我的secret PDT令牌,我可以请求事务的完整数据。return\u如果使用PDT,url可以接收付款信息(似乎是这样)。我认为问题不完整/不清楚,您在下面的评论中说您现在使用PDT,您应该使用此信息更新问题。请注意,如前所述,您可以也可能应该同时实现IPN和PDT。还请指定您使用的编程语言(可能是PHP?),并为此添加一个标记,因为这将增加您获得响应的机会。您是否使用沙盒进行测试?请同时发布一些代码。用于实现IPN的示例代码(PHP、.Net、Coldfusion等),用于实现PDT的示例代码
{
"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"
}
            <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>