Recurring payments made via stripe checkout are not properly updated
When a recurring payment is created using stripe checkout, I get the following in the civicrm_paymentprocessor_webhook
table:
MySQL > select id, created_date, processed_date, status,message from civicrm_paymentprocessor_webhook where id between 51196 and 51201 order by processed_date ;
+-------+---------------------+---------------------+---------+--------------------------------------------------------------------------------+
| id | created_date | processed_date | status | message |
+-------+---------------------+---------------------+---------+--------------------------------------------------------------------------------+
| 51197 | 2023-12-14 20:32:02 | 2023-12-14 20:32:02 | success | doCustomerSubscriptionUpdated: ignoring - not implemented |
| 51200 | 2023-12-14 20:32:03 | 2023-12-14 20:32:03 | success | doInvoicePaid: No contributionRecur record found in CiviCRM. Ignored |
| 51199 | 2023-12-14 20:32:03 | 2023-12-14 20:32:03 | success | doInvoicePaid: No contributionRecur record found in CiviCRM. Ignored |
| 51201 | 2023-12-14 20:32:03 | 2023-12-14 20:32:04 | success | doCheckoutSessionCompleted: charge.succeeded flagged for re-process. coid:1750 |
| 51196 | 2023-12-14 20:32:01 | 2023-12-14 20:45:23 | success | doChargeSucceeded: ignoring - contribution has recur |
| 51198 | 2023-12-14 20:32:02 | 2023-12-14 20:45:23 | success | doInvoiceFinalized: . coid:1750 |
+-------+---------------------+---------------------+---------+--------------------------------------------------------------------------------+
The doCheckoutSessionCompleted
has a comment about how charge.succeeded
might arrive before checkout.session.completed
so it should be flagged for re-process. But, when it's a recurring contribution, it should be invoice.paid that should be flagged for re-process instead, because charge.succeeded ignores recurring contributions.
@mattwire I can submit a MR if you think this makes sense. Thanks!