How to create and use the Stripe's webhooks
In a previous article i've written why are important the webhooks for payments subscriptions. As Braintree, Stripe is a cool payments system which has webhooks and sunscriptions. We can use their webhooks to generate invoices, delete subscriptions and change the plan if the subscription is deleted.
How to create a webhook:
- Sign In here https://dashboard.stripe.com/webhooks
- Click on the button Add endpoint in the Endpoints receiving events from your account area.
- Enter the url https://yourwebsite.com/payments/stripe/guest
- Select two event types: customer.subscription.updated and customer.subscription.deleted
The event types:
- customer.subscription.updated - will notify about subscription renew.
- customer.subscription.deleted - will notify about subscription deletion.
The notifications are submitted as post data and we need to add an exception in the config.php:
$config['csrf_exclude_uris'] = array('payments/stripe/guest');
In the video below you can see how to create webhooks and how them works:
- How to create and use coupons codes in Midrub
- How works the referral program in Midrub
- How to configure the affiliate program in Midrub
- How works 3D secure for Braintree payments
- How to create and use the Stripe's webhooks
- How to manage the subscriptions on Braintree
- Send automatic templates in Facebook Messenger
- Apply coupons codes for the plan upgrade or renew
- How works the fields and options in the Midrub Payments system
- set_gateway - register your payments gateway in the list