1. Home
  2. Functionality
  3. Accepting Webhooks from Stripe

Accepting Webhooks from Stripe

Webhooks allow Stripe to send messages back to your WordPress site. We recommend creating two webhook endpoints: one for test mode and one for live mode.

Setting up webhooks is required for some functionality of WP Simple Pay such as creating installment plans and using it with AffiliateWP.

To add yours, in your Stripe dashboard go to Dashboard > Developer > Webhooks (after toggling test or live mode).

Click Add Endpoint, then add the URL found in Simple Pay Pro > Settings > Stripe Setup tab under Webhooks

We recommend selecting “receive all events” as WP Simple Pay will probably need to use the same webhook endpoint to communicate with your site using features not yet released.

After you add the endpoint you should see the new URL listed in the webhooks settings.

Stripe can optionally sign the webhook events it sends to your endpoints for added security. To do so, retrieve your endpoint’s secret from your Dashboard’s webhooks settings. Select an endpoint for which you want to obtain the secret, then select the Click to reveal button.

Then copy the signing secret from the Stripe Dashboard, and paste it into the Test Endpoint Secret text box in the Simple Pay Pro > Settings > Stripe Setup tab under Webhooks, Test Endpoint Secret

If you’re interested in more details, you can visit Stripe’s doc on using webhooks with subscriptions.

How can I reduce the number of webhook events my site receives?

When choosing to receive all webhook events, you may notice this message:

If you’ve received this message or are otherwise interested in optimizing your setup, you can choose which webhook events to listen for in your Stripe webhooks settings rather than choosing to receive all events:

Currently, the two events that you need to add are `invoice.payment_succeeded` and `payment_intent.succeeded’.

If you decide to specify which webhook events to listen for, you will need to manually check every future release of WP Simple Pay to ensure you are adding the events necessary for proper functionality.

In order to avoid needing to manually add new webhook events when another one is required by WP Simple Pay, we strongly recommend you use ‘receive all events’.

Updated on September 27, 2019

Was this article helpful?

Related Articles