我需要允许进行定期订阅。到目前为止,它看起来不错,只是 Paypal 没有完全遵守“返回”隐藏变量值。它执行重定向但省略了提供的查询字符串。它确实添加了几个查询字符串变量,例如 www.mysite.com?auth=XXXX&form_charset=YYYY
对于我的解决方案,如果可能的话,我想依赖查询字符串中的某些值。否则,我将不得不将该临时信息存储在 Session 中。
有什么想法吗?
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="MerchantEmailAddress" />
<input type="hidden" name="item_name" value="Description of Transaction">
<input type="hidden" name="a3" value="5.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="custom" value="111.111111" />
<input type="hidden" name="invoice" value="11" />
<input type="hidden" name="cancel_return" value="http://www.MySite.com/?Cmd=Cancel" />
<input type="hidden" name="return" value="http://www.MySite.com/?Cmd=Return" />
<input name="notify_url" value="http://www.MySite.com/?Cmd=Notify" type="hidden">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
最佳答案
添加 rm=2
变量和值应该有效。这将告诉 PayPal 将信息作为 POST 发回。如果您在卖家账户中启用了支付数据传输,它将覆盖 rm
值,并且从 PayPal 返回到您网站的信息将始终是 GET。
关于 Paypal 返回网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17641421/