Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Official Ruby client library for the Invoiced API

License

Notifications You must be signed in to change notification settings

FlickElectric/invoiced-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

invoiced-ruby

This repository contains the Ruby client library for the Invoiced API.

Build Status Coverage Status

Installing

The Invoiced gem can be installed liked this:

gem install invoiced

It can be added to your Gemfile:

source 'https://rubygems.org'

gem 'invoiced'

Requirements

  • Ruby 2.1+
  • rest_client gem
  • jwt gem

Usage

First, you must instantiate a new client

require 'invoiced'

invoiced = Invoiced::Client.new("{API_KEY}")

Then, API calls can be made like this:

# retrieve invoice
invoice = invoiced.Invoice.retrieve("{INVOICE_ID}")

# mark as paid
transaction = invoiced.Transaction.create(
    :invoice => invoice.id,
    :amount => invoice.balance,
    :method => "check")

If you want to use the sandbox API instead then you must set the second argument on the client to true like this:

require 'invoiced'

invoiced = Invoiced::Client.new("{API_KEY}", true)

Developing

The gem can be built with:

gem build invoiced.gemspec

The test suite can be ran with rake test

Packages

No packages published

Languages

  • Ruby 100.0%