I'm trying to develop an application with paypal and fsockopen

may be a solution with curl instead ?

I have a page with a form on the site where users enter the id number, mark checkboxes beside the agreement and enter an email address as their username.
After user submits the form it posts back to the script on my server to parse the information entered in the form and if everything is ok script takes him/her directly to the PayPal screen (using fsockopen).

Technical flow:

Form -> submit -> Script parses form input -> if no errors -> fsockopen(¡¥paypalpath.com¡¦,80) -> display fsockopen() output

First:
Paths to StyleSheet and one JavaScript include files are screwed up ¡V because they are relative (no https://www.paypal.com/ included in path)

Two:
Fsockopen() always opens the registration screen even if user has paypal cookie installed (because being called from server and not users browser)

Three:
It also gives me a JavaScript error which I can¡¦t find ƒ¼

Four:
I want path to paypal be displayed in the url string. Sort of initiate a post request from users browser with my variables 🙂

    good luck 😉

    Let me know when you find the answers if you could. I've been looking to do something similar for awhile, but haven't had the time to get around to it.

    I'd appreciate any notes you can offer.

    senica@simplewonder.com

      2 years later

      i do not think grabbing the output from paypal.com on your server and sending it back as your own response is the right way to do it. i would make sure all transitions from your site to paypal go through the browser. respond with 200 OK to the POST that the user does and let the user click a link to proceed to paypal.com. or am i missing something?

        The Paypal documentation recommends that you create a regular HTML form pointing at the Paypal server containing the information about the purchase along with the sellers email address and a special command telling Paypal which payment method to use (e.g. Buy Now button, Shopping Cart etc). cURL can achieve this just fine.

        If you need to use Paypal's IPN service you'll need to have a script ready to recieve a request from Paypal which does open a socket to Paypal to verify the transaction.

          Four:
          I want path to paypal be displayed in the url string. Sort of initiate a post request from users browser with my variables

          I use cURL but have this issue.

            Write a Reply...