vippsas / vipps-recurring-woocommerce

Vipps Recurring payments for WooCommerce
GNU Affero General Public License v3.0
6 stars 4 forks source link

Patch agreement on subscription product price changes when an individual subscription is updated #25

Closed Marcuzz closed 4 years ago

Marcuzz commented 4 years ago

WooCommerce does not update subscription prices automatically, retroactively. This makes it hard to even do something like this automatically as all the methods to update the price are either fully manual by doing it to each subscription separately or done through the database, where our code will not have any way of knowing about the change at all. This makes it extremely hard to do.

We'd most likely have to schedule a cron job here in order to do this in mass as it's a request per agreement and there could be a whole lot of requests. I'm not sure if this is the right solution and we need to think about if this is even possible in a reliable and good way at all. The main issue is how such a price update is even triggered in Woo.

If an automated task updates it through PHP in the same way you do it in the UI we could easily just schedule a cron (and pray people configure a proper cron). This is not the responsibility of a single payment gateway, though. We should only make sure this happens when a subscription is touched.

Marcuzz commented 4 years ago

This is sort of related to #3 in a way. They should probably use the same system.

Marcuzz commented 4 years ago

Price is now being updated in 1.4.7.