Giter Site home page Giter Site logo

regaliator's Introduction

Regaliator

Ruby wrapper for Regalii's API. The full API docs can be found at: https://www.regalii.com/api/v3/overview

Installation

Add this line to your application's Gemfile:

gem 'regaliator', github: 'regalii/regaliator'

And then execute:

$ bundle

Configuration

Add the following to config/initializers/regaliator.rb:

  Regaliator.configure do |config|
    # Authentication settings
    config.api_key      = 'your-api-key'
    config.secret_key   = 'your-secret-key'

    # API host settings
    config.host         = 'api.casiregalii.com'
    config.open_timeout = 5
    config.read_timeout = 10
    config.use_ssl      = true

    # Proxy settings
    config.proxy_host   = nil
    config.proxy_port   = nil
    config.proxy_user   = nil
    config.proxy_pass   = nil
  end

Requests

Success:

> response = Regaliator::Bill.show(1)
> response.success?
=> true
> response.data
=> {...}
> response = Regaliator::Bill.pay(1, amount: 13.0, currency: 'MXN')
> response.success?
=> true
> response.data
=> {...}

Failure:

> response = Regaliator::Bill.pay(biller_id: 1, account_number: '12345', amount: 0.0, currency: 'MXN')
> response.success?
=> false
> response.data
=> {"code" => "R3", "message" => "Invalid Payment Amount"}

Examples

The following examples will show how to use the Regaliator gem to connect to the different Regalii API endpoints.

Billers List

https://www.regalii.com/billers

response = Regaliator::Biller.utilities

regaliator's People

Contributors

hesham avatar leighhalliday avatar agrberg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.