Stripe and your SubHub website communicate through the webhook. This is how information on events, such as member sign-ups, renewals and cancellations are exchanged.
Setting up your webhook
- Login to Stripe.
- In the right top menu click Developers.
- In the left-hand menu, select Webhooks.
- Click Add an endpoint button.
- In the Endpoint URL field add: https://www.yoursite.com/stripe
- For a sub domain use the format: https://yoursite.com/stripe
- Select Latest API Version (2020-08-27)
Select events to listen to
- Click +Select events
From the list, tick these events:
Under Checkout tick:
-
-
- checkout.session.completed
-
Under Customer tick:
-
-
- customer.subscription.updated
- customer.subscription.trial_will_end
- customer.subscription.deleted
-
Under Invoice tick:
-
-
- invoice.payment_failed
- invoice.payment_succeeded
-
Under Payment Intent tick:
-
-
- payment_intent.payment_failed
- payment_intent.succeeded
-
To complete: Click Add Events
FINAL STEP: Always make a test payment before launching your site.