Simple Membership Plugin › Forums › Simple Membership Plugin › Issues with Stripe Support/Canceling Accounts
- This topic has 7 replies, 2 voices, and was last updated 2 years, 6 months ago by
admin.
-
AuthorPosts
-
March 11, 2024 at 6:30 am #27788
openartist
ParticipantThere doesn’t appear to be a way for a user to cancel their subscription manually (only tested wit Stripe), there’s nothing I could find in documentation. What would be an easy way to add a link that allows this functionality WITHOUT deleting the account? ie downgrades to free and cancels the subscription.
March 11, 2024 at 9:04 am #27789admin
KeymasterTry the following shortcode on a page:
[swpm_stripe_subscription_cancel_link]
Logged-in members should be able to click on the button created by this shortcode to cancel a Stripe subscription.
This shortcode needs some improvements (it is on our wishlist to improve it). We are somewhat overwhelmed at the moment with the various new PayPal API related changes/work. So the Stripe stuff will have to wait a while.
March 11, 2024 at 5:02 pm #27795openartist
ParticipantHey there,
Thanks, I just tested and have some notes:
1) The button works but should only appear if a user has an active subscription, I put it within some shortcodes to hide from any user that doesn’t have that subscription level.
2) This is the biggest issue: if a user clicks it they will be logged out and have their account made inactive. This basically reproduces the Delete Account link. Here’s the expected behavior: A user’s subscription is canceled (with either a confirmation message or a screen refresh that shows the state change), and they are reverted to whatever the “free” membership level is. Finally, they remain logged in and their account remains active.I might try and add this functionality in myself. Can you give me any insights into how this is handled within the code?
I
March 11, 2024 at 7:51 pm #27796openartist
ParticipantI tried creating a plugin to resolve this but I’m getting a fatal error. If you have any spare time here’s the repo: https://github.com/openartist/swpm-cancel-stripe-subscription
March 12, 2024 at 10:24 pm #27801openartist
ParticipantIn case you don’t mind taking a look, I’ve been trying to get a plugin to work that addresses this issue. It’s meant to cancel the subscription and downgrade the user to a free plan if available or make their account inactive if not: https://github.com/openartist/swpm-cancel-stripe-subscription
I found a bug with you current button, if the user cancels their account is made inactive and they can’t actually log out.
March 13, 2024 at 12:18 am #27802admin
KeymasterThe membership level’s duration configuration also needs to be factored in. If you are using the “No Expiry” until cancelled then it will deactivate the account as soon as cancelled. If you are using a duration expiry value then it shouldn’t deactivate the account immediately (at least that’s how it should work).
What is your membership level’s current setup?
The custom plugin you created looks good. Which line of code are you having issues with?
March 13, 2024 at 3:57 pm #27804openartist
ParticipantThe issue I’m having is the plugin is causing a fatal error, I’m not sure why, could be a conflict with the original plugin, I also had to dig around the code to make sure I was getting the right Stripe hooks, there may be some that are incorrect, and then at the end I’m not properly making the account inactive.
March 15, 2024 at 4:28 am #27813admin
KeymasterCan you post the fatal error that are receiving?
-
AuthorPosts
- You must be logged in to reply to this topic.