Skip to content

Simple function that sends slack notifications based on Stripe events

Notifications You must be signed in to change notification settings

mehyedes/stripe-slack-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stripe-slack-notifier

CI

stripe-slack-notifier is an OpenFaaS function that can be used as a webhook for sending Slack notifications when triggered by Stripe API events( only charge.succeeded events are supported for now).

This function was created to showcase a real-world use case that involves faasd and inlets.

More details can found on the blog post on myedes.io.

Deployment to OpenFaaS

Clone the repository:

$ git clone https://github.com/mehyedes/stripe-slack-notifier.git
$ cd stripe-slack-notifier/

Fetch the python3-http template:

$ faas-cli template pull stack -f stripe-slack-notifier.yml

Create the necessary secrets for the function:

$ export ${OPENFAAS_GATEWAY_URL}
$ faas-cli secret create slack-webhook-url \
  --from-literal=${SLACK_WEBHOOK_URL} --gateway ${OPENFAAS_GATEWAY_URL}
$ faas-cli secret create stripe-secret-key \
  --from-literal=${STRIPE_API_KEY} --gateway ${OPENFAAS_GATEWAY_URL}
$ faas-cli secret create webhook-secret \
  --from-literal=${WEBHOOK_SIGNING_SECRET} --gateway ${OPENFAAS_GATEWAY_URL}
$ faas-cli secret list --gateway ${OPENFAAS_GATEWAY_URL}
NAME
slack-webhook-url
stripe-secret-key
webhook-secret

Deploy to the OpenFaaS gateway

$ faas-cli deploy -f stripe-slack-notifier.yml --gateway ${OPENFAAS_GATEWAY_URL}

About

Simple function that sends slack notifications based on Stripe events

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages