Sha256: d258a4d896849f6aa0bc775e9d012181e7c121a03cf7d01da72b1442b7c41d0e

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

## Installation

Calculate parameter and return a code:

```ruby
gem 'codecal'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install codecal

## Usage

```
require 'codecal'

# Generate customer code for user account
# Parameters:
#   account_id : Integer(<=9) --user account_id in acx
#   currency   : String  --currency name
# Return: Hash
#   success       : boolean -- generate customer code success
#   customer code : String  -- 16 numbers string when success == true
#   error         : String  -- error message of parameters when success == false
Codecal.bank_customer_code_generate(account_id, currency)

# Generate simple code for account
# Parameters:
#   account_id : Integer(<=9) --user account_id in acx
# Return: Hash
#   success       : boolean -- generate customer code success
#   customer code : String  -- numbers(account_id.length + 1) string when success == true
#   error         : String  -- error message of parameters when success == false
Codecal.simple_code_generate(account_id)

# Validate customer code
# Parameters:
#   customer_code : String
# Return:
#   valid : boolean
Codecal.validate_bank_customer_code(String)

# Validate simple code
# Parameters:
#   simple_code : String
# Return:
#   valid : boolean
Codecal.validate_simple_code(String)

# Get currency name
# Parameters:
#   currency_code : String(4)
# Return:
#   currency name : String -- nil if not found
Codecal.get_currency_name(String)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
codecal-0.3.4 README.md
codecal-0.3.3 README.md
codecal-0.3.2 README.md