This demo demostrates the use of Python 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)
-
Clone this project to your machine.
git clone https://github.com/skygear-demo/skygear-cloud-py-stripe.git
-
Get a Skygear account at https://skygear.io/signup. Then update
skygearEndpoint
andskygearApiKey
inpublic_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>'
-
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
__init__.py
.def getSkygearContainer(): container = SkygearContainer( api_key=options.masterkey, user_id='<your-user-id>' ) return container
-
Get a Stripe account at https://dashboard.stripe.com/register. Then update
stripePublishableKey
inpublic_html/index.js
andstripe.api_key
in__init__.py
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>'
__init__.py
stripe.api_key = '<your-stripe-secret-key>'
You can use skycli to deploy cloud functions on to the Skygear cloud.
-
Install skycli
npm install skycli -g
-
Sign in to skycli
skycli login
-
Replace
<your-app-name>
inskygear.json
with your Skygear app name.{ "version": 1, "app": "<your-app-name>" }
-
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
-
Go to
https://<your-app-name>.skygeario.com/static/index.html
to test the application. Enjoy!
For bug report, please create an issue. For support and questions, please reach us at the Skygear community.