Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Getting Variables from PayPal

    I want to create a code that allows users to purchase something on paypal and then paypal sends me the transaction information and I store it in a mysql database for further use. I have a paypal account and have read some of the information on integrating this with my site, but I am having some problems understanding it. I have some knowledge of html, php, and mysql but would still consider myself a beginner.

    So here's the sequence of pages I need help with in the order the customers would view them:

    1. My "store" on my website with the option to purchase a product. The customer is logged in and there is a sessions variable with their email in it. They click a buy now button which takes them to paypal. (I don't need help coding this page, but as it is an important step in the process I included it)

    2. Paypal website. I have one "product" for sale at a static price, you can purchase multiples of the product though. So here the user should be able to pay for the product and complete the transaction. (I can set this up through paypal myself as well, but once again included it because its an important step.)

    3. Back to my website to the "Thank you for your business page." (This is the page I need help with). Here I would like to display to the customer the transaction id, amount of product purchased, and the price of transaction. I would then put the transaction id and amount of product into my database for later use. So I need help figuring out how to send the transaction id, amount of product, and total price from paypal to this page. The user will already be using a session so I will have their email for use in the database.

    So my question is how do I get paypal to send variables (specifically the transactionid, amount of product, and total cost) to my webpage? And then how would I retrieve it (I can get items sent with POST, but I'm not sure if that is what paypal is using).

    Thanks!

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    Paypal has a fairly good tutorial on this here is the main link

    https://www.paypal.com/ipn

    the ipn listener is what you use to get the vars from paypal, they even have a code sample link on the bottom of that page.

    it really depends on what your using website payments, or wsp pro or something else.

    Also be careful if you need custom vars, it can be tricky, try to stick with the basic vars they provide for you.

    the ipn guide at the bottom of that page will help you.


    also set you up a sandbox account, it allows you to test as a live site but no real money changes hands.

    to use it you will need to have a special form connection as well as a special var link in your ipn. the guide will help you with that.

    then when your ready to go live you change both of those links to the live version and your off and running.
    Last edited by durangod; 09-16-2011 at 12:24 AM.

  • Users who have thanked durangod for this post:

    whitney6 (09-16-2011)

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Exactly what I was looking for! Thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •