MonoRuby

Mono-Node is a Ruby wrapper for Mono
For complete information about the API, head to the docs.

Installation

Add this line to your application's Gemfile:

gem 'mono_ruby'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install mono_ruby

Getting Started

  • Register on Mono website and get your Authorization key.
  • Setup your mono connect with your mono public key.


Set Secret Key

monoClient = MonoRuby::Mono.new({
  "secretKey" => "live_sk_xxxxx"
})

Features

  • Wallet Balance
  • Get Account ID. from Auth Code.
  • Account Information
  • Account Statement
  • Poll Account Statement PDF
  • Transactions
  • Income Information
  • Identity
  • Sync Data
  • Re-auth Code
  • Institutions
  • Account Unlink

    # Implementation

- Get Wallet Balance

This resource allows you to check the available balance in your Mono wallet

walletBalance = monoClient.getWalletBalance


- Get Account Id from token

This resource returns the account id (that identifies the authenticated account) after successful enrolment on the Mono connect widget.

accountIdGet = monoClient.getAccountId({"code" => "code_ir9FIYb5HvNcb1tVe9Dp"})


- Get Account Information

This resource returns the account details with the financial institution.

accountInfo = monoClient.getAccountInformation({"accountId" => accountId})


- Get Account Statement in JSON

This resource returns the bank statement of the connected financial account in JSON.
You can query 1-12 months bank statement in one single call.

accountStatement = monoClient.getAccountStatement({
    "accountId" => "6094b18f7f87041b24cb8bc1",
    "period" => "last2months",
    "output" => "json"
})


- Get Account Statement in PDF

This resource returns the bank statement of the connected financial account in PDF.
You can query 1-12 months bank statement in one single call.

accountStatement = monoClient.getAccountStatement({
    "accountId" => "6094b18f7f87041b24cb8bc1",
    "period" => "last2months",
    "output" => "pdf"
})


- Poll Account Statement in PDF

With this resource, you set the output as PDF, and you can use this endpoint to poll the status

pollAccountStatement = monoClient.pollPdfAccountStatementStatus({
    "accountId" => "6094b18f7f87041b24cb8bc1",
    "jobId" => "EqCjlqWoxWu2AgRsMSxX"
})


- Get Account Transactions

This resource returns the known transactions on the account.

accountTransactions = monoClient.getAccountTransactions({
    "accountId" => "6094b18f7f87041b24cb8bc1",
    "paginate" => true,
    "limit" => 10
})


- Get Income Information

This resource will return income information on the account.

accountIncome = monoClient.getIncome({"accountId" => "6094b18f7f87041b24cb8bc1"})


- Get Account Identity

This resource returns a high level overview of an account identity data.

identity = monoClient.getIdentity({"accountId" => "6094b18f7f87041b24cb8bc1"})


- Synchronise Data

This resource attempts to Sync data manually.

dataSync = monoClient.syncDataManually({"accountId" => "6094b18f7f87041b24cb8bc1"})


- Get Re-auth Code.

This resource returns a Re-auth code which is a mono generated code for the account you want to re-authenticate,

reCode = monoClient.reauthCode({"accountId" => "6094b18f7f87041b24cb8bc1"})


- Get Financial Institutions

This resource returns the available institutions on Mono

institutions = monoClient.getInstitutions


This resource provides your customers with the option to unlink their financial account(s)

unlink = monoClient.unlinkAccount({"accountId" => "6094b18f7f87041b24cb8bc1"})

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mono_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the MonoRuby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.