diff --git a/packages/vulcan-payments/README.md b/packages/vulcan-payments/README.md index acf654a5f..3d6525be8 100644 --- a/packages/vulcan-payments/README.md +++ b/packages/vulcan-payments/README.md @@ -2,30 +2,18 @@ This package helps you process charges with Vulcan. It currently only supports Stripe, but other payment processors may be supported in the future (PRs welcome!). -### Overview +## Overview This package does the following things: - Provide a button that triggers the [Stripe Checkout](https://stripe.com/checkout) form. -- Once the form is submitted, trigger a GraphQL mutation that will perform the charge. -- The mutation then returns a document associated with the charge. +- Once the form is submitted, trigger a GraphQL mutation that will: + - Perform the charge. + - Create a new Charge. + - Modify a document associated with the charge. +- The mutation then returns a document associated with the charge to the client. -### Charges - -Charges are stored in the database with the following fields: - -- `_id`: the charge's id. -- `createdAt`: the charge's timestamp. -- `userId`: the Vulcan `_id` of the user performing the purchase. -- `tokenId`: the charge token's id. -- `productKey`: the key corresponding to the product being purchased, as defined with `addProduct`. -- `type`: the type of charge (currently only `stripe` is supported). -- `test`: whether the operation is a test or not. -- `data`: a JSON object containing all charge data generated by the payment processor. -- `properties`: a JSON object containing any custom properties passed by the client. -- `ip`: the IP address of the client performing the purchase. - -### Settings +## Settings Stripe requires the following public setting in your `settings.json`. @@ -49,7 +37,22 @@ As well as the following private setting (can be stored in the setting's root or } ``` -### Products +## Charges + +Charges are stored in the database with the following fields: + +- `_id`: the charge's id. +- `createdAt`: the charge's timestamp. +- `userId`: the Vulcan `_id` of the user performing the purchase. +- `tokenId`: the charge token's id. +- `productKey`: the key corresponding to the product being purchased, as defined with `addProduct`. +- `type`: the type of charge (currently only `stripe` is supported). +- `test`: whether the operation is a test or not. +- `data`: a JSON object containing all charge data generated by the payment processor. +- `properties`: a JSON object containing any custom properties passed by the client. +- `ip`: the IP address of the client performing the purchase. + +## Products A product is a type of purchase a user can make. It has a `name`, `amount` (in cents), `currency`, and `description`. @@ -80,7 +83,7 @@ addProduct('book', book => ({ Make sure you define your products in a location accessible to both client and server, in order to access them both on the front-end to configure Stripe Checkout, and in the back-end to perform the actual charge. -### Checkout Component +## Checkout Component ```js