Socket
Book a DemoInstallSign in
Socket

blnk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blnk

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

Blnk

Easy way to use the blnkfinance.com API in ruby

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add blnk

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install blnk

TODO

  • Create Ledger
  • Find Ledger
  • List Ledgers
  • Search Ledgers
  • Create Balances
  • Find Balance
  • Search Balances
  • Create Transaction
  • Multiple sources / destinations Transaction
  • Refund Transaction
  • Commit inflight Transaction
  • Void inflight Transaction
  • Find Transaction
  • Search Transactions
  • Handler notifications
  • Create Balance Monitor
  • Find Balance Monitor
  • Update Balance Monitor
  • Backup endpoint
  • Backup to S3 endpoint
  • Add Search Contract schema for each resource using they own search attributes
  • Search Result should convert document resul into resource class
  • Use Dry Monads to get success / failure output
  • Use Dry Validation to validate inputs
  • Use Dry Schema instead OpenStruct to handle with resource attributes
  • Use Dry Configuration to better config DSL

Usage

transaction = Blnk::Transaction.find 'transaction_id'

require 'blnk'

# client config

Blnk.address = '192.168.2.7:5001'
Blnk.secret_token = 'your_strong_secret_key'
Blnk.search_api_key = Blnk.secret_token

# Ledgers

ledger = Blnk::Ledger.create(name: 'foobar')
ledger = Blnk::Ledger.find 'ledger_id'
ledgers = Blnk::Ledger.all

ledgers = Blnk::Ledger.search(q: '*')

# Balances
balance = Blnk::Balance.find 'balance_id'
balance = Blnk::Balance.create(ledger_id: 'ledger_id', currency: 'USD')

balances = Blnk::Balance.search(q: '*')

# Transactions
transaction = Blnk::Transaction.find 'transaction_id'
transaction = Blnk::Transaction.create(
  amount: 75,
  reference: 'ref_005',
  currency: 'BRLX',
  precision: 100,
  source: '@world',
  destination: 'bln_469f93bc-40e9-4e0e-b6ab-d11c3638c15d',
  description: 'For fees',
  allow_overdraft: true
)

transaction = Blnk::Transaction.search q: '*'

Result

All methods return a Dry::Monad::Result, so you can use .failure? to check if method was executed and returned a failure (can be validation or a server error). .success? to check if method was executed with successful and access the data from the failure or successful result using .value!. You can check on the dry-monad gem to see other options on Result.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test 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/devton/blnk-ruby

License

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

FAQs

Package last updated on 06 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.