Pending Paypal IPN - paypal

Paypal IPN request to my callback Pending status.
In my workflow I only save the order after they pass all checking steps as: business email, mc_gross... and the status must be "Completed".
So when I receive a request from Paypal with Pending status, system will not save order into the database.
My question is will Paypal send another request after the order status change to Completed ?

Yes, when a pending transaction updates to Completed (or Failed, or whatever) you will get an additional IPN with the updated details.

Related

PayPal Express Checkout Validating Payment

How can we validate a payment Success/failure using response Token from Paypal in PayPal Express Check Out.
The DoExpressCheckoutPayment response (if Successful) will include a PAYMENTINFO_n_PAYMENTSTATUS parameter that you can check to see if the payment associated with the API call is actually completed or not.
If this param has a value of "Completed" then you know you're good to go. It could be "Pending", though, in cases where an e-check is used for payment, fraud filters flag the transaction, etc.
Because of this it is recommended that you use Instant Payment Notification (IPN) in order to handle all post-transaction processing tasks like updating your database, sending email notifications, etc.
PayPal responds with a message, such as the one shown below. Note the status, which should include ACK set to Success, and a token that is used in subsequent steps.
TIMESTAMP=2007%2d04%2d05T23%3a23%3a07Z
&CORRELATIONID=63cdac0b67b50
&ACK=Success
&VERSION=XX%2e000000
&BUILD=1%2e0006
&TOKEN=EC%2d1NK66318YB717835M
Source

Will i get an IPN on completion of payment review in Paypal?

I am currently working on a project using PayPal. When I made a transaction, the payment status in the IPN received was 'Pending' and reason was Payment review. I found out that it will take 24 hours for the review process. So I want know if I will get an IPN when the review process is over?
You should get an IPN notification when the transaction changes status. For example, PayPal sends you an IPN notifying you of a pending payment. PayPal later sends you a second IPN telling you that the payment has completed.
Because of security reasons you may get the first IPN with payment status pending But when the payment review is over You will get another IPN with payment status as completed.You can can transfer your stuffs then.The payment review will take maximum 24 hours.

IPN payment_status variable

I am using PayPal's IPN service to confirm payment. My listener is checking the payment_status variable hoping to find "Completed". I don't want to do anything in my database unless the payment comes back "Completed". My question is, what if it does not come back with that status? Will PayPal continue to communicate with my listener until it is complete? For example, the status could come back as "Processed", which appears to be a step before "Completed". Below is a link to a document with all of the variables:
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf
On page 10:
Because IPN messages can be sent at various stages in a transaction’s progress, make sure
that the transaction’s payment status is “completed” before enabling shipment of
merchandise or allowing the download of digital media.
So yes, I think PayPal will always give you an IPN with Completed status.

PayPal IPN parameters contain two status fields. Which should I use?

