Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.52 KB

readme.md

File metadata and controls

66 lines (46 loc) · 1.52 KB

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 [email protected]: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