Forwarding to Paypal with GET

2019-08-06 11:40发布

i usually use the standard POST form on my site, with fields that the user fills out, which POSTs directly to https://www.paypal.com/cgi-bin/webscr

what i would like to do now, is have the form submit to my own site, for my own internal programming purposes, and when that is done, my site would automatically forward the user to paypal, with the relevant field data in the URL, for example, to: https://www.paypal.com/cgi-bin/webscr?first_name=foo&last_name=bar& etc...

this would save me from having to put the intermediate stage of the form with the hidden fields, asking the user to "click here to complete your transaction on PayPal"

hope i'm understood....

thanks!

标签: paypal
1条回答
我想做一个坏孩纸
2楼-- · 2019-08-06 12:21

Sure, it'll work. But keep in mind that unless you involve the BMCreateButton or Express Checkout API's, the amount will be open to URL manipulation, so you must do a check on the paid amount afterwards.

For example; https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=blah@blah2.com&amount=0.99&currency_code=GBP&item_name=Blah+for+sale

Note: The GET redirect must be initiated on the browser-side or via a header() redirect. You can't use cURL for this, since that's a server-to-server communication.

查看更多
登录 后发表回答