PayPal initial_fail_amount_action and max_fail_attempts on recurring payments - paypal

I'm trying to know what is the effect of setting initial_fail_amount_action and max_fail_attempts when you create a recurring payment plan.
First of all I'd like to know how often a retry is executed because in the PayPal documentation does not say nothing about that. For example, if you define a max_fail_attempts to 3, what does it mean? Paypal tries every hour, every day the payment? What is the interval? What is the final status if the whole payments fail? Cancelled or Suspended?
Then, I'd like to know what happen if I set the initial_fail_amount_action to CONTINUE. In the documentation I've found that PayPal add the failed payment amount to the outstanding balance due. What does it mean? Does the subscription remain pending or what is the final status?
Finally, what is the IPN notification do I receive after max_fail_attempts reached?
Thank you so much!
PD: I've added this question on github as well.

Related

PayPal Express Checkout - Webhook PAYMENT.SALE.COMPLETED

I was searching a while and also read the paypal docs but I am unable to find an answer to my question. I created a recurring payment with Paypal Express Checkout. Everything is working fine, but now I need to know a little bit more about webhooks.
Assume a user registered and created a recurring subscription. The set-up fee is 0,00€ and the first payment will be in one week. After the first payment, the billing cycle will be every week. Now about my webhook question: I guess I need to use the PAYMENT.SALE.COMPLETED webhook am I right? As soon as I get paid every week, the PAYMENT.SALE.COMPLETED webhook will fire for every successfull payment and therefore add a new entry inside my database. Am I right? Or do I need to use another webhook for recurring payments?
Is there someone who uses this webhook in combination of a recurring subscription? Would be great if someone can help me out understanding if PAYMENT.SALE.COMPLETED is the correct webhook for recurring subscriptions.
Yes, PAYMENT.SALE.COMPLETED is sent after every successful billing event for a subscription.
Here is an example timeline of a subscription sale on my website:
2021-07-30 13:17:13.143: PAYMENT.SALE.COMPLETED - first payment
2021-07-30 13:17:10.679: BILLING.SUBSCRIPTION.ACTIVATED
2021-07-30 13:16:15.032: BILLING.SUBSCRIPTION.CREATED - this came after the one above, so make sure you can handle that
2021-08-30 11:13:05.321: PAYMENT.SALE.COMPLETED with "state"=>"completed" - second recurring payment
2021-09-08 14:34:44.816: PAYMENT.SALE.COMPLETED with "state"=>"completed","payment_hold_status"=>"RELEASED" - this is the release of the second recurring payment
If the recurring payment fails, you will receive BILLING.SUBSCRIPTION.PAYMENT.FAILED. Paypal retries the payment 3 times. See the attribute next_payment_retry_time which is set to null after the 3rd and final failed payment attempt.
You can configure your billing plan to automatically suspend a subscription after x number of failed payments (note: set this to be 1+ because 0 keeps is always active) and/or automatically add the outstanding payments to the next billing cycling.
Screenshot below:
I don't believe you have any choice for which webhook PayPal will send you. I am fighting with this right now because PAYMENT.SALE.COMPLETED is the one they send me, but it doesn't contain enough data for me to match it up with a customer or a shopping cart. I want them to return CHECKOUT.ORDER.COMPLETED instead, but there doesn't seem to be a way to make that happen.

Paypal recurring payment reattempts: IPN callback flow for failed payments, and subscription cancellation?

I have a bog-standrad Paypal subscription -button installation, with an IPN callback flow. One bleeding point of this setup for the past 24 months has been the instant subscription cancellation upon lack of available funds; which, statistically, happens with moderate frequency in the target market I'm currently selling to.
So, current IPN flow is: subscr_signup -> [Nx] subscr_payment -> subscr_cancel/subscr_failed [terminate subscription].
According to a previous SO question: retry to charge the client if a payment fails:
There is a variable sra when set to 1 , PaYPal will try to collect the payment two more times before canceling the subscription. More information on Recurring Payments Reattempts
I suspect using this would drastically reduce "churn-by-payment-issue" problem, and would like to implement this.
My question is, what is the IPN callback flow for these endgame situations? That is, for "payment failed, will retry", VS "payment failed, subscription terminated" , specifically, what order, and txn_type will be called?
Many thanks.

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.

Does PayPal use the same Transaction ID when Retrying failed payments?

I'm building a recurring/subscription payment system with PayPal and all is going well.
Can anyone share the IPN data for when PayPal sends a retry payment? Specifically I need to know if paypal is going to use the same txn_id, or generate a new one every time it retries?
Appreciate the help!
You should receive a new transaction id everytime a payment is processed. You can test this by setting up a recurring payment in the sandbox, and setting it to bill daily.

What happens when a PayPal subscription is cancelled or fails?

I am thinking about using PayPal to take subscription payments for a website but have a question relating to the process of cancelling and failed payments.
Initial process:
Click subscribe/buy now button
Log into PayPal or enter card details
Review, click confirm
Completion page (with PDT)
3 months and 2 days later and the user logs into PayPal to cancel their subscription (within PayPal instead of using my website).
How is that process or information passed back to my website for cancelled or failed subscription?
I haven't found anything in FAQ, Help or How to and Louise was useless. I hope that someone here can help me...
Manually, I assume we're expected to log in review History and update the website accordingly (every couple of days).
Many thanks,
Simon
You would set up an IPN listener in your PayPal Profile. Once a subscription or recurring payments is charged, skipped, suspended or cancelled, you'll receive an appropriate IPN message at your IPN listener URL.
For IPN sample code and documentation, take a look at https://www.paypal.com/ipn, and for the individual IPN variables, take a look at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables