Cosmic Function that enables you to charge a customer using Stripe.
- 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
- Download code
git clone https://github.com/cosmicjs/stripe-charge-function
- Edit
test-checkout.html
to include the deployed Function endpoint and your Stripe public test key. - Open
test-checkout.html
in the browser and attempt a test charge.
That's it! No managing or maintaining a server, just code and deploy!