Why do you need webhooks?
There is a one-way communication between WP Full Stripe and Stripe by default; the plugin sends requests to Stripe via the Stripe API.
Stripe webhooks make it possible to send messages in the other direction, Stripe can notify the plugin when certain events occur.
WP Full Stripe is functional without webhooks, but webhooks are required to use the plugin to its full potential.
Which features require webhooks?
For working properly, the following features require webhooks:
- Payment in installments -type subscription plans
- Syncronizing charge status from Stripe to the plugin
(For example, you made a refund in Stripe, not in WP admin)
How to set up webhooks
Setup procedure in a nutshell
Write down the Stripe webhook URL you can find on the “Full Stripe / Settings / Stripe” page in WP admin.
Go to the Developers / Webhooks page on the Stripe dashboard.
- Press the “Add endpoint” button, and fill in the popup form as follows:
- Endpoint URL: Paste the webhook URL of the plugin
- Version: Select your current API version
- Events to send: Select the following events:
Switch to live mode
- Repeat step 3) in live mode
Setup procedure with screenshots
1. Write down the Stripe webhook URL you can find on the Full Stripe / Settings / Stripe page
2. Go to the Developers / Webhooks page on the Stripe dashboard, and press the Add endpoint button
3. Set endpoint and API version, configure events to send
4. Switch to live mode
5. Repeat step 3) in live mode
Verifying webhooks on the Stripe dashboard
You can test your webhooks setup by sending a webhook event to the plugin.
Follow these steps:
- Go to the Developers / Webhooks page on the Stripe dashboard, and select the webhook you’d like to test.
- Press the “Send test webhook…” button.
- Select an event (any event will do), and press the “Send test webhook” button.
- Verify that sending the event was sucessful.
(Stripe must display: “Test webhook sent successfully” and “Response: None”)
If you didn’t get the expected response then please refer to the Troubleshooting section below.
Lets see the test procedure with screenshots:
1. Go to the Developers / Webhooks page on the Stripe dashboard, and select the webhook you’d like to test
2-3. Press the “Send test webhook…” button, and send a test webhook
4. Verify that sending the event was sucessful
Verifying webhooks in WP Full Stripe
The final step to validate your webhooks setup is to create a payment in installments -type subscription plan and a subscription form, and make a test payment for the first installment in test mode.
Follow this steps to validate your webhooks setup in the plugin:
- Switch the plugin to test mode.
- Create a subscription plan with “Payment cancellation count” greater than zero.
- Create a subscripton form with the plan created in the previous step, embed it into a page.
- Use the form to subscribe to the test plan.
- Verify the subscription, make sure that status is “Running (1/x)”.
This is the test procedure with screenshots:
1. Switch the plugin to test mode
2. Create a subscription plan with “Payment cancellation count” greater than zero
3. Create a subscripton form with the plan created
4. Use the form to subscribe to the test plan
5. Verify the subscription, make sure that status is “Running (1/x)”
You’ll find the most common errors with possible solutions in this section.
Webhook sent successfully but response is not empty
You are sending a test webhook from the Stripe dashboard.
Stripe says that “Test webhook sent successfully” but the response is not empty.
This usually means that there is a security plugin blocking the /wp-admin/admin-post.php URL.
Enable this URL for external callers, or add an exception so that the securiy plugin doesn’t block this URL.
Test webhook error: 503. Lookup <your_host>: no such host
This happens when are trying to send a webhook to local test environment, or there are issues with the DNS entries of <your_host>.
Verify your DNS settings, or use a globally accessible domain name for your test site - consider DynDNS or similar.
Test webhook error: 404
It means the webhook URL doesn’t exist.
Maybe a few characters of the URL were left off, consider copying and pasting the webhook URL to Stripe again.