Simple Stripe API
This library is a simplified version of stripe-meteor, see those docs for a complete reference
Installation
- Create a meteor project
meteor add maxjohansen:simplestripe
Installation from github
- Create a packages directory in the project
- Clone simplestripe into packages folder
- Change back to project root and install package
meteor add simplestripe
Usage
- Add a settings.json file (copy format of samplesettings.json inside of package) to your project root directory and launch meteor
meteor --settings settings.json - Add creditCardForm template inside of your item purchase page. This is used to attach a stripe id to the user object
- Add a listener for
submit .ccformon the template containing creditCardForm and callcreateCustomer(event) - Add a listener for a purchase event. Set item session variable to item for purchase (must have price field). Call
createCharge(event) - Create a global function called
successFunction(called when charge goes through) and set item session variable attributes/update db as needed inside.
Notes
This is a very new project subject to drastic changes. You can use charge.status to get the status of a charge (n/a for no charge submitted).