PayPal Adaptive Payments: transactionStatus vs senderTransactionStatus - paypal

I am using PayPal adaptive payments. I am retrieving PaymentDetails details here https://developer.paypal.com/docs/classic/api/adaptive-payments/PaymentDetails_API_Operation/
What isn't clear to me is the difference between senderTransactionStatus and transactionStatus?
What's even more strange is I can have the following scenario:
status: COMPLETED
paymentInfoList.paymentInfo.transactionStatus: null
paymentInfoList.paymentInfo.senderTransactionStatus: PENDING
paymentInfoList.paymentInfo.pendingReason: SOME REASON
How can it be that status is COMPLETE, but senderTransactionStatus is PENDING, and transactionStatus if null?
I have no idea which status I should use, or even how to use them in combination to report correct status back to my users.
Ive read the documentation, but still none the wiser.

status has to do with the payment being submitted. This will show completed as long as the payment has moved into processing (ie; funds are moving or pending move and the transaction was not declined).
senderTransactionStatus has to do with the funds leaving the senders account. It would show completed if it is an INSTANT payment (that completed): creditcard, instant transfer, balance transfer. Pending would show if the funds are on hold because of eCheck, Sending Limits, Risk Review, etc. There are a list of pendingReasons on the PaymentDetails API page. OTHER may mean something that is not disclosed to either party due to privacy policy: it could be compliance related, Remittance Transfer Rule, etc.
transactionStatus should be completed once the receiver has the funds in their account. Though, this can change depending on what is happening with the transaction. IE: refunds, holds because of chargebacks, reversals due to risk or unauthorized account access. Edit: This will be NULL if the email address of the receiver is NOT VALID. pendingReason will say UNILATERAL because this email address does not exist in the system and is UNCLAIMED
If the transactionStatus is not NULL, it and senderTransactionStatus will always be the same. This includes being pending for Payment Review, Manually accepting currency, eCheck, Instant Bank Transfer. Everything.

Related

Why would PayPal's IPN return the status as 'Completed' when it's on hold?

I'm using Express Checkout, and the response from DoExpressCheckout returns the following parameters:
PAYMENTINFO_0_PAYMENTTYPE = INSTANT
PAYMENTINFO_0_PAYMENTSTATUS = COMPLETED_FUNDS_HELD
PENDINGREASON = NONE
REASONCODE = NONE
HOLDDECISION = PAYMENTHOLD
However, the IPN that's sent along doesn't make any reference to the funds being held. The payment_status is set as Completed and there's no mention of a parameter that might signify an issue in the documentation for the IPN values.
How can I ensure that I only react once the payment has been taken out of review, and is no longer being held?
(Note: I need to resolve how to handle this in the IPN, not the underlying problem with the account, as this is a historical issue that I need to prevent from happening again for any reason)
IPN are showing the transaction status during the time it was happen, in your case, the payment are done, completed which means, the money was initiated from the buyer account into your account, but due to some issues/reasons the transfer of the said money was pending. Some security check has caused the transaction funds being held
In IPN payment status, it was showing that COMPLETED_FUNDS_HELD which means there is a money come into your account but then it was held due to some reason where only PayPal knows.
This payment will be release in a few days, and until that time, if you handling the payment carefully from your website dashboard order, it shouldn't be any issue because normally PayPal only hold it for a few days.
Until this time, I written this, PayPal hasn't got any solution for this type of held because it was an account related issue where IPN are not feed to the get the update.

Get status of Paypal NVP correlationid

I have a transaction with "Correlationid" with Paypal's Express Checkout NVP API. How can I get the details for this correlationid as to whether the transaction was completed or denied?
The CorrelationID is pretty much useless as the transactionID is used in reference lookup such as this. The best solution here to do is run the GETTRANSACTIONDETAILS API call for Express Checkout using the:
PAYMENTSTATUS Status of the payment.
It is one of the following values:
None — No status
Canceled-Reversal — A reversal has been canceled, for example, when you win a dispute and the funds for the reversal have been returned to you.
Completed — The payment has been completed, and the funds have been added successfully to your account balance.
Denied — You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the PendingReason element.
Expired — The authorization period for this payment has been reached.
Failed — The payment has failed. This happens only if the payment was made from your buyer's bank account.
In-Progress — The transaction has not terminated, for example, an authorization may be awaiting completion.
Partially-Refunded — The payment has been partially refunded.
Pending — The payment is pending. See the PendingReason field for more information.
Refunded — You refunded the payment.
Reversed — A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element.
Processed — A payment has been accepted.
Voided — An authorization for this transaction has been voided.
Here is a document to assist you with this call and parameters:
GetTransactionsDetails API

Handling Paypal payment status 'Completed-Funds-Held' with time-sensitive goods

Good morning, I'm working with DoExpressCheckout's Payment Status response for an InstantPaymentOnly Sale.
https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_NVP/
By PAYMENTINFO_n_PAYMENTSTATUS all possible responses are shown, Completed-Funds-Held is the latest addition.
I'm providing a service that expires and must be used by a certain time. If the payments final status is not known by the time the service must start, its looks like we're going to have to collect payment (again) in person and refund the online payment. Needless to say, that doesn't sound good.
Q. Could Completed-Funds-Held result in funds never being deposited to the main balance?
The documentation for that particular status lists two possible response codes that go along with Completed-Funds-Held: newsellerpaymenthold (not applicable in my case) and paymenthold which vaguely states "A hold is placed on the merchant's transaction for a reason not listed."
Basically is Completed-Funds-Held a "successful" transaction where the purchaser can receive his product without risk of the seller never receiving payment?
EDIT: Is Completed-Funds-Held a final status if the payment is successful? Or will a Completed IPN request come if and when the hold is settled?
Those payments will eventually become available. What you should do is setup an IPN solution so that you can automatically update your system when a payment hold is released. The same would be true for things like e-checks where the payment status is simply pending and then clears a few days later.

When to stop querying paypal api's for payment status?

Using the parallel payments paypal api. If user 1 makes a payment to user 2, I make a check using the api to make sure paypal returns the payment details as COMPLETED.
How long does paypal keep that COMPLETED payment record? Do they keep it indefinitely, or do they delete it after a while? I ask because I am at the stage of development where I need to decide if I should rely on paypal keeping that record indefinitely, or if I should create a record on my server that the payment has been completed, or if I should always check if the payment has been marked as COMPLETED by querying paypal?
The only reason why I "want" to check via paypal, is if the payment is ever returned to user1 as REFUNDED or PARITALLY_REFUNDED when paypal is queried using their apis. I would want to act accordingly in such situations.
It's not too much of an issue if the status is REFUNDED or PARTIALLY_REFUNDED as apparently people can't get refunds if they don't open a case with paypal before 45 days are up. I am more concerned about the REVERSED status, which can apparently happen any time, even after 45 days which is beyond paypal's control, as it is done by the credit card companies, if the user pays by credit card...
Using the PaymentDetails request I was able to pull my oldest Adaptive Payment transaction, which was over 60 days old and had no problems pulling it up using the transactionId field. It should be able to pull up payments as long as they are listed in the PayPal account (currently forever.)
This will work using the payKey field also if you are storing that instead of transactionId, however the transactionId is displayed in your PayPal account and is sent with IPN responses.

Moving payments beyond pending

I am new to paypal and using a developer account at https://developer.paypal.com/.
I am submitting a product via my shopping cart to my developer paypal account where I am making the necessary payment. However, back at my website, the payment status is labelled pending.
How can I transition the status beyond pending to complete or rejected (as the case may be)?
You can use IPN to update your shopping cart, and move the payment from pending to completed. Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction.