Back to the Learning!

Laracasts is packed full with over 1,000 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Published On Nov. 8th 2016

How to Accept Payments: Testing Stripe Webhooks

Episode 11 Run Time 6:42

Download

I'm sure you're itching to dig into more of Stripe's main API, however, it's vital that we learn how to write the necessary tests to ensure that all billing code works as expected. You never want to be in a situation, where you deploy code one afternoon...only to be woken up in the middle of the night because your subscription sign ups are broken!

To begin, let's learn how to post to our Stripe webhooks endpoint, and then verify that the whenCustomerSubscriptionDeleted method behaves as expected.