From this article on CodeGuru about PayPal IPN, I see there are two fields, payer_email and payer_id, that can be used to identify the user. Is there anything else I'm missing? Do you use these fields to identify the user or how do you do it?
Thanks
I've used the 'custom' variable to hold the user id in my system. Then, when the ipn notification comes back to my site, I use the value in 'custom' to look up and identify the user when processing the ipn.
Doing this requires the user to be logged in on my site so I know who they are and can add that information into the 'custom' variable for the paypal button.
Related
Is there a way to return the buyers phone number in the notify url variables? I do not see it being returned at all. I am getting the address and all other profile information but not the phone number? Is there something I need to set prior or a hidden field I need to setup in the form prior to checkout?
While the IPN reference does list contact_phone as an IPN field, my experience is that it is not frequently returned. Many people do not have it in their PayPal account profile (a similar problem exists for Ebay customers). There is nothing you need to do on your end, except make sure you code can process that field. It will be included if it is present.
I want to get paypal button with default amount value by user email ID. So it will automatically use User Email ID registered with the website.
If I understand you correctly, you just need to make sure you're using a non-hosted button from PayPal so that you can see the values and dynamically set the business parameter based on the logged in user.
There are disadvantages to this, though, as people could see the form code, copy it, adjust it, and submit bogus values to your system. You could use IPN to help catch false orders, but it can be a hassle.
I would recommend using the Express Checkout API if you're familiar with web services. This ia a nice and secure way of doing what you need.
It's not a problem but i don't know how to do this; let's say that I have a sign up form with some fields: username, password, email, as you know the user clicks on the BUY BUTTON and pay's up.
Well, how can I know the username that just made the payment, I mean how can I link those two things together, one idea it's to use the email address, but mose of the people sign up with different email addresses, mabe they have a different paypal address...you know...I need this information because I need a way to activate the account.
And I also need to know, if the user canceled a subscription will paypal post a message to my IPN link?
I suggest you use the following PHP script for easy integration with PayPal's service (assuming you're using PHP): http://www.micahcarrick.com/04-19-2005/php-paypal-ipn-integration-class.html
If you do, the e-mail you will be looking for will be supplied in
$paypal->ipn_data['payer_email']
(again, assuming that $paypal is your object of the paypal_class class)
Obviously you have to follow the setup steps first. I suggest using the example script. It is really easy to do - in only four steps.
I suggest you read the official paypal documentation about IPN and recurring payments.
PayPal issues a IPN for every event that occurs to the user subscription, for example:
subscr_signup
subscr_eot
subscr_cancel
subscr_failed
About the parameter, you can use a parameter named "custom" to pass a value, for example the user id or email, and that parameter will be sent you in every IPN.
Here are implementations of the PayPal IPN in both C# and VB:
http://www.xdevsoftware.com/PPIPNDesc.aspx
Here's an account of how I incorporated it into a PayPal subscriptions scenario:
http://www.codersbarn.com/post/2008/07/10/ASPNET-PayPal-Subscriptions-IPN.aspx
Gday All,
I am developing a site that uses PayPal to take online payments.
I need to be able to send my client an email with the link to PayPal in order to pay.
In this link I need a way to set a unique value (for example bookingId) that I can use to add the receipt number to the correct booking via PayPal's payment notification feature.
Does anyone know what custom value I can set in order to achieve this?
Cheers,
Michael
The "item_name" field will be displayed to the user and can be set to whatever you like. I use it for conference registration ID's, while using item_number to track what was actually purchased.
Use Invoice field.
You can use any of the following passthrough variables:
custom
item_number or item_number_x
invoice
See page 409 in the PayPal Website Payments Standard Integration Guide:
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WebsitePaymentsStandard_IntegrationGuide.pdf
for details.
I wanted to use Paypal's IPN service to verify payments for a recurring subscription charge for my website. How do you tie the IPN confirmations to a user in your site?
The IPN confirmation message has a name, email, paypal ID, recurring payment ID, but it seems to not give a unique identifier since I don't know where the paypal ID or recurring payment id comes from and it may not be trivial to uniquely match up the name/email that a user has on their paypal account (or entered there) with the name/email I have for them on my site (there may be many John Smith's and the person may choose to use a different email.)
1) When I send the initial payment request to Paypal, I can attach a unique UUID in the URL I ask them to send back to me, so if I save that unique ID for that user I can match that payment confirmation to the user who initiated it. Am I making that harder than it is? Is there an easier way?
2) Also, for a recurring/subscription charge, does paypal always use the URL I specified with the initial payment initiation? Does anyone have practical experience using the recurring Paypal payments with IPN's, does it reuse that unique URL? Or do I have to associate the Paypal ID's with the user after the first recurring payment is received?
Attaching unique data to the payment request is pretty much the accepted way to do it.
I don't have any experience with recurring charges.
I recently also set up some reoccurring payments with Paypal.
I actually wanted people to register as members after paying for the subscription, if they wanted to. As having to sign up as a member could add some friction to the sale process. So I don't send any user info along with the Subscribe button.
What my IPN script does is generate a unique activation code tied to the Paypal subscriptionID in the Activations table, then it sends this code to whoever paid for the subscription, with instructions on how to activate.
At the point of activation, you need to register or login. At this point the userID is added to the relevant row in the Activations table.
When the EndOfTerm IPN notification comes in the IPN script looks up the userID from the Activations table based on the SubscriberID given in the IPN. Then I can do whatever I need to do to that user to disable their subscription.
At all time the URL of the IPN script remains the same.
1) You can send an 'item_number' parameter with the initial subscription setup, which will get passed back to you. I'd suggest embedding an identification token in it.
2) If you mean the 'return' parameter, no, that's for sending the user to at the conclusion of the subscription setup. The renewal is automatic and doesn't 'ping' that page.
1) You want to be using the item_number parameter. Set this in your HTML form shown to the customer, and it will be returned to you by the paypal IPN, so you can put a database row ID in here, and use it to match up to the right person later.