Coder Social home page Coder Social logo

skygear-cloud-js-stripe-1's Introduction

skygear-cloud-js-stripe

This demo demostrates the use of Nodejs Skygear Cloud Functions to make payment requests to Stripe.

Skygear is a serverless platform that provides cloud functions hosting for Python and JavaScript routines.

Checkout the tutorial of this demo here: (Coming soon)

Run this project

Setting up

  1. Clone this project to your machine.

    git clone https://github.com/skygear-demo/skygear-cloud-py-stripe.git
    
  2. Get a Skygear account at https://skygear.io/signup. Then update skygearEndpoint and skygearApiKey in public_html/index.js with the endpoint and api key you get from the Developer Portal after signing up.

    const skygearEndpoint = '<your-skygear-app-endpoint>'
    const skygearApiKey= '<your-skygear-app-api-key>'
    
  3. Go to the database broswer at the Developer Portal. Create a user and copy his id. Update the container configuration with the user id you copy in index.js.

    const skygear_container = skygearCloud.getContainer('<your-user-id>')
    

  1. Get a Stripe account at https://dashboard.stripe.com/register. Then update stripePublishableKey in public_html/index.js and require('stripe') in index when the publishable key and secret key you get from the Stripe dashboard (Developers > API keys)

    public_html/index.js

    const stripePublicKey = '<your-stripe-publishable-key>'
    

    index.js

    const stripe = Stripe('<your-stripe-private-key>')
    

Deploy

You can use skycli to deploy cloud functions on to the Skygear cloud.

  1. Install skycli

    npm install skycli -g
    
  2. Sign in to skycli

    skycli login
    
  3. Replace <your-app-name> in skygear.json with your Skygear app name.

    {
      "version": 1,
      "app": "<your-app-name>"
    }
    
  4. In the project directory, run skycli deploy. If you see 'Build completed successfully', it means our cloud functions have been deployed to the Skygear cloud.

    skycli deploy
    
  5. Go to https://<your-app-name>.skygeario.com/static/index.html to test the application. Enjoy!

Support

For bug report, please create an issue. For support and questions, please reach us at the Skygear community.

skygear-cloud-js-stripe-1's People

Contributors

inizio avatar tensiuyan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.