-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Stripe-side info when displaying webhook status #3531
Conversation
de4e1ca
to
2f9a0d3
Compare
ab7ec61
to
092bbc2
Compare
Instead of determining webhook status ('Enabled' vs 'Disabled') by using the presence or absence of secret keys, we check the actual status using Stripe API.
c4787ee
to
334b26c
Compare
e5de1df
to
0940a78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good and it is working perfectly.
I have tested by enabling/disabling the webhook in my Stripe dashboard. 🎉
I noticed one thing. On every page refresh we are fetching the webhook status from Stripe. Also on every save on the Stripe settings page (i.e enable/disable any method and save), we are fetching this from Stripe again.
Should we opt for a short term caching for this webhook status response? Similar to how we cache the account data for about 2 hours.
Good idea. I'll try to work that in for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @annemirasol. It is working nicely. 🎉
✅ Fetching the webhook status via API call on page refresh.
✅ Returning the data from the cache on any changes in the settings.
Instead of determining webhook status ('Enabled' vs 'Disabled') by using the presence or absence of secret keys, we check the actual status using Stripe API.
Fixes #3512
Changes proposed in this Pull Request:
In Stripe's Settings page, Account Status section, we display the webhook status as "Enabled" or "Disabled", based on the presence or absence of a webhook secret in the settings store. If the webhook has been disabled or deleted outside of WooCommerce, this approach leads to an inaccurate webhook status.
In this PR, we will display a more accurate webhook status by retrieving it using a Stripe API call.
Testing instructions
develop
, the webhook status still shows asEnabled
.Disabled
.changelog.txt
andreadme.txt
(or does not apply)Post merge