Skip to content

lmmendes/magnifinance-rb

Repository files navigation

Magnifinance

Build Status Gem Version Maintainability Test Coverage

magnifinance-rb is a MagniFinance SOAP API client for Ruby.

This is a work in progress (wip), please check the development status.

Installation

Add this line to your application's Gemfile:

gem 'magnifinance'

And then execute:

$ bundle

Or install it yourself as:

$ gem install magnifinance

Usage

You'll need to get a username (email) and access token from MagniFinance at https://magnifinance.com/

require 'magnifinance'
client = Magnifinance::Client.new(email: 'your@email.org', token: 'your-token')

Get all invoices

invoices = client.invoces.all

Get a invoice

invoice = client.invoices.find('FT FT/1')

Create invoice

invoice_params = {
  client: {
    nif: '999999990',
    name: 'Consumidor Final',
    address: 'Lisbon',
    zip_code: '1500-000',
    country_code: 'PT'
  },
  invoice: {
    date: '2019-07-08',
    description: 'Awesome product invoice',
    type: 'I',
    euro_rate: 23.0
  },
  products = []
}
invoice = client.invoices.create(invoice_params)

Development

This is the current development status, methods with [x] are already implemented:

  • receipt_create,
  • waybill_create,
  • invoice_payment,
  • receipt_get,
  • waybill_get,
  • invoice_cancel,
  • client_get_data,
  • invoice_add_mb_reference,
  • invoice_get,
  • saft_get,
  • invoice_list,
  • create_subscription,
  • product_get_default,
  • series_get_by_document_type,
  • invoice_create,
  • client_change_locale,
  • get_company_info_by_vat

If you find that the API has another methods that are not declared here, please open a issue.

Bug reports and other issues

Help and Docs

Contributing

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Send me a pull request. Bonus points for topic branches.

License

Magnifinance is free software distributed under the terms of the MIT license reproduced here.

Releases

No releases published

Packages

No packages published