Answers.Body: <p>The webhook UI resets the <em>processed_date</em> and <em>status</em> columns in <em>civicrm_paymentprocessor_webhook</em> table when you click &quot;Retry&quot;.</p>
  <p><a href="https://i.sstatic.net/J55LN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/J55LN.png" alt="enter image description here" /></a></p>
  <p>Here is how you can target failed transactions and replay them in batch webhook table.</p>
  <h2>Get a list of failed transactions</h2>
  <p>Get the transaction ID's from a contribution report like this and select the transaction ID column:
  <a href="https://i.sstatic.net/DYoN1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DYoN1.png" alt="enter image description here" /></a></p>
  <h2>Download the transactions from civicrm_paymentprocessor_webhook table</h2>
  <p>You can specify the date range in question.</p>
  <pre><code>SELECT * FROM `civicrm_paymentprocessor_webhook` WHERE `payment_processor_id` = 1 AND `created_date` LIKE '%2023-02%' AND `trigger` = 'invoice.payment_succeeded' 
  </code></pre>
  <h2>Compare to get event ID's to retry</h2>
  <p>Within the webhook table there is an identifier column. Use text to columns to split the transaction ID's on &quot;:&quot; into their own columns. It may have Invoice ID, Charge ID, and subscription ID.</p>
  <p>You will want to compare on Invoice ID (what Civi currently has in transaction field). Use VLOOKUP or similar method to do this and put the event_id column to the right of the invoice column you are using as your key.</p>
  <p>example formula: =VLOOKUP(E2,civicrm_paymentprocessor_webhoo!I:J,2,FALSE)</p>
  <p>Now that you've returned the event id's, combine them and format to be put added to a MySQL statement. Your result will looks like: (using dummy event ID's)</p>
  <pre><code>'evt_1','evt_2','evt_3','evt_4','evt_5'
  </code></pre>
  <h2>Reset and Retry event ID's in MySQL</h2>
  <p>Using dummy data below, event ID's are normally like evt_3MXs5MGUXvR5yNII0RwNHBiM.</p>
  <p>Now drop the event id's into a MySQL statement like below:</p>
  <pre><code>UPDATE `civicrm_paymentprocessor_webhook` SET
  `processed_date` = NULL,
  `status` = 'new'
  WHERE `payment_processor_id` = '1' AND `created_date` LIKE '%2023-02%' AND `trigger` = 'invoice.payment_succeeded' AND `event_id` IN ('evt_1','evt_2','evt_3','evt_4','evt_5');
  </code></pre>
  <p>The Process PaymentProcessor Webhooks scheduled job will now look thru these entries that were reset and retry them. You can let the job run or manually kick off by &quot;executing now.&quot;</p>
  <p>While the root cause of why transactions do not process on the first run should be investigated, sometimes you just need to target and retry transaction quickly. This process takes about 20 minutes to do and is much faster and if you have a lot of transactions that need re-processing (I've had cases where I needed to do over 100).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-13T18:45:28.853Z
Answers.LastActivityDate: 2023-02-14T17:00:24.757Z
Answers.LastEditDate: 2023-02-14T17:00:24.757Z
Answers.UserDisplayName: Andy Burns
Body: <p>Sometimes you have webhooks from Stripe, or other processors that use the <em>civicrm_paymentprocessor_webhook</em> table, that were not successfully processed and need to be re-tried. This is most commonly observed with recurring contributions and them showing in pending status in CiviCRM.</p>
  <p>I know I can replay individual contributions from the <a href="https://Payment%20Processor%20Webhooks" rel="nofollow noreferrer">https://example.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fa#/paymentprocessorWebhook</a> but what if I want to audit and check a batch of transactions at once?</p>
  
Tags: <payment-processor><recurring-contributions><stripe>
Title: Batch retrying Stripe webhooks
ThreadText: # Batch retrying Stripe webhooks
  
  (Asked by: username_0 on 2023-02-13)
  
  Sometimes you have webhooks from Stripe, or other processors that use the *civicrm\_paymentprocessor\_webhook* table, that were not successfully processed and need to be re-tried. This is most commonly observed with recurring contributions and them showing in pending status in CiviCRM.
  
  I know I can replay individual contributions from the [https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa#/paymentprocessorWebhook](https://Payment%20Processor%20Webhooks) but what if I want to audit and check a batch of transactions at once?
  
  **Tags:** payment-processor, recurring-contributions, stripe
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-02-13. Score: 2 | Accepted answer
  
  The webhook UI resets the *processed\_date* and *status* columns in *civicrm\_paymentprocessor\_webhook* table when you click "Retry".
  
  [![enter image description here](https://i.sstatic.net/J55LN.png)](https://i.sstatic.net/J55LN.png)
  
  Here is how you can target failed transactions and replay them in batch webhook table.
  
  ## Get a list of failed transactions
  
  Get the transaction ID's from a contribution report like this and select the transaction ID column:
  [![enter image description here](https://i.sstatic.net/DYoN1.png)](https://i.sstatic.net/DYoN1.png)
  
  ## Download the transactions from civicrm\_paymentprocessor\_webhook table
  
  You can specify the date range in question.
  
  ```
  SELECT * FROM `civicrm_paymentprocessor_webhook` WHERE `payment_processor_id` = 1 AND `created_date` LIKE '%2023-02%' AND `trigger` = 'invoice.payment_succeeded' 
  
  ```
  
  ## Compare to get event ID's to retry
  
  Within the webhook table there is an identifier column. Use text to columns to split the transaction ID's on ":" into their own columns. It may have Invoice ID, Charge ID, and subscription ID.
  
  You will want to compare on Invoice ID (what Civi currently has in transaction field). Use VLOOKUP or similar method to do this and put the event\_id column to the right of the invoice column you are using as your key.
  
  example formula: =VLOOKUP(E2,civicrm\_paymentprocessor\_webhoo!I:J,2,FALSE)
  
  Now that you've returned the event id's, combine them and format to be put added to a MySQL statement. Your result will looks like: (using dummy event ID's)
  
  ```
  'evt_1','evt_2','evt_3','evt_4','evt_5'
  
  ```
  
  ## Reset and Retry event ID's in MySQL
  
  Using dummy data below, event ID's are normally like evt\_3MXs5MGUXvR5yNII0RwNHBiM.
  
  Now drop the event id's into a MySQL statement like below:
  
  ```
  UPDATE `civicrm_paymentprocessor_webhook` SET
  `processed_date` = NULL,
  `status` = 'new'
  WHERE `payment_processor_id` = '1' AND `created_date` LIKE '%2023-02%' AND `trigger` = 'invoice.payment_succeeded' AND `event_id` IN ('evt_1','evt_2','evt_3','evt_4','evt_5');
  
  ```
  
  The Process PaymentProcessor Webhooks scheduled job will now look thru these entries that were reset and retry them. You can let the job run or manually kick off by "executing now."
  
  While the root cause of why transactions do not process on the first run should be investigated, sometimes you just need to target and retry transaction quickly. This process takes about 20 minutes to do and is much faster and if you have a lot of transactions that need re-processing (I've had cases where I needed to do over 100).
  
  
  ---
  
  