relating website payments standard and IPN? - paypal

Im using Website Payments Standard so users can pay for a rating to be shown on their profile. Im also using IPN to check if the payment went through. How do I relate the two? When I get an IPN request to my listener, how do I know which user and rating it relates to?

If users are initiating payment through a buy it now or shopping cart button embedded in your site, you can set some sort of text box where the user enters their user name. this info will be sent with the Ipn. This is set up on the pay pal sure where you create the buttons.
Another method would be get their actual name from the ipn. Check the documentation for a list of variables that are sent with the ipn, there are a lot of possibilities.

Related

PayPal API - How to keep the payment process on my website?

I run a small marketplace with multiple sellers where buyers can buy items and pay with PayPal. The problem is, when someone makes a payment, they are then displayed the "Payment Confirmation" on the PayPal website and are given a choice to either return to their PayPal account, or return to the website.
Is there any way to keep the payment flow on my website, except for the payment part? I notice when buying on Etsy for example, the buyer goes to PayPal to make the payment and is then immediately returned to Etsy for the payment confirmation. They never see the PayPal payment confirmation page.
I assume it could be because Etsy and PayPal have a special arrangement that isn't available to other sites? Or am I missing something in the API?
Right now, with the normal PayPal API, this is what buyers see:
NAME, you've just completed your payment.
Your transaction ID for this payment is: XXXXXXXXXXXXXXXXXXXX.
We'll send a confirmation email to your#email.com
Go to PayPal account overview.
Go back to "seller#email.com".
I can't even figure out how to change the "Go back to..." link to my website name in the hidden fields. PayPal just chooses to display the seller's (the person that received the payment) email address.
Is there any way to at least set a website name for them to return to with hidden variables? Keep in mind that I have different sellers, so it's not something I could set inside each seller's PayPal account.
Thank you :)
I assume you are using Express Checkout with Set/Get/Do EC API integration. Please check the below document for experience options available with Express Checkout API.
https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/integration-guide/ECCustomizing/
The 'useraction=commit' in the PayPal payment auth url triigers the 'Buy' button. If you do not send that request paramter then it will show 'continue' button and you can complete rest of the process on your site.
However, if you are using Paypal Payment Standard product then you need to use Express Checkout to accomplish the outcome you are seeking.

Paypal Payments - What to store from them?

I was wondering, if you have coded a website which uses paypal payments as a payment method (the kind of payments where you get redirected to their site for payment, not web payment pro).
What kind of details can I store? Is it just their paypal email address that can get supplied to me or do other details regarding their paypal account also get sent to me via their API which can be stored on my site?
As already mentioned, you get the details of the transaction, so email address, name, delivery address and the contents of the shopping cart.
You can send custom parameters from your form though, such as phone number.
Paypal, by default doesn't ask users to provide a phone number and therefore usually doesn't send you one. However, it's often useful for retailers to have a customers phone number.
If your shopping cart is populated by your website and then customers are asked to complete a brief, name, phone number, email form before submitting to Paypals site you can send these extra form fields to Paypal and have them come back to your server for storage/checking.
However... I found it very erratic! There seemed to be a problem with my account when I did this and the PP technical team couldn't explain why it was only sometimes working! I gave up in the end and found a Payment gateway with credit card and Paypal integration, now all my payments come through the same channel and callback methods regardless of type.
http://www.securehosting.com I use now.
Mostly only the details pertaining to the transaction can be retrieved in the usual procedure, as it appears even when you see the transaction details in your paypal account when you receive payments. However, it would be helpful for you if you can provide more information on what you wish to look for.

Paypal IPN and transaction IDs

I currently have a simple Paypal button on my website where people enter some information which is saved into a database, and the button then takes them to paypal to pay £20 to join. The problem is there is no link between the website and paypal, so I have to manually cross check who has joined on the website against Paypal each time.
I've looked into Paypal IPN which looks ideal, but I can't work out how to match the transactions up.
i.e. IPN sends me a txn_id, but I don't have that at my end. I need a way to send a generate & save a unique ID per transaction, that goes to Paypal with the user, and Paypal then sends back to me via IPN.
I'm quite lost in Paypals shoddy docs, so any help from SO would help!
(Off topic rant: why to Paypal have so many domains: paypal.com, paypal-business.com, x.com, paypal-marketing.com,... Can they not spell phishing?!)
Pass YOUR id (like the DB row id) to Paypal with custom variable, you can cross reference it using the custom variable from IPN.
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables

Getting custom data from Paypal

I am creating a simple online paypal commerce and I have some doubts
on how sending data to seller and buyer when order payment is done. The
scenario looks like this:
Each product (legal documents) has a different form because in order to
deliver the product buyer need to specify different information for each
item. Studying Paypal documentation I have learnt that I can add hidden
fields and send them with transaction when I click the Buy Button or Add
To Cart.
When the payment is done:
buyer will receive the confirmation of payment (ok sent by paypal)
seller will receive all necessary information to fill the documents
for each product in one email.
I have noticed using sandbox that buyyer can add note for seller with payment
but unfortunatlly the textarea allow only a limitated text.
Please let me know if I understand correctly. When the payment is done Paypal
send back all data (IPN) to paypal script (including all information sent via
using the form). In that case I should be able to check if the transaction was
completed and if so doing the parser of the reply and send data via email using
PHP to seller. Is it correct?
Does anyone can show me a simple example?
Thanks a lot.
When transaction is complete (subscription,one time web form payment,express checkout or something else ) , Paypal sends authorization query to your IPN script (link to which is defined in your Paypal profile)
The IPN values are described here
https://www.paypalobjects.com/en_US/ebook/subscriptions/Appx-ipn_subscription_variables.html
or here
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables

How do you connect a Paypal IPN confirmation to a user?

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.