Skip to content

This is a no fuss Google Cloud Function that aims to create a wrapper around the Stripe Node.js SDK allowing for a serverless Stripe deployment

Notifications You must be signed in to change notification settings

astr0sl0th/stripe-gcf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stripe Google Cloud Function

Stripe GCF

MIT License

This is a no fuss Google Cloud Function that aims to create a wrapper around the Stripe Node.js SDK allowing for a serverless Stripe deployment.

Dependencies

Installation

Clone the repository

  git clone git@github.com:astr0sl0th/stripe-gcf.git && cd stripe-gfc

Install gcf-stripe dependencies

  yarn

Running locally

Create a .env file and set your stripe secret test key

  # Your super secret 🔑
  STRIPE_SECRET_KEY=sk_test_123456
  SUBSCRIPTION_PRICE=price_123456

This will start a local server http://localhost:8080

  # 👀 for changes and start server
  yarn watch

Deployment

To deploy gcf-stripe run

  # Build the function
  yarn build 🔧
  # Deploy to google cloud 🚀
  gcloud functions deploy stripe \
  --set-env-vars STRIPE_SECRET_KEY=sk_live_123456 SUBSCRIPTION_PRICE=price123456 \
  --entry-point ./dist/index.js \
  --runtime nodejs14 \
  --trigger-http

TODO

  • Add API documentation
  • Support more stripe functions

About

This is a no fuss Google Cloud Function that aims to create a wrapper around the Stripe Node.js SDK allowing for a serverless Stripe deployment

Topics

Resources

Stars

Watchers

Forks