Jump to content

How can I get Paypal to send variables back to me once completed?


Hobgoblin11

Recommended Posts

OK, I think this should belong on this board.

 

I am trying to write something that does the following (simplified for ease of understanding):

 

User has signed into my website and has a session variable with their user id in it. There is a table in the mySQL databse that contains details about the user. (this part is already working)

User wants to pay for a trip, so clicks a customised Paypal button that takes him to the Paypal site. The item has an trip id associated with it.

Once the transaction has been completed, I want to feed information back to my website, and insert the 'item id' and 'user id' into a field in a table in the database.

 

Any idea how I might do this!? Whilst I have a basic script that will insert a row into my table, it relies on variables being sent from the page it is on, thus will not work when the user is redirected to Paypal, as I cannot find a way to send variables to paypal about the item, and then have them send it back to me once the transaction is complete.

 

My PHP is self-taught so sorry if this way of doing things seems a bit scrappy.

Link to comment
Share on other sites

Oky dokey, after a couple of days off, I've nabbed the standard Paypal listener off their site and have it working from paypal's sandbox. Obviously I need to adapt and expand it further

 

How do I now send my custom variables, is it as simple as including a couple of lines like this in my button?

 

<input type="hidden" name="tripid" value="<?php echo $tripid; ?>">

<input type="hidden" name="userid" value="<?php echo $userid; ?>">

 

Thanks a lot, your help is really appreciated!

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.