Skip to content

Latest commit

 

History

History
 
 

2019-10-16-webhooks

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Office Hours 2019-10-16 - Webhooks

Evolve a basic webhook handler from the most primitave to one that follows some recommended best practices for handling Stripe webhooks.

🎬 Watch on YouTube

Getting Started

Follow these instructions to spin-up a copy of this demo project up on your local machine for development and testing purposes. This is meant to be a guide to show you how to go about evolving a webhook handling system.

Prerequisites

Step by Step

  1. Download and Install dependencies
git clone [email protected]:stripe-samples/developer-office-hours.git
cd developer-office-hours/2019-10-16-webhooks
bundle install
  1. Login and start stripe-cli listener

Note: Copy the whsec_xxx key from the output of the listen command.

stripe login
stripe listen --forward-to localhost:3000/webhook_events/stripe
  1. Update API keys
EDITOR=vi rails credentials:edit

Add your Stripe API keys to the Rails credentials.

stripe:
  pk: pk_your_publishable_key
  sk: sk_your_secret_key
  wh: whsec_your_webhook_signing_secret
  1. Update publishable key and SKU for testing in /public/index.html

Create a new product and enable Checkout in your Stripe Dashboard.

  1. Setup Database
rake db:create db:migrate
  1. Start rails server
rails server
  1. Browse to http://localhost:3000