Add an option to log incoming webhooks to watchdog

Created on 22 September 2023, over 1 year ago
Updated 25 August 2024, 6 months ago

For the sake of scalability, I don't think we should log the receipt of every incoming webhook by default. If someone wants to inspect webhooks, they can always go see them in their dashboard. However, it might be useful when testing / debugging certain scenarios to have the receipt / processing of a webhook be logged chronologically to watchdog along with other log entries.

Let's add a checkbox option to the Stripe settings form I proposed in ✨ Add the ability to turn off advanced fraud signals Fixed that reads, "Log the receipt of all Stripe webhooks." When we begin processing a webhook, we should log a notice to the watchdog reading, "Processing webhook.name webhook with ID webhook_id."

(If the menu / module settings form hasn't been made yet, make it in the context of resolving this ticket.)

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rszrama
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    Note: when this setting is enabled, we should also use it to determine whether or not to log when an incoming webhook is not able to be matched against an existing payment.

  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    vmarchuk β†’ made their first commit to this issue’s fork.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    38 pass
  • @vmarchuk opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    Let's rename the variable to log_webhooks to keep the same "verb_object" pattern as the other setting. I also don't see any harm in logging the receipt of any incoming webhook, even if it's of a type the module itself doesn't currently process. Could be useful for debugging or at least optimizing a webhook configuration in a Stripe account.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    38 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    38 pass
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    @rszrama

    Let's rename the variable to log_webhooks to keep the same "verb_object" pattern as the other setting. I also don't see any harm in logging the receipt of any incoming webhook, even if it's of a type the module itself doesn't currently process. Could be useful for debugging or at least optimizing a webhook configuration in a Stripe account.

    Both points are done.

  • Status changed to Closed: outdated 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States TomTech

    Closing this out, since we now support logging webhooks with the webhook events submodule.

Production build 0.71.5 2024