[英]PayPal Thank You Page by form variable
I've created a payment button in Paypal, and I'd like to pass a user's input as a variable to the thank you page.我在 Paypal 中创建了一个付款按钮,我想将用户的输入作为变量传递给感谢页面。 (
domain.com/thank-you?uid=$ID
). (
domain.com/thank-you?uid=$ID
)。
So I've added a <INPUT TYPE="hidden" NAME="return" value="domain.com/thank-you?" id="my-id">
所以我添加了一个
<INPUT TYPE="hidden" NAME="return" value="domain.com/thank-you?" id="my-id">
<INPUT TYPE="hidden" NAME="return" value="domain.com/thank-you?" id="my-id">
according to the doc <INPUT TYPE="hidden" NAME="return" value="domain.com/thank-you?" id="my-id">
根据文档
and I've added an OnClick event to the submit button, submitElement.addEventListener("click", clickFunc, false);
我在提交按钮中添加了一个 OnClick 事件
submitElement.addEventListener("click", clickFunc, false);
And it is working nicely (tested it out with alert
& then implemnted the uid=$ID
addition to the hidden return
value).它运行良好(使用
alert
对其进行了测试,然后将uid=$ID
添加到隐藏的return
值中)。 But PayPal does nothing with my return value.但是 PayPal 对我的返回值没有任何作用。 PayPal simply leaves the clients on their
Successfully Paid
Page. PayPal 只是将客户留在他们的
Successfully Paid
页面上。
Any ideas?有任何想法吗? Thanks in advance, Have a great weekend!
提前致谢,周末愉快!
When using HTML forms to redirect to PayPal, a return may never happen.当使用 HTML forms 重定向到 PayPal 时,可能永远不会发生返回。 Depending on the user's locale and funding method, PayPal may need to show them a receipt, and click a link to return.
根据用户的区域设置和资助方式,PayPal 可能需要向他们出示收据,然后单击链接返回。 Or their browser may crash.
否则他们的浏览器可能会崩溃。 If you require a return to happen, this is the wrong integration method.
如果您需要退货,这是错误的集成方法。
The best integration method to receive a successful notification of completed payments is https://developer.paypal.com/demo/checkout/#/pattern/client , either that client-side-only version or the pattern that communicates with a server.接收已完成付款成功通知的最佳集成方法是https://developer.paypal.com/demo/checkout/#/pattern/client ,无论是客户端版本还是与服务器通信的模式。
To use the server version, create two routes, one for 'Set Up Transaction' and one for 'Capture Transaction', documented here: https://developer.paypal.com/docs/checkout/reference/server-integration/要使用服务器版本,请创建两条路由,一条用于“设置事务”,一条用于“捕获事务”,此处记录: https://developer.paypal.com/docs/checkout/reference/server-integration/
Either way, on successful capture you can display a thank you message in any way you wish.无论哪种方式,成功捕获后,您都可以以任何您希望的方式显示感谢信息。 Including a redirect if you are feeling old-fashioned.
如果您觉得过时,包括重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.