wp-pronamic-pay
wp-pronamic-pay copied to clipboard
Add support for manually editing recurring amount of subscriptions
From customer:
Hi, is het mogelijk om het bedrag te wijzigen van de terugkerende betalingen? Kan ik een abonnement wijzigen of moet er een nieuwe abonnement worden aangemaakt en de oude stopgezet?
In the past, we've had the functionality to manually edit the price of an existing subscription. Unfortunately, we had to remove this with the introduction of subscription phases. We can now add it back.
Considerations:
- Are we modifying the existing subscription phase?
- Canceling a subscription phase and start a new one?
- Should price changes result in a new subscription?
Also requested in https://secure.helpscout.net/conversation/1752461209/23295/ in relation with Restrict Content Pro:
- https://github.com/pronamic/wp-pronamic-pay-restrict-content-pro/issues/2
Also requested in https://secure.helpscout.net/conversation/1846530879/23827 in relation to MemberPress:
Via Memberpress zijn er automatische incasso's afgesloten in 2021. Na een jaar moesten deze opgehoogd worden naar ●●●,- i.p.v. ●●●,-. Echter ging dit niet automatisch, dus hebben we ze in Memberpress handmatig verhoogd. Toch blijkt de betaling in Mollie niet verhoogd te worden. Moet er via Pronamic Pay hierin nog iets aangepast worden wat wij over het hoofd zien?
MemberPress has some documentation about changing pricing terms on the following page: https://docs.memberpress.com/article/192-changing-pricing-terms
Changing an Existing Membership's Pricing Terms
Overview
There are a couple of reasons why you may want to change the pricing terms of an existing membership:
- Offer a temporary discount
- Natural inflation of your product
- Wanting to charge more
- Changing the billing type (one-time payment to recurring)
- Etc.
These are all very good reasons to update the price of your membership. Additionally, you should make note of the following:
- Whatever you do, do NOT delete your membership to create a different price term if any users currently have active subscriptions to the membership you would like to edit.
- When updating the price of your Membership in MemberPress, the changes are not applied retroactively to existing users of automatically recurring subscriptions. If the user's are already subscribed to an automatically recurring subscription, they will continue to be billed the amount they originally signed up for each payment cycle. However, If your users are on manually renewing subscriptions (not automatic), they will pay the updated (current) price of the Membership when renewing.
- You will not be able to change the price of current signups (e.g. increase the cost of recurring billings for existing recurring subscriptions)
- If your user signed up via Stripe, you can change their billing price as outlined here in the 'Manually changing the billing date or price for a users subscription ' section.
- All current users will continue on their price until their subscriptions are cancelled.
- This means that if the subscription is recurring, they will keep their recurring price until their subscription is either cancelled and they sign up again, or it naturally expires and they sign up again.
Making the Change
Making the change for the pricing terms of your membership is as simple as navigating to your WordPress Dashboard > MemberPress > Memberships > Edit on the Membership, and then updating the pricing terms and clicking the 'Update' button to save the changes.
The bottom line is that you cannot adjust the prices of existing active signups in MemberPress. This is confusing because as a user in the MemberPress admin dashboard you get the impression that this is possible:

I think we've considered showing a warning on this page, but personally I think MemberPress should clarify this.
As discussed we could hook into MeprHooks::do_action('mepr_subscription_saved', $this);
and rebuild the Pronamic subscription phases based on the MemberPress subscription like we do in the WooCommerce extension. The customer asks if we can implement this before the weekend, but we won't be able to do that in such a short time. Shall we discuss this issue internally next Tuesday or Wednesday?
Updating a MemberPress subscription now updates the subscription phases. Also, the payment/subscription status and subscription next payment date are now also mentioned when editing a MemberPress transaction or subscription.
https://github.com/pronamic/wp-pronamic-pay-memberpress/compare/8538853d2fad...f3c7d91bb12f
Also requested in https://secure.helpscout.net/conversation/2013404346/24488/ in relation with Gravity Forms:
Hallo Ik wil graag een verhoging doorvoeren van de abonnementen die via mijn site zijn afgesloten: wordpress -> gravity forms -> pronamic en dan mollie Hoe kan ik dat doen?
We found out that the "Gravity Forms PayPal Standard Add-On" plugin has support for editing payment amount:
https://github.com/wp-premium/gravityformspaypal/blob/3.4/class-gf-paypal.php#L1756-L1768

It seems that the "Gravity Forms PayPal Standard Add-On" plugin is legacy, we should look at the "Gravity Forms PayPal Checkout Add-On" plugin: https://github.com/pronamic/gravityformsppcp. This plugin creates a subscription plan at PayPal:
- https://github.com/pronamic/gravityformsppcp/blob/584df1be0f3c6922133e7884085142efe28d838a/includes/class-paypal-subscriptions-handler.php#L299-L348
- https://github.com/pronamic/gravityformsppcp/blob/584df1be0f3c6922133e7884085142efe28d838a/includes/class-gf-ppcp-api.php#L506-L526
- https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create
- https://developer.paypal.com/docs/api/subscriptions/v1/#plans_update-pricing-schemes
- https://docs.gravityforms.com/enable-editing-of-the-entry-payment-details/
- https://github.com/richardW8k/enablegfpaymentdetails
Pronamic Pay and Mollie have no subscriptions plans layer, which makes it harder to update the pricing of subscriptions.
Also requested for Gravity Forms in https://secure.helpscout.net/conversation/2253878869/25692/:
Jullie plugin gebruik ik via Gravity Forms.
- Hoe pas ik het bedrag aan van zo'n abonnement?