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
- 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§ion=stripe&panel=settings
- Under account settings, click on "Edit account keys"
- Click on "Configure webhooks"
-
Force webhooks to fail
- One option is to make this function return an error message. For example, addingreturn WC_Stripe_Webhook_State::VALIDATION_FAILED_EMPTY_HEADERS;
early. -
Trigger a webhook
- One option is to initiate a refund from the Stripe dashboard, athttps://dashboard.stripe.com/test/payments
-
Go to the Stripe extension Settings tab, at
wp-admin/admin.php?page=wc-settings&tab=checkout§ion=stripe&panel=settings
-
Notice the following message is displayed. All good
-
Click on Edit account keys > Reconfigure webhooks
-
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.