Jump to content

Passing variables to PayPal then back to my site...


Jim R

Recommended Posts

I'm having a hard time wrapping my head around PayPal's IPN and PDT information.  (I assume if you can help me you know what those mean.)  However, I'm not trying to pass information from the transaction to my site because the person who pays isn't truly my concern, and the emails don't always match.

Parents sign up their son for a basketball league.  I have a great form that separates participants based on a couple of factors to three different price points within PayPal.  All I want to do is send the player's name and school to PayPal and have it returned as they're sent back to my site after completing payment.  From there, I can take that information, Update my database accordingly.  

I know how to pass variables through URL's.  I just don't see much in the way of returning variables which have little to do with the transaction relative to PayPal's needs. 

Link to comment
Share on other sites

I know nothing about your interface but the usual thing is

1 - you send the arguments via the url;

2 - the Paypal api uses that info to do something

3 - the Paypal api determines what you get back

My point being that Paypal and their api determine the return, not you. 

 

What leads you to believe that you can get something back from Paypal?

What kind of documentation do you have on the IPN and PDT?  Any info in it on the values that are or can be returned?

Link to comment
Share on other sites

You can pass a custom value to PayPal with the transaction. They will send it back to you in their messages.

Use that value as an identifier for the order (which you should be storing), and obviously you know who the user is from the order.

Link to comment
Share on other sites

2 hours ago, ginerjm said:

I know nothing about your interface but the usual thing is

1 - you send the arguments via the url;

2 - the Paypal api uses that info to do something

3 - the Paypal api determines what you get back

My point being that Paypal and their api determine the return, not you. 

 

What leads you to believe that you can get something back from Paypal?

What kind of documentation do you have on the IPN and PDT?  Any info in it on the values that are or can be returned?

I've read through their documentation, but as you could imagine, it's mostly about passing transaction information from PayPal, most of which I don't need/want, and even the email addresses are only the same as the registration addresses 60% of the time.  

 

1 hour ago, requinix said:

You can pass a custom value to PayPal with the transaction. They will send it back to you in their messages.

Use that value as an identifier for the order (which you should be storing), and obviously you know who the user is from the order.

That's the issue.  Since I render just a one time service, I have only truly cared about the confirmation email I get that someone paid.  I've manually linked the payment to the registration.  I'm just at a point where I'd like it to automatically link it.  I posted the question in the PayPal community, but they have poor avenues for community help. 

Link to comment
Share on other sites

I just told you: pass some identifier, like for the order or the user or whatever else you're using in your database that is related to this transaction, and link the payment that way.

I did most of my PayPal work in a previous job, whose code I obviously don't have access to anymore so I couldn't tell you precisely what fields to use. But the principle is there.

Link to comment
Share on other sites

The IPN/PDT variables are all documented here.  

payer_id is the variable that is passed around in the initial dance back and forth to get to the actual payment.  So long as you store that in your customer record, you will have what requinix is talking about to correlate things inside your IPN listener script when the callback from Paypal occurs.

The other option is that you can use a hidden field named 'custom' and stuff whatever you want inside of it.  Paypal will pass custom through the process, but in this case, I don't see why you would want to when using the payer_id is core to the entire flow.  

Link to comment
Share on other sites

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.