Class: Bayarcash::Fpx

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

Overview

FPX transaction status codes and their human-readable labels.

Constant Summary collapse

STATUS_NEW =
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"



22
23
24
# File 'lib/bayarcash/fpx.rb', line 22

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