woocommerce/woocommerce-gateway-stripe

Clear the webhook status when configuring a new one

Closed this issue · 0 comments

Describe the bug

The webhook status from the previously set up webhook persists after configuring a new one.

To Reproduce

  1. Ensure webhooks are set up.
  • Make your website publicly available
  • Go to Stripe settings > Settings tab, at wp-admin/admin.php?page=wc-settings&tab=checkout&section=stripe&panel=settings
  • Under account settings, click on "Edit account keys"
  • Click on "Configure webhooks"
  1. Force webhooks to fail
    - One option is to make this function return an error message. For example, adding return WC_Stripe_Webhook_State::VALIDATION_FAILED_EMPTY_HEADERS; early.

  2. Trigger a webhook
    - One option is to initiate a refund from the Stripe dashboard, at https://dashboard.stripe.com/test/payments
    image

  3. Go to the Stripe extension Settings tab, at wp-admin/admin.php?page=wc-settings&tab=checkout&section=stripe&panel=settings

  4. Notice the following message is displayed. All good

    image
  5. Click on Edit account keys > Reconfigure webhooks

  6. Notice the error message continues to be displayed

Expected behavior

I'd expect the status of the previously configured webhook to be deleted when configuring a new one.
My 2c, though. Glad to close this issue if the current behavior makes more sense.