Answer the question
In order to leave comments, you need to log in
Canceling a PayPal payment with an incorrect IPN?
For the first time I am implementing a payment through paypal, the scheme is as follows (accounts of the seller and the buyer are on developer.paypal.com)
- the form with payment data (hidden fields) is sent to paypal
- a post request is returned from it, which I must check with the database and send by post back to him.
And here is the most interesting thing, if the reconciliation was unsuccessful, paypal returns INVALID, but nevertheless, it still makes the payment. How in this case to cancel it immediately and is it possible at all?
When writing, I was guided by this article
. Well, if the solution is not at all successful, I would like to know more correct ones :)
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
You send data back to PayPal (more precisely, a hash from them, as far as I remember) to verify that PayPal really sent them.
That is, INVALID means that PayPal did not send you such a request (well, or you sent the verification request incorrectly).
According to the logic of things, such requests should be ignored - it is understood that it is the attackers who forge the payment confirmation.
If the payment failed, then information about this will be contained in the post-request from PayPal (and the request itself must be valid).
Implemented on this example.
Checking the correctness of the payment with the article - file payment_success.php
phpclub.ru/detail/article/paypal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question