Simple Membership Plugin › Forums › Simple Membership Plugin › Stripe subscription cancellation only works in sandbox mode
Tagged: subscription cancellation fails
- This topic has 11 replies, 4 voices, and was last updated 6 years, 4 months ago by
admin.
-
AuthorPosts
-
January 10, 2020 at 7:28 pm #19593
Thijzie
ParticipantHello,
I have been using SWPM for a while, and so far it serves me very well!
Recently I ran into a problem where it seems that when a user deletes his profile the corresponding Stripe subscription is NOT automatically cancelled. I tested this in the sandbox, but in sandbox the entire process from subscription creation to subscription cancellation goes fine. When I create a live account and delete the profile the subscription is not cancelled in Stripe though.Some points I noticed / actions I took:
– In my Stripe Log I do not see a cancellation attempt in Live mode, in Sandbox mode I do see a succesful delete in my Stripe log.
– When enabling Debug I do not get any error messages from SWPM at all.
– No Nginx errors are generated
– I tried deactivating all plugins accept SWPM, with the same result.Any hints on what might be the problem?
Any help will be greatly appreciated!January 10, 2020 at 10:22 pm #19594mbrsolution
ModeratorHi, please check the following documentation how-can-i-cancel-a-stripe-subscription-as-a-merchant regarding Stripe cancellations.
Let me know if the above helps you.
January 11, 2020 at 10:20 am #19596Thijzie
ParticipantThank you MBRSolution,
The link in your answer describes how to cancel a subscription manually, or how to use the webhook to cancel a member account after the subscription in Stripe is cancelled. (Stripe -> SWPM)
I want it to work the other way around, when a user deleted their SWPM profile the Stripe subscription has to be canceled. (SWPM -> Stripe) This used to work, and still works in sandbox but not in live mode?
January 12, 2020 at 7:03 pm #19605Thijzie
ParticipantMmmmm, it looks like the error log is working. I just subscribed in the LIVE mode (using my actual Credit Card), and after that immediately deleted my account. I got the following log. It surprises me that the log says the payment was made in sandbox mode, while the account was 100% live, and the user appeared in the live settings of Stripe as well. Anybody has any idea? Is there any way in which I can reset the cache or something?
[01/12/2020 6:54 PM] - SUCCESS: Member registration complete email sent to: XXXXX. From email address value used: XXXXX [01/12/2020 6:54 PM] - SUCCESS: Auto login after registration feature is enabled in settings. Performing auto login for user: XXXXX [01/12/2020 6:54 PM] - SUCCESS: Handling auto login request... [01/12/2020 6:55 PM] - SUCCESS: Attempting to cancel Stripe Subscription sub_XXXXXXXX [01/12/2020 6:55 PM] - SUCCESS: Payment was made in sandbox mode. Using test API key details. [01/12/2020 6:55 PM] - FAILURE: Error occurred during Stripe Subscription cancellation. No such subscription: sub_XXXXXXXX; a similar object exists in live mode, but a test mode key was used to make this request. [01/12/2020 6:55 PM] - FAILURE: Error details: {"code":"resource_missing","doc_url":"https:\/\/stripe.com\/docs\/error-codes\/resource-missing","message":"No such subscription: sub_XXXXXXXX; a similar object exists in live mode, but a test mode key was used to make this request.","param":"id","type":"invalid_request_error"}January 12, 2020 at 9:24 pm #19606mbrsolution
ModeratorHi, thank you for sharing your log file.
[01/12/2020 6:55 PM] – SUCCESS: Payment was made in sandbox mode. Using test API key details.
The above line is telling me that your stripe subscription button is running in sandbox mode. Please check the following instructions create-stripe-subscription-button-membership-payment to make sure you set up the Stripe subscription button to run in live mode.
Thank you
January 13, 2020 at 5:37 am #19608admin
KeymasterThis issue usually happens when the plan you created in your stripe account was in sandbox mode and then it was hooked to a payment button that is in live mode (or vice versa).
Create a brand new stripe subscription plan in LIVE mode. Make sure you are viewing live data in your Stripe account. Then hook that plan to a payment button you create inside the plugin (in live mode). Do a subscription and cancellation after that.
January 15, 2020 at 7:34 pm #19623Thijzie
ParticipantMmm, I tried the steps but this does not resolve the issue. The thing is that when I register an account (without sandbox in SWPM) I see my subscription in the Stripe Live mode. The error appears when trying to delete the same account. Is it possible that registering and deleting of the same membership are linked to different modes (live and test)?
January 18, 2020 at 5:09 pm #19634benbois
ParticipantHi,
I got an identical problem.
The cancellation process running perfectly well in TEST mode but it is KO in LIVE mode.
The clients subscription is never cancelled in LIVE mode, I have to do it manually!
It worked well with the old stripe API (not SCA) but since then not at all.
Of course, I checked the API keys for the LIVE mode, it’s correct.Any idea appreciate!
January 19, 2020 at 12:24 am #19635mbrsolution
ModeratorHi @benbois, are you running the latest version 3.9.5?
January 19, 2020 at 8:52 am #19640benbois
ParticipantYes I do!
January 19, 2020 at 4:43 pm #19641Thijzie
ParticipantI run the latest version of SWPM as well (My wordpress does not suggest any possible update). Again the account is created in LIVE mode, but the cancellation does not work. I tested it myself, and the money is actually withdrawn from my Credit Card, but when I cancel it does NOT work, and it throws the error as in the log. I know the log says it was in test mode, but I am 100% sure I setup everything correct live. It actually used to work fine a couple of weeks ago, but for some reason it stopped working…..
January 20, 2020 at 2:02 am #19642admin
KeymasterI tested this myself to make sure everything with the current version of Stripe and our plugin is working fine. Something somewhere on your site has gotten messed up. This is a site specific issue so I don’t really have a specific answer for it. It is beyond the scope of this free support to delve into the specific site setup related conflict/issues.
It is worth doing the following:
#) Make sure the version of the plugin that you are using right now is v3.9.5 (you can check it from the plugins menu of your admin dashboard).
#) Go to the settings menu of the plugin and make sure the sandbox option is turned OFF (so the plugin is set to live mode).
#) Create a new payment button everything being in live mode (both the plugin and the Stripe account). Then test with that payment button to see if you still get the error. -
AuthorPosts
- You must be logged in to reply to this topic.