pronamic / wp-pronamic-pay

The Pronamic Pay plugin allows you to easily accept payments with payment methods like credit card, iDEAL, Bancontact and Sofort through a variety of payment providers on your WordPress website.
https://pronamicpay.com
34 stars 14 forks source link

Add tools to cleanup payments and correct subscriptions #254

Closed remcotolsma closed 2 years ago

remcotolsma commented 2 years ago

I think we need 4 tools:

https://github.com/pronamic/wp-pay-core/blob/76f2987512bb6dd93949cce4054c872018f43f85/views/page-debug.php#L46-L65

Schermafbeelding 2021-10-15 om 16 16 46
remcotolsma commented 2 years ago

wip → https://github.com/pronamic/wp-pay-core/blob/develop/views/page-debug.php#L12-L42

rvdsteege commented 2 years ago

I've added a debug actions scheduler, which uses the WordPress REST API to schedule actions.

https://user-images.githubusercontent.com/10371164/138302320-6627a0cd-a96c-4fc3-b456-b6761571f47f.mov

The different tools are registered in a tools manager:

Instead of always needing to query with post status any as actions could be executed while still scheduling actions, I'm locking the async-request-runner on every API call (by default, the lock is placed for one minute):

remcotolsma commented 2 years ago

The tools have been removed again, because we have set up the scheduling of follow-up payments differently. We now use https://actionscheduler.org/ to schedule the subscription/payments actions paginated. This seems to work well with a customer who regularly has to initiate many (100+) follow-up payments daily. For the "Pending payments status check" we have introduced the following CLI command:

wp pay payment status $( wp post list --field=ID --post_type=pronamic_payment --post_status=payment_pending --order=ASC --orderby=date --posts_per_page=100 --paged=1 )

https://github.com/pronamic/wp-pay-core#check-pending-payment-status

We may also want to reintroduce the other tools in the future. This can be in the form of a CLI command or also via the paginated scheduling actions setup.