Members not being successfully downgraded when subscription is refunded in Stripe

Hi there, I am having an issue where if an admin cancels and refunds a membership in Stripe, the user’s membership still exists. The account is not downgraded.

From reviewing the debugging logs, it seems to be correctly sending to s2member the event ‘customer.subscription.deleted’.

but s2Member says: ‘[0] => Ignoring this Webhook/IPN. The event does NOT require any action on the part of s2Member.’

Any ideas? On renewing my settings, I can confirm that Full Refunds, Partial Refunds, and Reversals all trigger an immediate EOT action.

1 Like

That’s an odd behavior.

Does the user whose subscription was ended, have in his wordpress account the correct subscription ID? If it’s missing or doesn’t match, s2 would skip the notification.

Could you please share more from the logs? At least a full log entry? (change sensitive details, of course) Thanks!

:slight_smile:

1 Like

Sure thing, here are all the relevant logs. It’s possible I overly redacted since I’m not 100% sure what is and isn’t usable by a bad actor… Let me know if you need to know more.

stripe IPN log.txt.zip (11.1 KB)

I can confirm that the correct subscription ID is there. The only thing I can think of is that I had just manually updated it-- not sure if that takes time to sync?

Thanks for the log. Could you show me also the gateway-core-ipn.log one if you have it?

But this one shows me that there are a couple of webhooks that s2 would normally use, but it still ignored: customer.subscription.deleted, charge.refunded.

Did those subscriptions get created with s2’s Stripe pro-form, or some other way?

Could you enable the fallback option for the IPN Signup Vars? Let’s see if that’s where the issue is. WP admin > s2member Pro > Stripe Options > Stripe Webhook/IPN Integration > Enable Fallback for Missing User “IPN Signup Vars”? (beta)

:slight_smile:

Cristian- this subscription was created outside of s2member. When testing again with a subscription created within s2Member, it worked this time. Not sure what the issue was but I’m glad it’s working now!

Ah ok! Well, that may be the reason…

s2Member will normally only act on notifications for subscriptions created by s2 on that site. If it comes with a different domain saved, or a subscription ID that s2 can’t find, it’ll skip it.

I’ve added a setting in the Stripe options (but it’s actually global), that’ll use a fall-back when the signup variables are missing for that user (those are saved when he subscribes through s2Member, and subscriptions created elsewhere would not add those to the user on your site).

I will also be adding an option to bypass the domain validation check, so it’ll be easier to have s2 act on these notifications as long as it can find a user with that subscr_id in his profile.

:slight_smile:

1 Like

Gotcha, I understand. For curiosity, if a user cancels their subscription within s2member, even if their subscription was not created with s2Member, would there be issues there?

1 Like

Normally s2Member would not work with subscriptions it didn’t create itself, but while looking at bypassing the domain check, I didn’t find one for cancellations. I haven’t tested this myself, but you can give it a try with a test subscription and see how it goes.

:slight_smile:

1 Like