You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Nicolas Garnier bb4014c329 Add implicit init to the Stripe sample. 8 years ago
..
functions No adminRef on admin.database() 8 years ago
public Add implicit init to the Stripe sample. 8 years ago
README.md Add implicit init to the Stripe sample. 8 years ago
database.rules.json Adding database rules to the Stripe example 8 years ago
firebase.json Adding hosting to the firebase.json 8 years ago

README.md

Create Stripe customers and charge them on RTDB write

This sample shows how to create Stripe customers and charge them when the Realtime Database is written to.

Further reading:

Functions Code

See file functions/index.js for the code.

The dependencies are listed in functions/package.json.

Deploy and test

To test this integration:

  • Create a Firebase Project using the Firebase Developer Console
  • Enable billing on your project by switching to the Blaze or Flame plan. See pricing for more details. This is required to be able to do requests to non-Google services.
  • Enable Google sign on your Firebase project
  • Configure this sample to use your project using firebase --use add and select your project.
  • Install dependencies locally by running: cd functions; npm install; cd -
  • Add your Stripe API Secret Key to firebase config:
    firebase functions:config:set stripe.token=<YOUR STRIPE API KEY>
    
  • Optional: change your default currency firebase functions:config:set stripe.currency=GBP
  • Pass your Stripe publishable key to the Stripe.setPublishableKey call in public/index.html
  • Deploy your project using firebase deploy
  • Test your Stripe integration by viewing your deployed site firebase open hosting:site