Fakturownia
Ruby wrapper around API of invoice service fakturownia.pl
Installation
Add this line to your application's Gemfile:
gem 'fakturownia_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fakturownia_api
Usage
Create a client with api_token
and subdomain
:
client = Fakturownia::Client.new(api_token: 'YOUR_TOKEN', subdomain: 'YOUR_DOMAIN')
Invoices
Create invoice with (full list of available options):
invoice = {
buyer_name: 'Name',
buyer_tax_no: ''
positions: [
{name: 'Product 1', total_price_gross: 10.0, quantity: 2},
{name: 'Product 2', total_price_gross: 20.0, quantity: 4}
]
}
client.invoice.create(ruby_hash)
Download invoice as PDF
client.invoice.show(id, format: :pdf)
Change invoice state
client.invoice.change_status(id, 'paid')
TODO
Currently only invoice resource is supported.
Contributing
- Fork it ( https://github.com/[my-github-username]/fakturownia/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes and tests (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request