in reply to Post cart data to paypal

All you need to do is have your script output the form with the fields filled out properly, like

<body onload="document.myform.submit()"> <form action="the paypal url" name="myform" method="post"> <input type="hidden" name="some paypal form key" value="the correspond +ing value"> <input type="submit" value="click here to continue">

If the user has JavaScript enabled, they probably won't notice the redirect.

Edit: It seems people are misunderstanding what I wrote. OP's problem, as I understood it, was that their script needs to add items to their user's PayPal cart. PayPal has a way of doing this, which involves putting a form on your webpage for the user to click on. Perhaps OP needs to look up the product ID or something, so just using the default form won't work. Here's what PayPal suggests you put on your page. Those hidden fields are already filled out. The only thing the user would see is the "Add to cart" button. My suggestion was to have OP's script fill out those fields as they should be anyways, and then to "click" the button for the user, to streamline the buying process.

-Thomas
"Excuse me for butting in, but I'm interrupt-driven..."

Replies are listed 'Best First'.
Re^2: Post cart data to paypal
by james28909 (Deacon) on Jan 26, 2016 at 17:01 UTC
    Without a proper explanation as to why he even wants to attempt this, why would you give him any clues on how to do it? I am certain what he is trying to accomplish is capturing credentials, which no user will agree to. IF he put, above the user credential form on his website, "user credentials will be copied into paypal for your convinience", no user in their right mind would allow him to do this and is a serious security risk.

    Maybe allowing him to explain WHY he is doing it before telling him HOW, would be a better path.