Setting up webhooks

How to make all plugin features work by setting up webhooks.

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

  1. Write down the Stripe webhook URL you can find on the “Full Stripe / Settings / Stripe” page in WP admin.

  2. Go to the Developers / Webhooks page on the Stripe dashboard.

  3. 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:
      • customer.subscription.deleted
      • invoice.payment_succeeded
      • invoice.created
      • charge.succeeded
      • charge.updated
      • charge.refunded
      • charge.pending
      • charge.failed
      • charge.expired
      • charge.captured
  4. Switch to live mode

  5. 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

WP Full Stripe  - Copy webhooks URL

2. Go to the Developers / Webhooks page on the Stripe dashboard, and press the Add endpoint button

Stripe dashboard  - Add webhook endpoint

3. Set endpoint and API version, configure events to send

Stripe dashboard  - Configure endpoint

4. Switch to live mode

Stripe dashboard  - 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:

  1. Go to the Developers / Webhooks page on the Stripe dashboard, and select the webhook you’d like to test.
  2. Press the “Send test webhook…” button.
  3. Select an event (any event will do), and press the “Send test webhook” button.
  4. 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

Stripe dashboard  - Select the webhook to test

2-3. Press the “Send test webhook…” button, and send a test webhook

Stripe dashboard  - Send a test webhook

4. Verify that sending the event was sucessful

Stripe dashboard  - Webhook event sent successfully

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:

  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 in the previous step, embed it into a page.
  4. Use the form to subscribe to the test plan.
  5. 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

WP Full Stripe - Switching the plugin to test mode

2. Create a subscription plan with “Payment cancellation count” greater than zero

WP Full Stripe - Create a plan with payment cancellation count

3. Create a subscripton form with the plan created

WP Full Stripe - Create a subscription form

4. Use the form to subscribe to the test plan

WP Full Stripe - Subscribe

5. Verify the subscription, make sure that status is “Running (1/x)”

WP Full Stripe - Subscriptions

Troubleshooting

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.

Still not finding the solution?

Our support team is happy to help you.

Contact support

Feature requests are always welcome!
We consider each feature request carefully, and examine how it fits the roadmap for the plugin.