简体   繁体   中英

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. ( 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"> according to the doc

and I've added an OnClick event to the submit button, 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). But PayPal does nothing with my return value. PayPal simply leaves the clients on their Successfully Paid Page.

Any ideas? Thanks in advance, Have a great weekend!

When using HTML forms to redirect to PayPal, a return may never happen. Depending on the user's locale and funding method, PayPal may need to show them a receipt, and click a link to return. 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.

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/


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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM