Open ideadude opened 6 years ago
We've been able to recreate it (or see in the wild).
Here: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/ipnhandler.php#L108-L110
A recurring payment is coming in, but because the IPN was broken before, the original "review" status order from years ago was never marked as "success". So the first line there will be false, no successful order for this subscription. Then it will find an order with the same item number and assume that this is the first payment coming in from years ago. It just marks the old order as success. So you wouldn't see a new order at the top of the list.
We could check the date of the IPN info and make sure it's not "too far" past the date of the old item number order.
If it is old... then maybe we can assume it's a recurring order. Can we assume that the initial order should be in success status? We could update the old order status and create a new one... and probably email the admin about what is happening.
In the IPN handler it looks like we are treating "subscr_payment" messages as if they were initial payments that we have orders for when they are probably recurring payments we need to make new orders for. Let's test this.
https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/ipnhandler.php#L104-L143