M2P Coupons Applying to All Invoices Instead of First

First issue:
When enabling the Membership 2 Pro Coupon addon, recurring payments connected to PayPal get set to the value of the discounted amount and are not updated on all subsequent billing cycles. Coupons are only suppose to be for the first cycle's transaction, but all transactions are assuming the discounted amount. Reporting in M2P shows that the internal system expects to bill the full membership amount, but the data logged from the transaction shows that the discounted amount is actually being charged. This is confirmed through PayPal's logging.

The initial details of the recurring subscription details shows the proper data. The "Regular Amount" is 44.00 while the "Billed Amount" is 1.00. Then, on the next billing cycle, another invoice is generated showing only 44.00 as the "Billed Amount" and this amount is showed as paid. However, PayPal did not reflect this amount.

See screenshot: http://storage5.static.itmages.com/i/17/0914/h_1505373470_6299371_ef56032bcc.png

Looking deeper into the POST data from the transaction shows the discrepancy. The initial invoice is billed correctly. However, the subsequent invoice is actually being billed as the first invoice was.

Initial Billing: http://storage6.static.itmages.com/i/17/0914/h_1505373718_1848450_09a0ee4649.png
Subsiquent Billing: http://storage2.static.itmages.com/i/17/0914/h_1505373621_8559732_adde8b5c3c.png

So, even though the subscription states, "You will pay $1.00 first time and then $44 each day." in fact, only the original invoiced amount is actually charged ($1.00), even though M2P reports that $44.00 was charged and paid.

Screenshot: http://storage9.static.itmages.com/i/17/0914/h_1505373982_3612167_890ec03acc.png

