What are all possible scenarios for PayPal's IPN? - paypal

Sadly, PayPal's documentation is woefully inadequate.
What are the possible values for payment_status, and when do they occur?
I am aware of:
Completed - pretty self-explanatory
Pending - eCheque payment that hasn't gone through yet
And... that's it. That's all that's mentioned in the documentation.
But I need to know, what other values exist? What do you get if an eCheque is denied? What about when a client (fraudulently, -mutter mutter-) issues a chargeback against a payment (and rips you off for a few hundred quid -more muttering-), what does IPN send in these cases?
Ultimately I want to automate more of the scenarios that come up. For instance, if a Pending transaction arrives then I want to be able to reliably explain to the client that their eCheque is pending and they will be notified when it clears, and then proceed to notify them when it is indeed cleared (or denied).
Since I deal in virtual currency, I want to be able to debit a user's account automatically if they file a chargeback, but then credit them again if the chargeback is resolved and the funds returned to me.
And I really don't like how there might be other scenarios that I can't prepare for, simply because the documentation is shite.
Anyone got some hands-on experience, or are there any actual devs from PayPal who will honour this call?

Related

Capturing on Paypal with client side script

On the Paypal Basic Integration tutorial it is possible to capture an order client-side which essentially submits the payment to paypal. Once the order is captured, the tutorials shows you how to verify the transaction which would ensure you do not provide a service or product unless the paypal order is verified. However, someone could maliciously capture a payment using the client id and while verification would fail paypal would withdraw the funds from the customer. How can you prevent this? Is this secure?
[UPDATE]
This questions comes mostly out of curiosity and lack of experience with paypal. To put more context into this and hopefully help others; the Paypal basic integration is simply an HTML form and so it doesn't stop anyone from modifying the HTML form and send a different amount for authorization/capture; lets say that the original amount for an order is 100, it is possible that someone changes that amount and submit the authorization with the different amount; at the minimum it would initiate an authorization/capture of this different amount that perhaps is higher. Good practice dictates that the amount and orders should be verified before finalizing the transaction on the backend, but even if the transaction is found to be invalid the funds would have already been put on a "hold" by paypal and possibly on the customers credit card.
This is probably not an issue since, like mentioned, transactions should be verified on the backend; it is also not too obvious( maybe with some social engineering) how someone would benefit from this and most likely would just be an inconvenience.

PayPal subscription doesn't happen

This question is not basic so that means i have read some paypal documentation about this.
I have attached an image. The problem is that i make a Paypal subscription and while its active and stating that the next payment should be done next day, it doesn't happen, what could be the problem? BTW I am using the sandbox
The sandbox tends to get delayed sometimes, and payments don't occur exactly when they should. The production server doesn't have this issue, usually, but it can happen.
From what I can see you've got it setup correctly so it's just a matter of their system kicking in and processing it accordingly. Not a lot you can do it about it other than wait.
You could post a ticket to www.paypal.com/mts, but by the time they respond the payment will probably go through.
You could also call their tech support line, which you can find by logging in to your PayPal account, click Contact Us, then by Phone, and it will give you separate numbers for general and technical support. You can let them know what's going on and they may be able to find what's causing the delay and get it fixed.

How do I deal with PayPal customers who can't direct return

PayPal states:
Note: If you have turned on Auto
Return and have chosen to turn on
PayPal Account Optional for new users,
a new user will not be automatically
directed back to your website, but
will be given the option to return.
But if some of the customers don't get "Auto Returned", how do I handle them programmatically?
Paypal does not guarantee autoreturn especially when Paypal Account - optional setting is on.
The right way to handle the integration is with Instant Payment Notification (IPN) option. Using IPN Paypal will make POSTS to your page notifying you of payment events. The following link explains the IPN process pretty well.
To summarize, you will write code that will trap posts from Paypal and then make sure to update your billing data accordingly.
Also, IPN messages might be slightly delayed.
Create a script (cron or what) that does check for such payments at paypal perodically (e.g. every hour).
Is this what you mean?
https://www.paypal.com/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside
If not, you may need to be a little more specific with your question. Like - are you using paypal pro? How are your customers checking out? etc. And now that I read the answer below mine, I wonder if you are even talking about the payment process and not something else.

PayPal TimeOut - DoExpressCheckoutPayment

We are using PayPal on a faily large website, integration went well with all code helpers from the integration wizard. Now we had processed a number of transactions in the first day of putting this live but a small percentage (5%) essentially had there transaction processed by PayPal but our system recieved a TimeOut. I believe this happens at the point where we submit the "DoExpressCheckoutPayment" Method. and because of this the system cannot tell if the payment has been complete or not.
This is a real tough one, as the website has a live currency that we need to update so paypal taking the money but the system not updating is not acceptable.
I'm interested to know if this is a common problem and how we should go about handeling it. I'm doing my best to re-create the issue but cannot at this time.
This looks like a similar problem - https://www.x.com/thread/45136
Any help would be appriciated!
Add retry logic to your application. This is a common way of handling this problem.
After looking into this in more depth, retry logic is not a good idea as the TimeOut is due to the response (So paypal has most likly credited the account).
Instant Payment Notification (IPN) seems to be the solution.

How to implement payment to multiple suppliers

I'm trying to integrate a payment mechanism to my site. The scenario that I need is not trivial and can be explained by the following example:
User pays upfront for a subscription program (i.e. receiving Netflix). User is able to make changes to the subscription (i.e. change number of movies checked out each time from 4 to 2)
User is able to buy additional one time purchases via the provider's site (Netflix) supplied by 3rd parties. These items (i.e. popcorn, snacks) get billed to the same credit card as the subscription without having to go through the process of resubmitting the credit card information.
Of course, my site takes also a small fee for the transactions :-)
I was wondering if this is supported by PayPal, Google Checkout or someone else.
Thanks.
The Paypal api can handle all of those processes.
I seem to have dropped the ball on what kind of answer you wanted so I'll leave it at that.
If you have some feedback, more direct questions I will try to answer as much as I can
--
The money would best go through you first, unless somehow you can convince your customers its normal to bill them per item. Also if they pay by credit card you should only bill them once as you would incur fees on every payment. I don't know of anyway to bill once but distribute the payments.
As for the paypal docs..
Very good resource, there is also some sample code for most major web languages
Also this will get you started if you don't have a developer login
Their developer support is also pretty good. One thing a lot of people seem to screw up when starting out with the paypal api is not setting the latest version in the configs so don't forget to update that to the latest release. :)
Disclaimer..
Yea I know there is a lot of bad press about paypal and crazy stuff happening, but they do get the job done most of the time, its not my fault the customers love to use it.