How to tie paypal payment to user accounts? IPN?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpshift
Forum Newbie
Posts: 3
Joined: Tue Jun 20, 2006 9:52 pm

How to tie paypal payment to user accounts? IPN?

Post by phpshift »

I need to see WHO made a payment using the paypal IPN, I suppose. But I don't know how to get which user, just payment details. Is there any way to send the username to paypal when they press the buy now button and then get it back with the IPN?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to tie paypal payment to user accounts? IPN?

Post by requinix »

You can send whatever you want in the "custom" field and it'll be returned to you verbatim.

(Actually, any unspecified fields will be returned to you, but it's hazardous to forwards compatibility to rely on that.)
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: How to tie paypal payment to user accounts? IPN?

Post by califdon »

As tasairis said, you can send any data you want along with the transaction, in the "custom" field, and it will be included in the IPN confirmation data. There are additional possibilities, but you should read the complete documentation at https://cms.paypal.com/us/cgi-bin/?&cmd ... TVariables. I know it's a lot of detail, but if you're building a financial payment system, you really need to understand how it works!
nga
Forum Commoner
Posts: 46
Joined: Mon Aug 17, 2009 3:05 am

Re: How to tie paypal payment to user accounts? IPN?

Post by nga »

uhm, the custom field in IPN can be used to hold userID but where can i put this cutome field so it would come back in IPN? In paypal form as a hidden field?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: How to tie paypal payment to user accounts? IPN?

Post by califdon »

nga wrote:uhm, the custom field in IPN can be used to hold userID but where can i put this cutome field so it would come back in IPN? In paypal form as a hidden field?
Yes, a hidden field with the name='custom'.
phpshift
Forum Newbie
Posts: 3
Joined: Tue Jun 20, 2006 9:52 pm

Re: How to tie paypal payment to user accounts? IPN?

Post by phpshift »

This is invaluable. Thank you for your help. I could not find an option to add a "custom" field from paypal itself. It never occurred to me that it would allow me to just add it myself. Thanks again.
Post Reply