I'm using the PayPal Adaptive Payments API. I have a script that receives the IPN postback when a payment is made. In this script I need to perform validation, including checking that the status of the payment is COMPLETED, as specified by the documentation:
Confirm that the "payment_status" is "Completed," since IPNs are also sent for other results such as "Pending" or "Failed"
The documentation hasn't been updated for Adaptive Payments which use different parameters (not payment_status). The parameters I receive are documented here and there are two status fields:
status
The status of the payment. Possible values are:
CREATED – The payment request was received; funds will be transferred once the payment is approved
COMPLETED – The payment was successful
INCOMPLETE – Some transfers succeeded and some failed for a parallel payment or, for a delayed chained payment, secondary receivers have not been paid
ERROR – The payment failed and all attempted transfers failed or all completed transfers were successfully reversed
REVERSALERROR – One or more transfers failed when attempting to reverse a payment
PROCESSING – The payment is in progress
PENDING – The payment is awaiting processing
and
transaction[n].status
The transaction status, where [n] is a number from 0 to 5. For simple single-receiver payments, this number will be 0. Numbers larger than 0 indicate the payment to a particular receiver in chained and parallel payments.
Possible values are:
Completed
Pending
Refunded
Simply put, I don't know which one I should be using. The payment status or the transaction status?
(I'd place my bets on transaction status but then I don't know what the purpose of the payment status is when you have more than one transaction in a request (when using chained payments, for example). Then again, the payment status has more possible values, so perhaps that's the "overall" status and should be used.)
You would want to look at transaction[n].status, and this would be an array. This is because with adaptive payments, a single transaction can be split into multiple transactions to different merchants.
The status is just saying that the api call went through and completed successfully. It was processed. The transaction[n].status tells you what the status is of each transaction in that call.

PayPal express checkout handling "pending payments" with IPN

I cant find anny clear documentations about this.
If you use paypal express checkout, when a payment is pending what happens next?
Does paypal sends you by IPN an update if the states changes, do you have options?
Let say you do an DoExpressCheckoutPayment (with NVP)
and you get this:
&PAYMENTSTATUS=Pending
&PENDINGREASON= ECHECK //The payment is pending because it was made by an eCheck that has not yet cleared.
&REASONCODE=None
So you've made the payment and you want to wait until its cleared? What should you do next.
Update Some (external documentation) I found only sugest you could use (IPN?) to handle pending payments.
"If the Do Express Checkout Payment PENDINGREASON response is a value
other than none or completed , the payment is pending. Typically,
this means the customer has paid with aneCheck. In such a case, funds
are not guaranteed, and you should not ship or deliver items or
services until the payment has successfully completed. NOTE:
PayPal recommends that you block eChecks as a payment method if you
are unable tohandle pending state payments.To find out the status of a
pending payment, you can:
Submit an Inquiry transaction.
Check the status using PayPal Manager. See PayPal Manager online help
for details."
The paypal sandbox seems to have the option to check IPN messages for the express checkout type. The only correlation (if its ment to be used this way) between the DoExpressCheckoutPayment and the IPN seems you can use the "custom" field to keep track of a pending status. The txn_id (ipn) isn't given in DoExpressCheckoutPayment (nvp). Does any one have any experience with this?
The transaction ID is most certainly given in DoExpressCheckoutPayment, even if the PAYMENTSTATUS=Pending. A pending payment is still a transaction.
So yes, you would be notified via IPN when the transaction is completed. This typically takes a few working days.
Once it has completed, you can correlate the transaction from DoExpressCheckoutPayment to the IPN you will have received via the txn_id in the IPN.
Note: If you want to test a 'Pending' payment in the PayPal Sandbox, simply go to https://developer.paypal.com/ > Test account and click on 'Payment review' for the seller account you're testing with.
Once payment review is enabled on that seller account, any transactions it receives will be in a 'Pending' state.
Simply disable payment review to release the tranasctions afterwards.
I thought i'd add my two pence worth of thoughts to this.
I was getting a pending return status using Express Checkout via the dotNet SDK, according to the doc's and examples I should have been getting an 'approved' status.
I couldn't figure out why but it turned out to be because I was passing through a new currency, in our case 'GBP'. I had to log in as the facilitator sandbox account and decide what to do with the new currency.. convert it or setup a new balance in the currency. Once I did this, and set it as the default action, the pending return status no longer occurred.
hope that helps someone!
One thing not noted here and I haven't found anything else to confirm.. is that Paypal Express API doesn't support passing in the NOTIFYURL with the code. So you have to use the hardcoded IPN url set in your paypal account. This of course causes issues because you need a common callback file that can redirect to the individual payment options.
For example, if you are using Paypal Express AND Paypal Advanced.. Neither of those properly support a notifyurl passed in using the code. Paypal Advanced claims to, but it doesn't seem to work. So there needs to be a common IPN callback file that handles the redirection to each.
Unless someone else can confirm a working notify url for Express Checkout variable that can be passed in the code?