PayPal BAID mp_status is not clear and doesn't seem documented - paypal

When setting up a PayPal reference transaction, I receive via the IPN (txn_type=mp_signup) a status code called mp_status. I assume that this is the approval code, but there doesn't seem to be any documentation on this code.
My specific code is mp_status=0.
The documentation that does exist states that mp_status is:
The agreement status. Possible values are A for an active agreement
and I for an inactive agreement (equivalent to canceled).
As you can see the mp_status that I received is not covered in this blurb. I assume that this means a failed signup, since the value is not "A", payments being a zero-sum game. This is assumption is possibly contradicted by another value in the post reason_code=mp_2001, which thanks to this SO post, I know is the successful creation of a billing agreement.
Given these values from the PayPal IPN, what is the status of this reference transaction? Has a recurring billing (BAID) agreement been created?

That mp_status does not appear to indicate anything out of the ordinary; I would ignore it unless you find either a documented or empirical reason to pay attention to it

Related

What variables should be checked in IPN POST requests after a successful payment has been confirmed?

I have developed the IPN listener side of a PayPal-enabled website which records user subscriptions. Currently when I am interested for a successful transaction I look for the payment_status variable, ensuring that payment_status == "Completed", but as can be clearly noted in the PayPal IPN variables reference, there's lots of them and I can't say whether I'm overlooking some.
So, in the end, my questions are:
Is a payment transaction considered successful if and only if payment_status == "Completed", or is there any other variable that can determine it?
Are there any other important or common states associated with a payment transaction that is worth considering?
Have a look at all the sample code they provide. You will see that they go to a lot of trouble to make sure that the product being bought actually exists, and that the price is correct for the way they bought it (buy it now, subscription, trial period, ...).
Basically you cannot assume that the original transaction that gave rise to the IPN was not forged somehow. It's easy.

paypal IPN - how to know when money has moved?

I'm using a basic HTML form to call PayPal (webscr) and I am successfully getting IPN callbacks.
There is plenty of documentation about the contents of each individual variable that can be returned in an IPN. There is something important missing, or else I have missed it:
What paypal transaction types and payment statuses reflect actual changes in my account balance? For example, a "Completed" status certainly does, and a "Pending" status certainly does not.
However, there appear to be five or six relevant transaction types and eleven different payment statuses possible. Other than trying all 55 or 66 combinations in the IPN simulator, is there any document that clearly shows for which ones I should accumulate the mc_gross amount?
Or to put it another way, some IPN messages are just "in case I need to know", and some mean "money has changed hands; adjust your accounts accordingly". It's not clear to me which combinations of transaction type and payment status indicate the latter.
Thanks and Best Regards,

Payment status remains "Pending"

