实现标准的 Paypal“立即购买”按钮。文档 here不清楚将哪些数据传递给“返回”网址。文档也没有提及如何通过表单发送您自己的自定义数据。
任何人都可以为此提供适当的文档吗?
相关代码:
<form accept-charset="UTF-8" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="mYAT+aR+YhVyBrulWoYoMjzY00DQggAXUVGI12TA6zk="></div>
<input id="cmd" name="cmd" type="hidden" value="_xclick">
<input id="currency_code" name="currency_code" type="hidden" value="USD">
<input id="notify_url" name="notify_url" type="hidden" value="http://localhost:3000/en/paypal_ipns/cart_purchase_ipn">
<input id="item_name" name="item_name" type="hidden" value="Cart id 5398">
<input id="quantity" name="quantity" type="hidden" value="1">
<input id="business" name="business" type="hidden" value="seller_1318259_biz@me.net">
<input id="return" name="return" type="hidden" value="http://localhost:3000/en/checkout/process_paypal_return">
<input id="amount" name="amount" type="hidden" value="1.99">
<input id="rm" name="rm" type="hidden" value="2">
<p>
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</p>
</form>
最佳答案
您可以使用 PDT(付款数据传输)将交易信息返回到您的页面。您可以在上面找到更多信息 here .您还可以找到可以返回的 PDT 变量列表 here .如果您想要传递自定义信息,您可以将其填充到变量“custom”中,然后在您返回返回页面时解析该变量。我通常用“|”分隔我填充到“自定义”变量中的不同变量和值但您可以使用适合您的任何东西。
关于paypal - 什么数据回传到 Paypal 'return' url,我如何将自己的数据发送到这个 url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11295849/