Second issue:
I would *like* to be able to actually accomplish the above by design. I would like to be able to apply a couple to the full billing cycle of a subscription. So that a defined discount will apply to all subsequent payments. But, I would like this to be selectable between [1-time discount | Permanent Discount]. Also, I would like the reporting to reflect which type of discount is being applied.

  • mediastead

    Hello James, thank you for looking into all of this.

    As it turns out, this is actually a continuation of a previous ticket I have open, so I am going to cross link them.

    In my previous ticket, there was a question of coupons and whether they are recurring for the life of the account. It is confirmed that coupons do in fact recur.

    So, in addition to coupons recurring, my tests reveal that invoices also recur.

    That being said, the work that has to be done is actually not on the PayPal side, but on the Membership 2 Pro side:

    Since both coupons and invoices are recurring, the verbiage throughout the membership website and back end has to be changed. Currently, on the checkout page it is saying that coupons are applied to the first month and then the price goes back up to the set membership price after that.

    Also, all of the invoices for the subscriber are showing the same thing ... after the first bill, each recurring payment after that is showing as the set membership price even though in PayPal it is charging the original coupon/invoice price.

    And lastly, in the admin back end, all of the records in the billing section, as well as where you go to see payments of each individual member are reflecting the same thing ... PayPal is charging the price of the discount after the coupon, and/or the price you set in the invoice, but all of these records are showing that the member is paying full prices after each recurring payment.

    The only place in the back end that the record is showing correctly is:
    Membership 2 > All Members > (click blue icon next to member) > (click the link under the payments column) > (click "show transaction" under an invoice showing the full price) .... Under this page, you will see the time of the transactions, the gateway used, and the amount paid, which is the discounted coupon/invoice amount.

    Here is the original (albeit incomplete) ticket ... now that the dots are connected, hopefully it is easier to see the big picture.

    I love that coupons and invoices recur. Please keep this the way it is, and just fix the way the information is reflected in the website.

    In the future, you may decide to give people the option of choosing whether something recurs, or whether it is a one time thing, but for now I am requesting that recurring be the default.

    Thanks so much!


  • Dimitris

    Hello there! :slight_smile:

    As confirmed and stated in this other thread here


    coupon discounts are being applied in all recurring payments in PayPal end, there're multiple places in M2PRO plugin though, that normal prices are being shown instead, like in the checkout screen in frontend, or in invoices in wp-admin area.

    We're waiting for a resolution on this from our devs, me or another colleague of mine will keep you posted here as soon as we've got some valuable insights! :slight_smile:

    Take care,

  • Ivan

    Hi mediastead !

    For quick changing texts on front end I added /public_html/wp-content/mu-plugins/wpmu_membership_changings.php MU plugin to your site with the following code

    function wpmu_membership_changings( $desc, $short, $currency, $total_price, $membership, $invoice ) {
    	if ( 1 != $membership->pay_cycle_repetitions && isset( $_POST['apply_coupon_code'] ) && ! empty( $_POST['coupon_code'] ) && ! empty( $_REQUEST['membership_id'] ) ) {
    		$start = strpos( $desc, "first time" );
    		if ( $start ) {
    			$end = strpos( $desc, "(each" );
    			if ( !$end ) {
    				$end = strpos( $desc, "each" );
    			if ( $end ) {
    				$desc = substr( $desc, 0, $start ) . substr( $desc, $end ) ;
    		} else {
    			$start = strpos( $desc, "First payment" );
    			if ( 0 === $start ) {
    				$desc = sprintf(
    						'You will make %4$s payments of <span class="price">%1$s %2$s</span>, one each %3$s.',
    						MS_Helper_Period::get_period_desc( $membership->pay_cycle_period ),
    	return $desc;
    add_filter( 'ms_model_relationship_get_payment_description/recurring', 'wpmu_membership_changings', 11, 6  );

    Also, I'll ping our developer to fix and to implement your suggestion to the plugin.

    Best regards,

  • Felix

    Hello everyone,
    thanks for bringing this point up. I have the same issue on our page.
    We offer a monthly subscription both with Stripe and Paypal. We gave out a discount code to have our customers register with a discount, but I realized this discount is a one-time discount, in this case, for one month (which is very short) and not recurring. Having this realized, I really wished, that what Mediastead suggested, i.e. recurring payments, will be implemented very soon (at best as options to choose from).
    What complicates the matter in my case, however, is that apparently the discount is recurring with PayPal right now, but not with Stripe. So we basically cannot use the coupon at all in a way that is satisfying as firstly, when we want to give a very good discount for one month only (like 90% off), we actually lose a lot of money each month from thereon with all PayPal customers, whereas it works with Stripe customers, secondly, when we give only a smaller discount (which we unfortunately have to do because we can't afford to lose so much money with all our PayPal users) it does not work as much as an incentive as we want the discount to be when we only give, say, 20% on ONE month only. So we are in a dilemma. We would just like to give either a high one time discount and then for everyone the normal price afterwards OR a smaller discount for everyone but then recurring so that the coupon remains to be an incentive for new users to subsribe.

    It would be extremely helpful if you could solve that problem as soon as possible because right now our communication of our product launch really sucked because of that problem - that I found one night before launch unfortunately.

    Please let me know when you have any news on that issue.
    Kind regards

  • Dimitris

    Hello there Dario,

    hope you're doing good today! :slight_smile:

    The coupon functionality has been re-written, so we will be able to set the duration of a coupon to be either for a single use or for all recurring payments.

    This will be valid for both PayPal and Stripe payment gateways.

    I can't provide an estimated time on next release, as it includes many fixes and has to pass our QA procedures. Either way, you can keep an eye in WPMUDEV Dashboard or in your Hub page for any pending Membership 2 Pro updates and review the changelog to ensure that next update includes this fix (I doubt that it won't!).

    Warm regards,

  • mediastead


    If you can check this with your developers ...

    Since PayPal is set to recur the same each month for invoices and coupons, when this new update is implemented please make sure that all existing members remain under the same monthly payment, and nothing changes when we update Membership.

    Also, might I suggest that there be a way to give existing members one-time or recurring discounts that change what they pay for either that month, or recurring after the discount is applied.

    Does this make sense?


  • Ash

    Hello mediastead

    I have talked to the developer. According to his reply:

    Also, might I suggest that there be a way to give existing members one-time or recurring discounts that change what they pay for either that month, or recurring after the discount is applied.

    This is not possible, the members need to cancel and re-subscribe to the membership.

    Since PayPal is set to recur the same each month for invoices and coupons, when this new update is implemented please make sure that all existing members remain under the same monthly payment, and nothing changes when we update Membership.

    The existing members won't be affected, only the new ones.

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

    Have a nice day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.