Git Product home page Git Product logo

vault-invoice-builder-client's Introduction

Vault::InvoiceBuilder::Client

A Ruby client for the Vault::InvoiceBuilder HTTP API.

Setting up a development environment

Install dependencies and run the test suite:

bundle install --binstubs vendor/bin
rbenv rehash
rake

Run tests:

rake test

See tasks:

rake -T

Generate API documentation:

rake yard

Using the client

The Vault::InvoiceBuilder API may only be accessed anonymously:

require 'vault-invoice-builder-client'

client = Vault::InvoiceBuilder::Client.new(
  'https://vault-invoice-builder.herokuapp.com')

For endpoints that require authentication, HTTP Basic credentials must be supplied in the URL:

client = Vault::InvoiceBuilder::Client.new(
  'https://username:[email protected]')

Rendering an invoice.

An invoice contains customer contact and tax details, a list of apps and the charges they've incurred by consuming dyno hours and using addons, a list of charges for products the customer used directly, such as a support contract, and credits that have been applied to cover some or all of the charges on the invoice. An invoice is rendered from a receipt, a JSON representation of app and user charges and credits.

receipt = {user: '[email protected]', start_time: , }
html_content = client.render_html(receipt)

Storing an invoice

The store method can be used to render an invoice and then store it to S3. The same receipt JSON object is passed and an empty 200 OK response is returned if the request was successful.

receipt = {user: '[email protected]', start_time: , }
response = client.store(receipt)

vault-invoice-builder-client's People

Contributors

csquared avatar jessieay avatar jkakar avatar kennyp avatar mattmanning avatar nyoo-zz avatar rmcafee avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.