I integrated PayPal in my web shop in order to allow instant payments with automatic product delivery (already had this before but only with instant wire transfers via sofort.com). I integrated it with the help of the example provided by PayPal (I'm using ReviewOrder.php, GetExpressCheckoutDetails and DoExpressCheckoutPayment).
It's working great if they pay with PayPal balance or a linked credit card. However, some customers from Germany don't have balance in their accounts but only a bank account linked to their account. The payments go through and they receive their product, however I noticed the payment status would remain "Pending" for 1 month and change to "Expired" afterwards, so effectively no money arrives.
Why is this happening? Or is there any way to deny such payments? (Payments from backup funds)
Any help would be appreciated.
Its hare to day with out looking at the transaction specifically. But there are several things that can cause your payment to be pending, such as your preferences that you may have set in the account. Check to make sure you dont have your preferences set to ask me before accepting a payment in a currency that you do not hold. Did the buyer pay with an eCheck? If so, it could be waiting for the payment to clear. If this is in the sandbox, you have to manually clear the payment. If you are still not able to determine the cause of the pending payment, if you provide the transaction id, I will check it on my end.
Hey guys I managed to find a solution to this odd problem after all.
It turned out I had the following code in my implementation where I actually initialized the payment process:
$_REQUEST['paymentType'] = "Order";
This was a mistake though, since this payment type won't place a hold on the funds and if the DoCapture call is never called this payment will remain pending for about one month and then expire entirely (as described in my question, so this is what actually happened to me). The bad thing is that it's impossible for such payments to even accept them manually from within PayPal (not even the local PayPal phone support was able/wanted to accept these payments for unknown reasons because they told me they'd come up with a solution and contact me via Email within 24 hours but they never did).
So in order to fix this issue I changed the payment type to Sale which instantly captures the payment rather than waiting for sort of approval or a capture call. It worked fine for two weeks now and I think I'll leave it like this now.
$_REQUEST['paymentType'] = "Sale";
I lost about 110€ because this stupidly trivial detail but at least it's working fine now and I was able to re-enable PayPal as a payment form. I hope they'll at least add an option to manually accept these payments if the DoCapture call was not implemented because it worked fine without it for most of the payments as well and after all this is still about real money, so this absolutely would be an essential thing to have....
This can happen also if you are trying to accept a payment in a different currency of your account. To avoid that you must create a "PayPal balance" in the currency of the payment.
IPN is also giving hints on the pending reason in this case:
[pending_reason] => multi_currency

What does payment status "EXPIRED" in PayPal Adaptive Payments mean?

I have several PayPal Adaptive payments with an "EXPIRED" status (in an application that accepts payments on behalf of a seller). They are explicitly approved payments, meaning money changes hands as soon as the sender accepts the payment.
The documentation for the PaymentDetails API call doesn't mention EXPIRED in the list of possible statuses.
Could you direct me to some other documentation or explain what this status means?
Some more googling brought up this forum thread:
A status of expired means that a PayKey has expired and cannot be used. A PayKey has a life of three hours, after which it cannot be used to complete the payment.
If this occurs you will need to generate a new PayKey with a new trackingID using the Pay API call as you did previously. The reason the tracking ID is not released back and allowed to be used again is because it would cause issues with dublicate tracking ID's in yours and our system.
So, an EXPIRED Adaptive Payment is one that has been created but never paid, so you can safely create a duplicate new one instead.

PayPal - Unattended charges

Well, I didn't really know how to call this...
I have been surfing PayPal's developer documentation for a while now, but there is nothing that speaks to me with direction as to achieving what I am looking for.
It's probably well documented, but I don't grasp it well enough yet to make sense while reading each part separately.
I have read about Preapproval, though it seem to require that I send the customer's browser to the designated PayPal address.
I have thought about creating a database with credit card information, but that is too scary -- so I am looking to see if there is a way for a customer to allow me to do unattended charges to their PayPal account, much like I would be able to do if I had a database with customer credit card information.
Any direction would be appreciated.
Yes, this is possible. There are two options:
PayPal Express Checkout with a Billing Agreement
This works similarly to Preapprovals (which is Adaptive Payments, a different set of API's). You would need to redirect the buyer to PayPal in order to accept the billing agreement, and from then on you can bill the user using to DoReferenceTransaction API.
PayPal DoDirectPayment (Website Payments Pro) with Reference Transactions
You would need to have an existing transaction, and instead of a billing agreement ID, you would submit a prior transaction ID to the DoReferenceTransaction API. You can then re-bill the user on the card details which are stored with PayPal (up to 1 year. assuming the card details are still valid).
Do note that both options require you having access to the DoReferenceTransaction API, which you will not have access to by default.
For further information on the API itself, see https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_DoReferenceTransaction
Important: You will need to call in to get Billing Agreements activated. Good luck finding someone that knows what you need (no really) :-)
You will eventually find someone who knows what DoReferenceTransaction is and then once you've finally found them they'll probably tell you they can only activate it in the sand box and transfer you to someone in the Business Office. They'll have to then submit it to approval with someone else. Est. Total call time 59 minutes 8 seconds.
The guy I just spoke with said he's probably handled only 2 call in a year about DoReferenceTransaction - so you may need to ask around. They have other subscription billing and that's not what you want.
Also realize that approval is not instant and you may need to have established history. The guy who helped me said this is the best number
888 215 5506. Be sure to explain why you need them carefully and try to reassure them you're legitimate. A reputable website behind the domain for your paypal email will probably help.
Good news: I applied for Reference Transactions Friday and was approved today (Sunday). This was for two accounts - one which had only been established the day before.
Thank you for contacting us about enabling reference transactions on
your PayPal account.
I am pleased to inform you that your request has been approved. You
can begin using this feature immediately.
If you have further questions regarding this email, please contact a
Merchant Services Specialist at 1-888-221-1161.
Sincerely,
AJ Merchant Risk Operations
I was trying to do this recently and I found this question with no luck because the Express Checkout with a Billing Agreement method is deprecated since January 1, 2017.
There is a new REST method called Vault payment methods that recently entered open beta and it's not in the official documentation (to this date), so I leave the link to Create transactions when your buyer isn't present, in case someone needs it.
The process it's explained in the documentation but basically, you need to create a payment token (the source can be a PayPal account or a credit card), and then use that token to capture the payment.