magnifinance-rb is a MagniFinance SOAP API client for Ruby.
This is a work in progress (wip), please check the development status.
Add this line to your application's Gemfile:
gem 'magnifinance'
And then execute:
$ bundle
Or install it yourself as:
$ gem install magnifinance
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')
invoices = client.invoces.all
invoice = client.invoices.find('FT FT/1')
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)
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.
- 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.
Magnifinance is free software distributed under the terms of the MIT license reproduced here.