-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscriptions follow-up payments problem due to slow database / lots of metadata #212
Comments
This issue is not completely new, we have the following internal Basecamp to-do open for this: "Abonnementen » Dubbele betalingen mogelijk bij dubbele cron". A possible solution is also to make more use of custom tables and to lock rows while starting up a follow-up payment. |
We wrote 2 Mollie CLI commands to help cancel payments.
|
Option 1 - Switch to Mollie Subscriptions APIAdvantages Mollie Subscriptions API
Disadvantages Mollie Subscriptions API
Are there any real drawbacks? Other options?
|
Disadvantages Mollie Subscriptions API
|
Option 2 - One global daily schedule event that schedules single events for each follow-up payment
https://developer.wordpress.org/reference/functions/wp_schedule_single_event/ The advantage of this may also be that if a follow-up payment cannot be started at the gateway, we can reschedule the single event. I'm not exactly sure what WordPress does with events that throw an exception. It might not be watertight yet, but this option might solve some issues. @rvdsteege You mentioned that WooCommerce also schedules events for orders, i couldn't find this: https://github.com/woocommerce/woocommerce/search?q=wp_schedule_single_event. |
It's here: |
@rvdsteege made a overview of meta usage: Pronamic Pay metaPaymentsselect p.ID, p.post_title, m.meta_key, m.meta_value from wp_posts as `p` left join wp_postmeta as `m` ON m.post_id = p.ID where p.post_type=‘pronamic_payment’ and m.meta_key LIKE ‘_pronamic%’ group by m.meta_key order by m.meta_key ASC
Subscriptionsselect p.ID, p.post_title, m.meta_key, m.meta_value from wp_posts as `p` left join wp_postmeta as `m` ON m.post_id = p.ID where p.post_type=‘pronamic_pay_subscr’ and m.meta_key LIKE ‘_pronamic%’ group by m.meta_key order by m.meta_key ASC
|
We still have a few open issues in the Subscriptions follow-up payments improvement project, but we have already implemented the solution for this issue, so I'm closing this ticket. |
We have a customer with many payments and subscriptions where the start-up of the follow-up payments is not going well. At first, the slow server/database seemed to be causing problems, but adding a temporary index on the
wp_postmeta.meta_value
may have played a role as well. However, this issue may be a signal that not all WordPress installations are stable enough to initiate subscription follow-up payments. I don't think it's the first time that this doesn't run as smoothly as we'd like. The WordPress cron doesn't always seem to work well for this. The big question is how are we going to fix/improve this? Is it better to use the Mollie Subscriptions API?Internal HelpScout ticket: https://secure.helpscout.net/conversation/1637278281/22756?folderId=1425710
The text was updated successfully, but these errors were encountered: