/Billing

Generic Billing Module, supporting credit card, bitcoin, and other cryptocurrency payments.

Primary LanguageJavaScript

Welcome to the Engine API Billing Module

Install

  1. Ensure Mongo is running: $ mongo (Ctrl+C to quit)
  2. $ sudo npm install -g grunt-cli
  3. $ sudo npm install -g bower

Run

  1. $ npm install
  2. $ grunt
  3. $ node server.js
  4. Access http://localhost:3000

Develop

  1. First, run successfully (above)
  2. $ grunt watch
  3. Edit folders img, less, or src and changes will appear in '_public'
  4. Install LiveReload Chrome extension to take advatage of automatic brower refreshing when editing .html and .less files.
  5. Prefer not to use Bootstrap classes in markup. Instead, reference Bootstrap classes in less files using, e.g., "&:extend(.btn all, .btn-lg all);". See http://lesscss.org/features/#import-options-reference.

engineui UI Toolkit Development

  1. Follow instructions for Develop
  2. Open http://localhost:3000/vendor/engineui/
  3. Copy-paste example Bootstrap code from getbootstrap.com into engineui/index.html
  4. Edit appropriate less files in engineui/less to override Bootstrap styles
  5. Note: override Bootstrap classes, but don't change them. Add classes if necessary, but the idea is to keep as close to the Bootstrap docs as possible.
  6. Helpful hint: reference Bootstrap less files found under _public/vendor/bootstrap/less for guidance on what to override. (Do not modify the Bootstrap sources, however, because changes will be lost.)

IMPORTANT: '_public' is a transient output folder. Do not edit any files here, since changes will be erased.

Code Convention

Front end Javascript is adhering to the jQuery Style Guide to include linting by JSHint (grunt jshint).

CSS property order: http://codeguide.co/#css-declaration-order

HTML attribute order: http://codeguide.co/#html-syntax (see Attribute Order)

REST API Usage

Get all bills: curl -i -X GET http://localhost:3000/bill

Get bill with _id value of 5069b47aa892630aae000007 (use a value that exists in your database): curl -i -X GET http://localhost:3000/bills/5069b47aa892630aae000007

Delete bill with _id value of 5069b47aa892630aae000007: curl -i -X DELETE http://localhost:3000/bills/5069b47aa892630aae000007

Add a new bill: curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "New Bill", "currency": "BTC"}' http://localhost:3000/bills

Modify bill with _id value of 5069b47aa892630aae000007: curl -i -X PUT -H 'Content-Type: application/json' -d '{"name": "New Bill", "currency": "BTC"}' http://localhost:3000/bills/5069b47aa892630aae000007