opyate / stripe-event-handler

Flask/PostgresQL -based event handler for Stripe webhooks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table of Contents

Intro

A Stripe event handler.

Deploy

Adding handlers

If the Stripe event is called foo.bar, add the following module:

mkdir -p handlers/foo/bar
touch handlers/foo/bar/__init__.py

Add a function to this new script:

def handle(event_json):
    print('A foo.bar event handler!')

Usage

curl -X POST -d '{"type":"foo.bar", "other": "stuff"}' http://0.0.0.0:5000/stripe -H 'Content-Type: application/json'

STDOUT:

Handling event type=foo.bar
{'type': 'foo.bar', 'other': 'stuff'}
A foo.bar event handler!

About

Flask/PostgresQL -based event handler for Stripe webhooks.


Languages

Language:Python 91.5%Language:Mako 7.3%Language:HTML 1.3%