【发布时间】:2015-10-20 12:03:34
【问题描述】:
我需要将付款与 PayPal 集成,我正在使用表单集成
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
...
<input type="hidden" name="return" value="http://example.com/Thankyou.html">
<input type="hidden" name="notify_url" value="http://example.com/IPN">
<input type="image" name="submit" border="0" src="/img/logos_icons/paypal-btn.png" alt="PayPal - The safer, easier way to pay online">
</form>
在这一点之后,我有点困惑:当用户点击购买按钮时,会重定向到 PayPal 网站,而当交易完成时,会重定向到“retun”链接(感谢页面)。同时 PayPal 向“notify_url”发送通知(IPN)。
这是正确的工作流程吗? 如果是,在通知方法中我应该预订购买的产品,但我如何了解与当前通知相关联的原始交易?
【问题讨论】: