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