If a member’s credit card has expired and they do not update it in PayPal, after three attempts to take the money, the PayPal subscription is suspended, s2Member is sent a recurring_payment_suspended_due_to_max_failed_payment IPN, and the member should be automatically downgraded.
However this is no longer happening, apparently because s2Member cannot identify the member which the payment failure IPN relates to. I believe this may be due to some recent PayPal changes with subscription IDs.
Below is an anonymised example of a final payment failure message from gateway-core-ipn.log
LOG ENTRY: Sun Jan 13th, 2019 @ precisely 3:08 pm UTC
PHP v5.6.39-0 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 31.76 MB :: Real Memory 32.52 MB :: Peak Memory 32.11 MB :: Real Peak Memory 32.52 MB
www.xxxxx.com/?s2member_paypal_notify=1
User-Agent: PayPal IPN ( https://www.paypal.com/ipn )
Array
(
[payment_cycle] => Yearly
[txn_type] => recurring_payment_suspended_due_to_max_failed_payment
[last_name] => xxxxx
[next_payment_date] => N/A
[residence_country] => GB
[initial_payment_amount] => 0.00
[rp_invoice_id] => xxxxxxxxxxxxx~xxx.xxx.xxx.xxx
[currency_code] => GBP
[time_created] => 12:51:57 Jan 01, 2017 PST
[verify_sign] => x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[period_type] => Regular
[payer_status] => verified
[tax] => 0.00
[payer_email] => xxxxxxxxxxxxxxx@xxxxxxxxxxxxxx.com
[first_name] => xxxxx
[receiver_email] => member@xxxxx.com
[payer_id] => xxxxxxxxxxxxx
[product_type] => 1
[shipping] => 0.00
[amount_per_cycle] => 80.00
[profile_status] => Suspended
[custom] => www.xxxxx.com
[charset] => windows-1252
[notify_version] => 3.9
[amount] => 80.00
[outstanding_balance] => 80.00
[recurring_payment_id] => I-xxxxxxxxxxxx
[product_name] => Member - RENEW
[ipn_track_id] => xxnnnxnxnxnnn
[s2member_log] => Array
(
[0] => IPN received on: Sun Jan 13, 2019 3:08:17 pm UTC
[1] => s2Member POST vars verified through a POST back to PayPal.
[2] => s2Member originating domain (`$_SERVER["HTTP_HOST"]`) validated.
[3] => s2Member `txn_type` identified as ( `subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment` ) - or - `recurring_payment_profile_cancel` w/ `initial_payment_status` ( `failed` ).
[4] => Sleeping for 15 seconds. Waiting for a possible ( `subscr_signup|subscr_modify|recurring_payment_profile_created` ).
[5] => Awake. It's Sun Jan 13, 2019 3:08:32 pm UTC. s2Member `txn_type` identified as ( `subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment` ) - or - `recurring_payment_profile_cancel` w/ `initial_payment_status` ( `failed` ).
[6] => Unable to (demote|delete) Member. Could not get the existing User ID from the DB. It's possible that it was ALREADY processed through another IPN, removed manually by a Site Administrator, or by s2Member's Auto-EOT Sys.
)
[subscr_gateway] => paypal
[subscr_id] => I-xxxxxxxxxxxx
[period1] => 0 D
[period3] => 1 D
[item_number] => 1
[item_name] => Member - RENEW
[subscr_baid] => I-xxxxxxxxxxxx
[subscr_cid] => I-xxxxxxxxxxxx
[ip] =>
[currency] =>
[currency_symbol] => $
)