If I cancel subscription then subscribe again, it shows an error message

About stripe payment, if I cancel the subscription then subscribe again, it will show an error message:
Customer XYZ does not have a subscription with ID XYZ and even if I change test credit card I still can not subscribe again.

  • Katya Tsihotska

    Hello leoventans,

    We had reports about the same issue, so this bug is already reported to our developers ame they are investigating it. I will add your thread to the task and when we will know more I'll get back to you.

    Please keep in mind, our developers work round the clock and they have to deal with lots of critical issues and other things. So it may take a little while for them to check this and release a fix. I appreciate your patience!

    Best regards,
    Katya

  • Katya Tsihotska

    Hi leoventans

    To fix this issue you should go to the /wp-content/plugins/pro-sites/pro-sites-files/gateways folder and find there file gateway-stripe.php. There you'd need to find the following function (should be at the 3321 line):
    public static function get_blog_subscription_expiry

    Add the following code right above the try{}catch{} block:

    global $psts;
    $expired = ( $psts->get_expire( $blog_id ) < time() ) ? true : false;
    if ( $expired && ( 1 == get_blog_option( $blog_id, 'psts_stripe_canceled') || get_blog_option( $blog_id, 'psts_withdrawn') == 0 )){
    	return '';
    }

    Should be something like this:

    More explanation about the issue you can find in the following post:
    https://premium.wpmudev.org/forums/topic/improvement-suggestion-in-pro-sites#post-1272442

    Hope it helps! Please feel free to ask more questions if you have any.

    Kind regards,
    Katya

  • Katya Tsihotska

    Hi leoventans

    it's still not working.

    If I cancel and re-subscript, it will show "Customer cus_BKwFQA0KUxHLcV does not have a subscription with ID sub_BKwFojmT8ZMa8w".

    Did i miss anything?

    I've pinged our SLS team again, they should take a closer look and get back to you with the answer as soon as it will be possible. But keep in mind that they are dealing with more complex tickets, so it may take a little longer for them to reply here. Thank you for your patience while we look into this further.

    BTW what is "Checkout Using Existing Credit Card" doing?

    It means that you can use the credit card that you've already used before for checkout on this site.

    If you have any additional questions please let me know and I’ll be happy to help.

    Kind regards,
    Katya

  • Mahlamusa

    Hello leoventans,

    I hope you are doing great today. Thank you so much for your patience while we were looking into this. I am sorry for the inconveniences you are having with regards to this issue.

    I have tried to replicate this issue on my test site using Stripe and PayPal on the latest and second latest version of Pro Sites. Here is what I found:

    1. With PayPal, the cancellation was not working when the member was on a Trial subscription. This has been fixed in the latest version.

    2. With Stripe, I can cancel the subscription but when I return to the Pro Site upgrade page I see the following message:

    Basically, what the above says is that I should continue to have access because I have already paid for the current term. I subscribed today and cancelled today which means I still have 31 day which I already paid for so it won't allow me to pay for the blog I already paid for. So at this point I will not be able to re-subscribe for the current blog.

    It gives me an option to "Sign up for another site", if I try to signup for another site, that becomes successful but with a warning that there are pending changes on the account (which is the pending cancellation). I think this is because when you cancel a subscription you are essentially not interested in the service and you should not be able to buy until the previous period is finished. That is why it says pending.

    If Pro Sites will allow you to subscribe before the end of the canceled term, then you will be essentially paying double for the same service. That is why it keeps saying the subscription was canceled but you should continue to have access until the end of the period you already paid for.

    Customer XYZ does not have a subscription with ID XYZ

    With regards to this, since the subscription was canceled Stripe considers it as deleted and that is why it says the customer does not have the subscription with the given ID. In the latest version, the above code addresses this by checking if the subscription is canceled locally before it goes to Stripe. If the subscription is canceled locally then the code will not query Stripe to avoid throwing the error about the customer not having a subscription.

    I hope you understand this. Please let us know if you see another issue that needs to be addressed that may cause not to subscribe. Please let me know if I missed something and I will be happy to review.

    Have a nice day.
    Mahlamusa

  • Mahlamusa

    Hello leoventans

    I hope you are doing great today. I am so sorry for the delayed response.

    When you or a member cancels a subscription in Pro Sites, Pro Sites also send the data to the Payment Gateway like Stripe to cancel the subscription. Once the subscription is canceled in Pro Sites and the Payment Gateway you can not renew it because stripe considers it as deleted.

    t is a control in Pro Sites and all other subscription based services to continue to allow access to the services until the subscription period is over. So in this case you should see something like this after cancelling a subscription and you will not be able to subscribe:

    Before canceling subscription:

    Then after canceling:

    And there are pending changes (like account still in trial, payment pending, pending end of period, etc):

    If I try to subscribe again for another site, I get the following:

    This means I can get a new site but will not be available until the pending changes have been made. If I try to renew the canceled blog I get the following error:

    [image pos="5"]

    This error is related to the subscription being canceled in both Pro Sites and stripe. Unfortunately, it cannot be renewed but instead a new subscription has to be made. Ideally, you will not need to subscribe immediately after cancelling a subscription because you already paid for the current billing period and you still have full access to the Pro Site, even if you are on a trial subscription you still have access for the term of the trial period. So this means there is no need to subscribe immediately after cancelling especially for paid subscriptions because you will essentially pay twice for the same period that you already have paid for. Even if you cancel a trial you still don't want to subscribe and pay for a trial that you were given for free, it does not make sense why anyone would cancel and subscribe immediately after.

    What I suggest after cancelling a subscription is that you let the period end then at the end all pending changes will be completed and you can subscribe again.

    I hope this helps. Please let us know if you have any other concerns or queries.

    Have a nice day.
    Mahlamusa

  • Mahlamusa

    Hello leoventans

    I hope you are doing great today.

    I am not sure if that will be enough if the user still has an ongoing subscription in Stripe. If the user's subscription is no longer valid then it should be safe to delete but make sure you also verify that the subscription is canceled in Stripe before you can delete it in the database.

    If you want to remove the user's data from the database then you should not the blog_id of the user's website then go to your database manager (phpMyAdmin) and find the table that will look like:

    wp_pro_sites_customers

    Where 'wp_' might be different based on your choice of WordPress table prefix. The data in the database will look like this:

    You must delete where the blog_id column matches the id of the blog of the particular user whose account you are trying to reset.

    I hope this helps.

    Have a nice day.
    Mahlamusa