Users Automatically Demoted/Stripe Cancellation

Hello,

When a subscriber cancels there monthly subscription there account is automatically being demoted even if they have days remaining on the paid period. Is the fix to just to turn off the Automatic EOT Behavior? That’s the way I am reading it, but not certain that if I do that that the EOT won’t be captured ever because it’s off…thanks for clarification.

Hi J.

When the user cancels the subscription, an EOT time is set. The EOT time is not right then, though, it’s at the end of the current paid period. EOT time is immediate if they get a refund, for example.

It depends on how you configured your EOT behavior… Could you show me a screenshot of your EOT settings? And when the user cancels the subscription, do you see an EOT time set on his profile?

Also, with logging enabled, can you look for the relevant entries from all the log files, when the subscription is cancelled? Can you show me? I’m curious about the EOT time being mentioned there.

I look forward to your update. :slight_smile:

Hi @clavaque I am also experiencing the same problem. A subscriber cancelled a monthly subscription yesterday. Here is the event that was triggered in Stripe. As you can see the “cancel_at” is “1594731253” (07/14/2020)

evt_1Gz4jyAvAK7zTur2EJiOq7lc
customer.subscription.updated
Date
6/28/20, 7:56:30 PM
Source
API
Event data
{
  "object": {
    "id": "sub_HHcHjn3okAlMy1",
    "object": "subscription",
    "application_fee_percent": null,
    "billing_cycle_anchor": 1589547253,
    "billing_thresholds": null,
    "cancel_at": 1594731253,
    "cancel_at_period_end": true,
    "canceled_at": 1593366990,
    "collection_method": "charge_automatically",
    "created": 1589547253,
    "current_period_end": 1594731253,
    "current_period_start": 1592139253,
    "customer": "cus_HBYEW0XAF120D6",
    "days_until_due": null,
    "default_payment_method": null,
    "default_source": null,
    "default_tax_rates": [
    ],
    "discount": null,
    "ended_at": null,
    "items": {
      "object": "list",
      "data": [
        {
          "id": "si_HHcHKoEBLNOQ1a",
          "object": "subscription_item",
          "billing_thresholds": null,
          "created": 1589547253,
          "metadata": {
          },
          "plan": {
            "id": "s2_plan_30a4609e458dcd6ad3e01bb3740f6692",
            "object": "plan",
            "active": true,
            "aggregate_usage": null,
            "amount": 50000,
            "amount_decimal": "50000",
            "billing_scheme": "per_unit",
            "created": 1589547252,
            "currency": "nok",
            "interval": "day",
            "interval_count": 30,
            "livemode": true,
            "metadata": {
              "recurring": "true",
              "recurring_times": "-1"
            },
            "nickname": null,
            "product": "s2_prod_d3431ffa31e2d3ca068423e23e8e6196",
            "tiers": null,
            "tiers_mode": null,
            "transform_usage": null,
            "trial_period_days": null,
            "usage_type": "licensed"
          },
          "price": {
            "id": "s2_plan_30a4609e458dcd6ad3e01bb3740f6692",
            "object": "price",
            "active": true,
            "billing_scheme": "per_unit",
            "created": 1589547252,
            "currency": "nok",
            "livemode": true,
            "lookup_key": null,
            "metadata": {
              "recurring": "true",
              "recurring_times": "-1"
            },
            "nickname": null,
            "product": "s2_prod_d3431ffa31e2d3ca068423e23e8e6196",
            "recurring": {
              "aggregate_usage": null,
              "interval": "day",
              "interval_count": 30,
              "trial_period_days": null,
              "usage_type": "licensed"
            },
            "tiers_mode": null,
            "transform_quantity": null,
            "type": "recurring",
            "unit_amount": 50000,
            "unit_amount_decimal": "50000"
          },
          "quantity": 1,
          "subscription": "sub_HHcHjn3okAlMy1",
          "tax_rates": [
          ]
        }
      ],
      "has_more": false,
      "total_count": 1,
      "url": "/v1/subscription_items?subscription=sub_HHcHjn3okAlMy1"
    },
    "latest_invoice": "in_1GtvM0AvAK7zTur2pa3IBP6q",
    "livemode": true,
    "metadata": {
      "tax_info": "{"tax":"0.00","tax_per":"0%"}"
    },
    "next_pending_invoice_item_invoice": null,
    "pause_collection": null,
    "pending_invoice_item_interval": null,
    "pending_setup_intent": null,
    "pending_update": null,
    "plan": {
      "id": "s2_plan_30a4609e458dcd6ad3e01bb3740f6692",
      "object": "plan",
      "active": true,
      "aggregate_usage": null,
      "amount": 50000,
      "amount_decimal": "50000",
      "billing_scheme": "per_unit",
      "created": 1589547252,
      "currency": "nok",
      "interval": "day",
      "interval_count": 30,
      "livemode": true,
      "metadata": {
        "recurring": "true",
        "recurring_times": "-1"
      },
      "nickname": null,
      "product": "s2_prod_d3431ffa31e2d3ca068423e23e8e6196",
      "tiers": null,
      "tiers_mode": null,
      "transform_usage": null,
      "trial_period_days": null,
      "usage_type": "licensed"
    },
    "quantity": 1,
    "schedule": null,
    "start_date": 1589547253,
    "status": "active",
    "tax_percent": null,
    "transfer_data": null,
    "trial_end": null,
    "trial_start": null
  },
  "previous_attributes": {
    "cancel_at": null,
    "cancel_at_period_end": false,
    "canceled_at": null
  }
}

In s2member the user was denoted to registered member at the time the subscriber cancelled the subscription. Here is from the Administrative notes of the subscriber:

