【发布时间】:2017-08-01 07:21:07
【问题描述】:
我正在使用自己编写的下载软件通过 paypal 进行付费下载。这在过去几年中没有任何问题,但最近几天 PayPal 的 IPN 出现了一些问题。每个下载都有一个自己的表格,for 看起来像这样
<form action="https://www.paypal.com/cgi-bin/webscr" target="_top" method="post" target="_top" style="text-align: right">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="seller@example.com">
<input type="hidden" name="item_name" value="SOME PRODUCT Single License">
<input type="hidden" name="item_number" value="20001"> <input type="hidden" name="amount" value="69">
<input type="hidden" name="currency_code" value="EUR"><input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="notify_url" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=notify&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<input type="hidden" name="image_url" value="http://www.example.com/files/logo.png">
<input type="hidden" name="return" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=return&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<input type="hidden" name="cancel_return" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=cancel&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<button class="btn btn-lg btn-success btn-block" style="border-radius: 0;">Purchase now <br /><small>secure via PayPal</small></button>
页面上有多个表单,包含不同的产品。几天以来,我遇到了这个问题:
沙盒和直播:购买后,有新的布局和返回商店的新链接。几天前,该链接称为我的返回网址,并带有一些获取/发布数据。该数据中包含 txn_id。在通知 url 上总是向 PayPal 发送交易,通过返回 url 和 txnid,我能够检查交易并显示一些信息。
取消 url 也被忽略。我可以点击按钮,然后我来到贝宝。几天前,我可以点击取消,然后回到 cancel_return 以显示一些信息。在大多数情况下,cancel_return 现在是:
https://www.example.com/path1/path2/path3/?no_cache=1
没有其他参数。在 10 个案例中的 7 个中,附加参数不在 paypal 页面的取消链接中。
并且在 10 种情况中的 7 种情况下,notify_url 从未被调用过,可能还有一些参数丢失了。
在 10 个案例中的 10 个中,return_url 不包含 txn_id,在 10 个案例中的 7 个中,返回 url 丢失了我的表单中的参数。
第一次不良付款(收到钱,没有正确的 return_url 并且没有调用 notify_url 是几天前的事)。上个月,我从不同页面使用不同产品进行了大约 60 笔交易,都没有错误。
我现在不知道怎么了。
【问题讨论】:
-
no_cache=1之后的所有内容是什么?看起来 URL 可能不是您想要的。 -
您好 aynber,谢谢您的评论。它是一个 MVC 应用程序。其他参数是 IPN 必须调用的控制器/操作。此参数对于向用户显示正确的内容(返回已完成/待处理/失败)或 cancel_return 很重要。如果 URL 中缺少参数,用户只能看到包含产品的页面。
-
我现在可以看到,如果买家登录到 PayPal,在实时系统上会出现缺少的参数 url。如果客户端浏览器上没有贝宝登录/会话,则会正确处理 notify_url、return 和 cancel_return。这有多奇怪?!
标签: php paypal paypal-ipn