Correct paypal IPN variable for suspended subscriptions
Asked Answered
F

1

7

If a paying monthly subscriber has a credit card that expires, and paypal failed three times in trying to get the funds, then they are "suspended" by paypal. I'm trying to update my PHP script so that the correct change will happen in the database in this situation. I've studied the paypal documentation and can't find a clear answer on what IPN variable I should be using once a user's account has been suspended.

Does anyone know which of the following is the correct variable and value to use?

if ($payment_status == "suspended" || $txn_type == "suspended" || $txn_type == "subscr_failed" || $profile_status == "suspended") {

Thanks!

Fourwheeler answered 12/10, 2012 at 20:26 Comment(0)
H
6

I've been getting $txn_type == "recurring_payment_suspended_due_to_max_failed_payment", also note that instead of $subscr_id you'll have a $recurring_payment_id instead. At least thats what happens when I simulate failed payments in the Paypal Sandbox.

Hallux answered 31/10, 2012 at 19:9 Comment(3)
Yeah Paypal documentation is a bit of a joke. I've been on the phone to one of their support personal who told me that after 2 payment failures the subscription would be cancelled. Of course it wasn't. After 3 failures the subscription was instead suspended and looking at my logs I found the 'recurring_payment_suspended_due_to_max_failed_payment' status as the only indication of this.Accost
The guy who designed the 'recurring_payment_suspended_due_to_max_failed_payment' IPN should be fired. It's totally different than all the other IPNs, starting with this ridiculous txn_type, then it's missing the business parameter, and the renamed recurring_payment_id. I mean wtf was this developer thinking?Weapon
Already calling the transaction type recurring_payment_suspended_due_to_max_failed_payment is a good indicator that something is going wrong here 😀Brachial

© 2022 - 2024 — McMap. All rights reserved.