stripe-connect-functions
stripe-connect-functions copied to clipboard
A collection of functions to help with a Customers -> Marketplace -> Vendors Workflow using Stripe Connect (https://stripe.com/connect)
stripe-connect-functions 
This package provides a collection of functions to help with a Customers -> Marketplace -> Vendors Workflow using Stripe Connect.
All the provided functions internally uses the official NodeJS library for Stripe.
Example Workflow
The following activity diagrams try to elucidate a rudimentary workflow. The various stages are labelled with the librarry function names to use in each case.
Installation & Basic Usage
-
Set up a Stripe Connect Account and obtain the Secret key, which is in the form
sk_myapp_k9DHwQESw7ntTGzdjS7vFsHs
-
Install:
npm install stripe-connect-functions
-
Initialize:
const stripeConnect = require("stripe-connect-functions")("sk_myapp_k9DHwQESw7ntTGzdjS7vFsHs") // ^^ Remember to replace with your own key!
-
Use:
stripeConnect.fetchCustomerCards("cus_Ckc6NCwnBdzDCb") .then(console.log, console.log) // returns a Promise!
For details, check the Api Docs HERE.
Testing
For Unit Tests, Ava is being used. Code Coverage is provided by nyc/istanbul. All calls to the Stripe API are stubbed.
To run the included tests:
npm run test
## Or, if you don't want code coverage:
npm run test:nocoverage