Membership renewals with the Stripe Subscriptions gateway

Hi,

We’re updating our subscriptions to use the Stripe Subscriptions gateway. We’ll be encouraging members to renew using this payment method shortly.

New sign-ups look like they’re working fine. However we will be encouraging expired users to renew using this payment method so have tested that scenario as follows:

1) Set a subscription in the admin area for a test account (davetest). We set gave them a monthly subscription and manually set it to expire in the past so it got marked as expired.

2) We tried logging in as the user and going to their account page, clicking the expired membership to renew it, and paying via Stripe Subscriptions gateway.

The result was the following error: “Sorry, your signup request has failed. Try again.”

However:

– the payment was taken

– the subscription appears in stripe as a successful payment and as an active subscription

– a successful transaction appears in the transaction log in the Membership2 menu

– the invoice, however, is still marked as “billed” and not “paid” in the invoices list.

It seems from our debugging that the error appeared because of the failed $invoice->is_paid() check on line 642 of class-ms-controller-gateway.php. We can’t see why the invoice didnt get marked as paid though, and why this doesn’t happen on new accounts/subscriptions.

Your assistance with this would be appreciated so we can be sure everything will go smoothly when we ask our customers to renew.

We have granted support access.

Many thanks in advance.

  • Jude
    • DEV MAN

    Hi Dave

    A couple of quick suggestions, can you check if the dates and time on both Stripe and your site are on the same zone and are the same. We had a case in the past where a future date caused an unpaid / failed invoice.

    Can you add this test snippet to the site and see if the issue is here or elsewhere ? Remove it soon after

    add_action( 'ms_invoice_paid', sca123funct, 999, 2 );

    function sca123funct ($o, $s) {
    $o->status = 'paid' ;
    }

    This should mark the invoice paid automatically and if the membership is added successfully we know the issue lies in the check.

    Cheers

    Jude

  • Dave
    • WPMU DEV Initiate

    Jude,

    Apologies for not updating this original post.

    I can confirm both Stripe and WordPress are set to London timezone (currently BST i.e. UTC+1).

    Adding the snippet above and going through checkout again means the error does not appear and the post-registration screen displays as normal, but the user (davetest) is still marked as pending in the dashboard.

    Any further thoughts on this appreciated.

    Thanks.

  • Luís Lopes
    • QA

    Hi Dave ,

    Hope you’re doing well today!

    Firstly, sorry for the lack of attention, you already had covered the scenarios in your first post.

    I’ve confirmed this bug and flagged the developer so they can get it fixed up asap. Either myself or the developer will reply back here once we have pushed a fix out.

    If you have any further questions in the meantime just let us know.

    Cheers, Luís

  • Luís Lopes
    • QA

    Hi Dave ,

    Hope you’re doing well today!

    Firstly, sorry for the late reply and all the problems it may have caused.

    We already got a feedback from the developer. Seems this issue is not happening in all installs, I was able to replicate it, but, the renewals using the stripe gateway are working well in some sites.

    Our developers are working hard to solve this and other issues, but this particular one is complex and as it can be replicated in some installs, turns it even more complex and will require some time (split by development, testing, etc..).

    We hope to release a fix asap, but, unfortunately, I can’t give an ETA.

    Sorry for all the inconvenience.

    Cheers, Luís

  • Ash
    • Code Norris

    Hello there

    Extremely sorry for the long delay in your thread. Our developer wants to take a look at your installs. Would send me your admin login, ftp login and cpanel login (to access DB)?

    To send me details, please use our contact form: https://wpmudev.com/contact/

    Select: I have a different question

    Subject: Attn-Ash (this ensures that it will be assigned to me)

    Details:

    1. Send all requested details

    2. Send a link of this thread so that I can track

    3. Send any other relevant link

    I will be happy to take a look :slight_smile:

    Cheers

    Ash