Skip to content

Latest commit

 

History

History
88 lines (53 loc) · 1.72 KB

README.md

File metadata and controls

88 lines (53 loc) · 1.72 KB

jemquarie

Build Status

Jemquarie provides an easy way to interact with Macquarie ESI api. For Ruby and Ruby on Rails.

Installation

Add this line to your application's Gemfile:

gem 'jemquarie'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jemquarie

Usage

For Ruby on Rails

Create an initializer file under config/initializers

The api key needs to be the unhashed value.

require 'jemquarie'
Jemquarie::Jemquarie.api_credentials(YOUR_KEY, YOUR_APPLICATION_NAME, LOG_LEVEl = :warn)

Import transactions

The auth code and password need to be the unhashed values.

  Jemquarie::Importer.new(username, password).cash_transactions(1.day.ago.to_date, Date.today)
  Jemquarie::Importer.new(username, password).cash_transactions(10.years.ago.to_date, Date.today, account_number)

Success with data

The gem should return an array with formatted data. Here an example:

[
 {
   :foreign_identifier => "123456",
   :date_time          => "2013-01-01 00:00:00.000 UTC",
   :amount             => "-200",
   :type_name          => "TYPE",
   :description        => "NARRATIVE",
   :meta_data => {
   :updated_at         => "2013-01-01 03:45:23.876 UTC"
 }
]

Success with no data

It just returns an empty Array

Authentication failure

It returns an Hash {:error => "Invalid credentials"} .

Other available calls are:

  • client balances
  • account details
  • expiry of credentials

Authors

Contributing

See CONTRIBUTING.

Code of Conduct

See CODE_OF_CONDUCT.