Class: Bayarcash::DuitNow::Dobw

Inherits:
Object
  • Object
show all
Defined in:
lib/bayarcash/duit_now/dobw.rb

Overview

DuitNow Online Banking / Wallet (DOBW) account types and status codes.

Constant Summary collapse

CASA =
"01"
CREDIT_CARD =
"02"
EWALLET =
"03"
STATUS_NEW =

Status code

0
STATUS_PENDING =
1
STATUS_FAILED =
2
STATUS_SUCCESS =
3
STATUS_CANCELLED =
4
STATUS_LABELS =
{
  STATUS_NEW       => "New",
  STATUS_PENDING   => "Pending",
  STATUS_CANCELLED => "Cancelled",
  STATUS_SUCCESS   => "Successful",
  STATUS_FAILED    => "Failed"
}.freeze

Class Method Summary collapse

Class Method Details

.get_status_text(status_code) ⇒ String

Returns label for the status, or "UNKNOWN STATUS".

Parameters:

  • status_code (Integer)

Returns:

  • (String)

    label for the status, or "UNKNOWN STATUS"



28
29
30
# File 'lib/bayarcash/duit_now/dobw.rb', line 28

def self.get_status_text(status_code)
  STATUS_LABELS.fetch(status_code.to_i, "UNKNOWN STATUS")
end