Stripe Charge Function
Cosmic Function that enables you to charge a customer using Stripe.
Deploying the Function
- Login to Cosmic JS and go to Your Bucket > Settings > Functions > Example Functions
- Install the Stripe Charge Function
- Add your STRIPE_SECRET_KEY environment variable
- Deploy the function and get your endpoint
Testing the Endpoint
- Download code
git clone https://github.com/cosmicjs/stripe-charge-function
test-checkout.htmlto include the deployed Function endpoint and your Stripe public test key.
test-checkout.htmlin the browser and attempt a test charge.
That's it! No managing or maintaining a server, just code and deploy!