Open greathmaster opened 5 years ago
Hook into pmpro_doing_webhook and save an option called pmpro_stripe_webhook_last_processed with the timestamp as the value. (Maybe set that option deeper in the Stripe webhook handler and specifically save info on each event type.)
Add a check on admin_notices that checks if you are on the ?page=pmpro page and looks for a recent order (David to follow with the psuedocode algirthm)
What I'm thinking is that we do a query that counts the PMPro orders that:
If any orders fit that description, show webhook warning
We are now keeping track of the last webhook time for Stripe in the 2.6 branch.
We'd like to do this for all gateways.
And the original issue here also wanted to find missing orders and synchronize them as well.
I'm going to change this milestone to "future versions" as we continue working on this related work.
Recurring orders are sometimes missed due to IPN or web hook malfunction. This can cause major issues with reporting and statistics. Some gateways such as Stripe do not allow you to resend Webhook notifications to recover the order data. Instead they have a Events API for you can access prior Webhook data. PayPal does allow you to resend the IPN but it is for a limited amount of time. We should also consider adding a check for expected recurring orders, and inform the admin if we don't find them.