Demoted by s2Member: Sun Jun 28, 2020 6:01 pm UTC
Paid Subscr. ID @ time of demotion: stripe → sub_HHcHjn3okAlMy1

Here is my EOT settings in s2Member

I see this too

This is very strange. I had another Subscriber cancel his subscription today. This time everything is working like it should:

The Stripe Subsription details
image
The Stripe Event


The s2Member EOT for the subscriber is correctly set to the same Date and Time the subscription will cancel in Stripe
image
I will report if there are any further anomalies

1 Like

@hiltennis - Can you do a delta on the one the succeeded and the one that failed. Same product? Same subscription (Stripe created different subscriptions for all variants…coupon, duration, price, discount)? etc. You might see somethiing of significance in a delta analysis.

Sorry Tim. You had me lost at “delta”. You mean compare the two different events? Yes both of these cancelled subscriptions were identical (same product). I will have a look and see what I can find. Thank you for helping out. Much appreciated!

1 Like

You got it :slight_smile:

Delta as in…is there some difference (time of day, day of the week, country of origin for the client, different credit card, etc).

When you have something that works and something comparable that does not work, delta-analysis is one of the techniques used to sort the issue out analytically.

So, for example, VISA has different criteria than Mastercard. Different country of origin may flag a network delay issue that causes a variation in the client / server handshake. Day of the week could reflect an update you made to another plugin that was causing the problem as a side-effect and is no longer causing the side-effect.

If software works and then does not work then something is different or something has changed. The trick is figuring out what that difference is.

1 Like

So another subscriber cancelled today, seem’s like it’s working again. I will leave it like this. If there is another issue I will do the delta thing like you suggested @onepresstech Thx and have a good one!

1 Like

Hi, I’m also seeing this issue, when a customer cancels the stripe subscription they immediately get downgraded despite the fact they should get a future date. I’ll check logs tomorrow, but I wondered if anyone had got to the bottom of it in the meantime?

Ok, so upon checking the logs I can see that Stripe passes the correct EOT for the period end:

  "cancel_at": 1620372279,
  "cancel_at_period_end": true,
  "canceled_at": 1619035886,
  "collection_method": "charge_automatically",
  "created": 1602228279,
  "current_period_end": 1620372279,
  "current_period_start": 1617780279,

However on the IPN gateway log I see this:

Array
(
    [txn_type] => subscr_cancel
    [subscr_cid] => cus_****************
    [subscr_id] => sub_****************
    [custom] => ****************.co.uk
    [period1] => 1 M
    [period3] => 1 M
    [payer_email] => ****************
    [first_name] => **********
    [last_name] => ***********
    [option_name1] => Originating Domain
    [option_selection1] => ****************.co.uk
    [option_name2] => Customer IP Address
    [option_selection2] => *************
    [item_name] => Premium Membership: £4.83 a month (recurring charge for ongoing access)
    [item_number] => 1:monthlystripe
    [period] => 1 M
    [option_name] => Originating Domain
    [option_selection] => ****************.co.uk
    [proxy_verified] => stripe
    [s2member_log] => Array
        (
            [0] => IPN received on: Wed Apr 21, 2021 8:11:28 pm UTC
            [1] => s2Member POST vars verified with a Proxy Key
            [2] => s2Member originating domain (`$_SERVER["HTTP_HOST"]`) validated.
            [3] => s2Member `txn_type` identified as ( `subscr_cancel|recurring_payment_profile_cancel|mp_cancel` ).
            [4] => Auto-EOT Time for this account: Mon Nov 9, 2020 7:24 am UTC
        )

    [subscr_gateway] => stripe
    [subscr_baid] => sub_**************
    [level] => 1
    [ccaps] => monthlystripe
    [ip] => ****************
    [s2member_paypal_proxy] => stripe
    [s2member_paypal_proxy_use] => pro-emails
    [s2member_paypal_proxy_verification] => **********************
)

So for some reason s2 is not reading the period end correctly.

Any ideas?

Hi @clavaque, please can I have some assistance with this? Thanks

Hi Ed.

Hm… I see. Nov 9 is far from May 7. I wonder if it’s the grace time in your settings. What value do you have there? WP Admin > s2member Pro > Stripe Options > Automatic EOT > EOT Grace Time

Hi @clavaque,

Thanks for your response. I do not believe it is my EOT Grace Time that is causing this:

Any other ideas?

Thanks Ed

A diff

Cron related maybe?

@clavaque Any ideas on this one please? It’s causing me a load of manual work. Thanks

I had another unrelated bug caused by the settings s2Member > Restriction Options > Alternative Views. When I changed to this
image
the bug was fixed AND I received a lot of user denoted emails thinking this setting might be related to this bug. Worth checking IMHO

@hiltennis I am not sure I follow? For clarification are you saying you had the same issue as me? And when you changed the Alternative View settings the issue went away?

Seems unlikely, but I guess nothing is impossible!

I reported a bug/conflict between Ultimate FAQ and listing of FAQs and using a shortcode that will list all FAQs in a category and s2member. @clavaque recommended that I should check the “Protect Alternative Views” settings and see if adjusting them would help. After disabling the “Filter ALL Wordpress queries” option leaving the other options enabled the listing of Ultimate FAQs was working again AND I received a bunch of (s2Member / API Notification Email) - EOT/Deletion emails. When looking at one of the subscribers the Stripe “Scheduled to cancel on” is on the 8th of June, but the user was denoted to registered user by s2member at the time the user cancelled the subscription! I can provide detailed logs from Stripe and WP to @clavaque if needed