An open API service indexing awesome lists of open source software.

https://github.com/cosmicjs/stripe-charge-function

Cosmic Function to charge a customer using Stripe.
https://github.com/cosmicjs/stripe-charge-function

javascript nodejs serverless

Last synced: about 1 year ago
JSON representation

Cosmic Function to charge a customer using Stripe.

Awesome Lists containing this project

README

          

# Stripe Charge Function

Cosmic Function that enables you to charge a customer using [Stripe](https://stripe.com).

### Deploying the Function
1. [Login to Cosmic JS](https://cosmicjs.com) and go to Your Bucket > Settings > Functions > Example Functions
2. Install the Stripe Charge Function
3. Add your STRIPE_SECRET_KEY environment variable
4. Deploy the function and get your endpoint

### Testing the Endpoint
1. Download code
```
git clone https://github.com/cosmicjs/stripe-charge-function
```
2. Edit `test-checkout.html` to include the deployed Function endpoint and your Stripe public test key.
3. Open `test-checkout.html` in the browser and attempt a [test charge](https://stripe.com/docs/testing).

### Maintainence
That's it! No managing or maintaining a server, just code and deploy!