Setting up webhooks for WP Full Stripe

Introduction

The communication between WP Full Stripe and Stripe is one-way by default: the plugin can make requests by calling the Stripe API.

Stripe webhooks make it possible to have bidirectional communication between Stripe and WP Full Stripe, so that Stripe can notify WP Full Stripe when certain events occur.

Some features of WP Full Stripe require webhooks to function.
(For the complete list of features depending on webhooks, please refer to this knowledge base article)

This article documents how to set up webhooks, and how to verify that webhooks work properly.

Setting up webhooks

Follow the steps below to set up Stripe webhooks for WP Full Stripe:

  1. Obtain the plugin webhook endpoint URL in WP admin
    Go to the “Full Stripe -> Settings -> Stripe” page, and copy the value of the “Stripe Webhook URL” field:

  2. Add an endpoint in test mode on the Stripe Dashboard
    Put Stripe in test mode, go to the “Developers -> Webhooks” page, and add a webhook endpoint by pressing the “Add endpoint” button. Make sure to set the webhook version to the latest, and to set sending all event types:

    When added successfully, it’s listed as follows:

  3. Add an endpoint in live mode on the Stripe Dashboard
    Put Stripe in live mode, and follow instructions of step 2).

Verifying webhooks on the Stripe dashboard

You can validate the webhook configuration by sending a test webhook event to WP Full Stripe.

Follow these steps to verify:

  1. Select the webhook configuration to test on the Stripe dashboard
    Go to the “Developers -> Webhooks” page, and click on the URL of the configuration to test.

  2. Start a webhook testing session
    Press the “Send test webhook” button.

  3. Send a webhook event to WP Full Stripe
    Select any event type, and press the “Send test webhook” button.

  4. Observe and evaluate the response of the plugin
    If Stripe says that the “Test webhook sent sucessfully” and the response is “None”, then you have successfully completed the first half the webhook verification.

Verifying webhooks in WP Full Stripe

The easiest way to validate the webhooks setup is to create a “payment in installments”-type subscription form, and make a payment for the first installment in test mode.

Follow these steps to verify:

  1. Put the plugin in test mode
  2. Create a subscription plan with “Payment Cancellation Count” greater than zero
    As an example, a monthly subscription with the cancellation count of 3 would be ended after 3 months):

    This is how the newly created plan looks like on the list page:

  3. Create a subscription form with the plan created in the previous step
  4. Make a test payment
  5. Verify the payment on the subscribers page
    Wait 10 seconds, and go to the “Full Stripe -> Subcriptions -> Subscribers” page in WP admin, and verify that the subscription status is “Running (1 / x)”:

If the subscription status is stuck at “Running (0 / x)” then Stripe cannot reach the webhook URL of WP Full Stripe. If you experience this, please refer to the Troubleshooting section of the knowledge base for more information.

in Getting started