checkout / checkout-woocommerce-plugin

Checkout.com plugin for WooCommerce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recurring payments upgrades/downgrades

MhdSyrwan opened this issue · comments

According to this article https://docs.woocommerce.com/document/subscriptions/customers-view/#section-13

The plugin has to support the payment date changes feature in order to enable downgrades/upgrades for subscriptions.

EDIT: features are recurring amount changes and payment date changes.

Is there any plan to implement that ?

any updates ?

Hi @MhdSyrwan

Our gateway does not support to change the next recurring date of customer recurring payments, this is why it was not implemented

Hi @nicolas-maalouf-cko
Thank you for your reply.

Correct me if i'm wrong, Isn't the recurring amount changes feature simply an "Update Payment Plan" request ? like the one written here in the core php lib ?

So, based on that, can recurring amount changes feature be implemented ? I think this might allow plan switching without allowing what is called "Prorate Subscription Length".

screenshot-masteri io-2018 05 16-16-40-50

Also, if the previously mentioned features cannot be implemented can these be implemented?

  • 'subscription_payment_method_change',
  • 'subscription_payment_method_change_customer',
  • 'subscription_payment_method_change_admin',

Note: We're trying to use these to find a workaround for plan upgrade/downgrade by asking site moderator to apply that from control panel (like canceling the old subscription and launching a new one from the control panel while customer can pay later in order to activate his new subscription)

Hi @MhdSyrwan,

Apologies for not getting back to you earlier.

As you need a workaround for plan upgrade/downgrade, you can register the below 2 support in the plugin.

  • subscription_amount_changes
  • subscription_date_changes

Note that registering these 2 supports will only allow the upgrade/downgrade button to be displayed on the customer subscription.

If a customer want to upgrade/ downgrade plan:
Since the customer will have to go through the checkout process again, a new subscription will be created and a new recurring plan will be created on our gateway. You will need to make sure to cancel the previously active plan for that customer on your wordpress backend which will automatically cancel it on the gateway.

Do let us know if this works for you.

Thanks for your reply.

Actually, It worked somehow.

But, the interesting part is that it didn't create a new subscription. it updated the same subscription and wrote a note on it that the customer switched from A to B and charged him the amount B.price - A.price for the upgrade.

Now I have the following: 1 subscription has the value of B.price and 2 orders. the first order is the old one that has the value of A price and the other one has the value of B.price - A.price

I'm afraid that this might somehow charges the customer the amounts A.price and B.price - A.price each cycle. What i can see in the sandbox control panel is 2 payments one A.price and the other is B.price - A.price and both of them are marked as recurring.

Interesting indeed. Unfortunately am not able to simulate the scenario where it updated the same subscription. Each time I want to upgrade it is creating a new subscription order on my end.

If you do not cancel the old recurring plan it will eventually charge the customer both amount after each cycle.
What I can suggest is to verify the "Authorised Charge Id" to get the customerPlanId. The "Authorised chargeId" can be found as a note when you view the order details. "Checkout.com Charge Approved (Transaction ID – charge_test_0C39187D844O73FC3FC5 Order status changed from Pending payment to On hold."

More details how to verify the charge can be found here.
In the response body, under customerPaymentPlans you will get the customerPlanId.
Upon receiving the customerPlanId you can send a request to cancel the recurring profile.
More info on cancel customer plan can be found here

For some reason, I don't have any section/tab that displays info about payment plans, I have only "Transactions" and "Customers". And even using the API you sent I cannot find a column named customerPlanId.

Currently we're contacting support to check if the issue is related to our account's setup.

I have a related question actually, does this addon create a payment plan per subscription product? at which step the plan is being created?

Hi @MhdSyrwan,

The payment plan is created at the last step of the checkout process. (i,e) when the payment is done. For each customer buying a subscription product, a new payment plan will be created.

Can you also advise which sandbox account you are currently using, we will do needful to enable the subscription tabs accordingly.

Hi,
After contacting the support and providing my account information. They enabled payment plans sections in my account.

Now, I can see all registered plans. Actually it turned out that it created a new payment plan with a value of B.price - A.price and didn't change the old one.

I can do the following:
1- Change the newly created payment plan value from B.price-A.price to B.price
2- Cancel the old payment plan

Now I have a new payment plan with the new value/price and starts from today.

When I change the payment plan's value, will that affect any previous charge of it (in our case the charge of B.price - A.price) ?

Regardless of my previous question, Could this behavior be corrected ? I mean to issue a one-time B.price-A.price (instead of creating a payment plan) and to change the value of the previously created payment plan to the new subscription value ?

Hi @MhdSyrwan,

Apologies for not getting back to you earlier.

Please refer to my comments dated 5 days ago.
As informed earlier, since the customer will have to go through the checkout process again a new payment plan will be created for (B.price-A.price) and the old plan will continue to recur for each cycle.

Since it didnt create a new subscription order on your backend, I would suggest to cancel the customer recurring plan for the old recurring plan on the checkout hub.

Actually I was asking for that because it turned out that woocommerce will not charge B.price - A.price all the time.

According to the docs it will charge the following Days until next payment * ( New Price Per Day – Old Price Per Day ) which they call Gap payment. This payment equals B.price - A.price only if you upgrade at the same day you signed up for the previous plan.

It's setup to make the first plan is the plan that should continue somehow (with a change on its value).

What can I do is to suspend/delete the newly created plan (since it's already charged the Gap payment) and to change the value of the old one to B.new (does this changes the value of the upcoming charges for old subscribers?).

Please refer to Woocommerce docs, according to it, the addon is not behaving in a correct way.

There might be a flag or a parameter informs you somehow that the checkout process is doing an upgrade so the Addon can behave accordingly.

The Woocommerce docs is not available.

Yes, you can cancel the newly created plan and update the old one with the new value. This will also change the value of the next charges.

You can refer here to update the payment plan.