Please advise how

Please advise how to make a coupon recurring, so the discount will apply to each monthly payment.

  • Nastia

    Hello Jessica

    Hope you are doing well!

    Out of the box, it is not possible to create recurring coupons, coupons can be applying on the first payment and changing this feature will require lots of custom coding.

    I've flagged our second level support developers so they can provide you some feedback about this.

    Please note, our developers' response time is longer-than-normal compared to support staff response times.

    Have a nice day and take care!

    Kind regards,
    Nastia

  • Lindeni Mahlalela

    Hello Jessica

    I hope you are doing great today. Thank you for contacting us and thank you for your waiting for our response.

    I had a deep look into this and have done some research about the various payment gateways. Firstly, this is not possible out of the box using the Membership 2 Pro plugin, it can only be achieved through custom development.

    a: there is not an option to select for the discount to be single vs repeat

    This will not be easy to implement as it must also be supported on the payment gateway and seems that most gateways support a once off coupon. We also didn't have other members request this so it is not a feature we have heard about.

    b: it is not more clearly communicated that this isn't the case

    The Coupons feature was only designed for once off coupons, so by default there is nothing to communicate about recurring coupons if they are not supported.

    The challenge with this feature is that with recurring payments the processing is done on the Payment gateway, this means the discount must be calculated and processed on the gateway while the plugin is built to calculate the discount and send the total amount to be paid at the gateway after the payment term, the full price is processed in the payment gateway and the gateway communicates with your website to renew the subscription.

    Stripe seems to support this functionality in their API but then you will have to get a developer to extend Membership 2 Pro to support this feature. They have a discount period variable which can be set to once, repeating or forever. The best place to start with this is to look at the existing Stripe gateway in the plugin, the files are located in:

    /plugins/membership/app/gateway/stripe

    The main file that controls the gateways is:

    /plugins/membership/app/class-ms-gateway.php

    Most of the payment gateways do not have enough information in their documentation and most do not even mention recurring coupons with exception to Stripe. Maybe I have missed something but it seems Stripe is the best gateway for this feature.

    If you are not comfortable developing this feature by yourself then you may like to consider hiring an independent professional developer, you can post a project in the Jobs board and have professional developers bidding on your project.

    I hope this helps. Please let us know if there is anything else we can help with.

    Have a nice day.
    Mahlamusa