Home › Forums › Stripe Payments Plugin › Subscriptions plugin: live webhook disappearing
- This topic has 15 replies, 2 voices, and was last updated 4 years, 1 month ago by alexanderfoxc.
-
AuthorPosts
-
October 7, 2020 at 8:04 am #3350[email protected]Participant
Hi there,
Basically every day, I am getting the error “Stripe Payments Subscriptions Addon: webhooks seem to be not configured properly. Please go to settings page to configure them.”
Sometimes being on the settings page, it will kind find/remember it anyway, sometimes it won’t, and it has to be created again. Any ideas what could cause this “loss”?
Thanks!
October 7, 2020 at 3:27 pm #3351alexanderfoxcParticipantHi.
Check your live webhook on your Stripe Dashboard here https://dashboard.stripe.com/webhooks. Let me know if it’s there even when error message from Subscriptions add-on is displayed.
October 10, 2020 at 7:59 am #3356[email protected]ParticipantHi Alexander,
Yes there are errors, but they are only occasional. I checked the server error log, and this is what I am getting:
—
Got error 'PHP message: PHP Fatal error: Uncaught Stripe\\Exception\\SignatureVerificationException: No signatures found matching the expected signature for payload in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/Exception/SignatureVerificationException.php:28\nStack trace:\n#0 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/WebhookSignature.php(61): Stripe\\Exception\\SignatureVerificationException::factory('No signatures f...', '{\\n "id": "evt_...', 't=1602316361,v1...')\n#1 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/Webhook.php(29): Stripe\\WebhookSignature::verifyHeader('{\\n "id": "evt_...', 't=1602316361,v1...', 'whsec_...', 300)\n#2 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments-subscriptions/inc/asp-sub-stripe-webhooks.php(32): Stripe\\Webhook::constructEvent('{\\n "id": "evt_...', 't=1602316361,v1...', 'whsec_...')\n#3 /opt/bitnami/apps/wordpre...\n
—
Thanks
October 11, 2020 at 1:05 pm #3359alexanderfoxcParticipantThank you, this is helpful.
Looks like your webhook signing secrets are invalid.
In order to fix that:
1. Go to Stripe Payments -> Settings, Subscriptions tab.
2. Click “Delete Webhooks” button.
3. Click “Create Webhook” buttons for Live and Test webhooks.
4. Click “Save Changes” button at the bottom of the page.
Let me know if this helped.
October 14, 2020 at 10:03 am #3360[email protected]ParticipantI did that, and it is fine for a while, before the errors start popping back up. And thus, the error log is still filling with the fatal errors. And the webhook error statistics in the Stripe dashboard is climbing, now at 43% errors.
Got error ‘PHP message: PHP Fatal error: Uncaught Stripe\\Exception\\SignatureVerificationException: No signatures found matching the expected signature for payload in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/Exception/SignatureVerificationException.php:28\nStack trace:\n#0 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/WebhookSignature.php(61): Stripe\\Exception\\SignatureVerificationException::factory(‘No signatures f…’, ‘{\\n “id”: “evt_…’, ‘t=1602668831,v1…’)\n#1 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments/includes/stripe/lib/Webhook.php(29): Stripe\\WebhookSignature::verifyHeader(‘{\\n “id”: “evt_…’, ‘t=1602668831,v1…’, ‘whsec_…’, 300)\n#2 /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/stripe-payments-subscriptions/inc/asp-sub-stripe-webhooks.php(32): Stripe\\Webhook::constructEvent(‘{\\n “id”: “evt_…’, ‘t=1602668831,v1…’, ‘whsec_…’)\n#3 /opt/bitnami/apps/wordpre…\n’
October 14, 2020 at 12:34 pm #3361alexanderfoxcParticipantOk, try to delete both
Live Webhook Signing Secret
andTest Webhook Signing Secret
from Subscriptions add-on settings (just leave those fields blank) and then click “Save Changes” button. This would tell the add-on to not try to check webhook validity using signing secret.Let me know if this helps with PHP errors. Then we will see what can be done to make it work with signing secrets as well.
October 14, 2020 at 1:27 pm #3362[email protected]ParticipantNow this seems an improvement for sure, also I am now able to manually resend requests from Stripe to WP, which had previously failed.
I also notice that it looks like as if the same webhook were set up multiple times (which I did certainly not do manually) – I am having
https://(domain)/?asp_hook=live
five times in the list of webhooks in the Stripe dashboard, with four of these actually tracking activity. Does that make sense?
October 14, 2020 at 4:26 pm #3363alexanderfoxcParticipantfive times in the list of webhooks in the Stripe dashboard, with four of these actually tracking activity. Does that make sense?
Yep, this is definitely is the cause of PHP errors. Also looks like Stripe changed error handling in their SDK, this will be addressed in the upcoming version of Subscriptions add-on.
Anyway, you need to delete all plugin webhooks manually from your Stripe Dashboard that look like https://(domain)/?asp_hook=XXX (both Live and Test). Then create those from Subscriptions tab of Stripe Payments settings, let the signing secrets stay there as well. Then check your Stripe Dashboard to ensure only one of those created for both Live and Test modes.
Let me know if PHP errors are gone after that.
October 15, 2020 at 1:57 pm #3366alexanderfoxcParticipantNew version of Subscriptions add-on has been released. It has proper webhooks-related error handling now, so there should be no PHP errors for this. Errors will be logged into Stripe Payments debug log (if enabled).
October 17, 2020 at 10:24 am #3379[email protected]ParticipantOk thanks, I updated the plugin, removed all extraneous webhooks and created fresh ones through the settings.
So far looking good, but I do see now that I have payments in the WP subscriptions module, which were tracked multiple times by the plugin, even though only one payment was actually made, thus ending the payment plan prematurely.
October 16, 2020, 5:09 pm Subscription ended —
October 16, 2020, 5:09 pm Subscription ended —
October 16, 2020, 5:09 pm Subscription ended —
October 16, 2020, 5:09 pm Subscription ended —
October 16, 2020, 5:09 pm Subscription ended —
October 16, 2020, 5:08 pm Regular payment made $296.00
October 16, 2020, 5:08 pm Regular payment made $296.00
October 16, 2020, 5:08 pm Regular payment made $296.00
October 16, 2020, 5:08 pm Regular payment made $296.00
October 16, 2020, 5:08 pm Subscription createdI guess that is a result of those multiple webhooks? Any way to resolve/fix/reset this from the WP/plugin end, or do we have to resolve this manually?
Thanks!
October 30, 2020 at 10:37 am #3390[email protected]ParticipantSo here is what happened in the meantime. Basically every day, in the backend I would get the warning that the webhook is not existent or configured properly. Simply going to the config module (edit.php?post_type=asp-products&page=stripe-payments-settings#sub), it would in fact find it right away – “Live Webhook Status – Webhook exists”, and upon another refresh the error message on top would go just away by itself.
But today, the webhook has indeed gone missing again, and I had to recreate a new one, and delete the old one in the Stripe dashboard. The test webhook however was still there and fine.
Please, how can this keep happening?
November 2, 2020 at 12:21 pm #3399alexanderfoxcParticipantSomething is deleting live webhook.
Are you using WP Multisite feature BTW? E.g. multiple sites on same domain?
November 5, 2020 at 9:15 am #3408[email protected]ParticipantNo, no multisite. Can you tell me in what form the webhook actually exists? Or how the plugin tries to check for its existence? This could be helpful for narrowing down the issue.
November 5, 2020 at 3:54 pm #3411alexanderfoxcParticipantIt checks if a webhook with following URL exists:
https://yourdomain.com/?asp_hook={mode}
, where{mode}
is eitherlive
ortest
.Is your domain in WP settings in lowercase? E.g.
https://example.com
, nothttps://Example.com
?November 6, 2020 at 9:39 am #3417[email protected]ParticipantYes, but here is something that might be relevant – while it is not multisite, we do access the backend on a subdomain. Could that be an issue? Still as said above, it is able to find it eventually on the settings page itself in 99% of the cases.
As the webhook obviously is not a physical URI, so I am wondering how/where it is being created (thus how it could even be deleted by something else)?
-
AuthorPosts
- You must be logged in to reply to this topic.