Class: Bayarcash::FpxDirectDebit
- Inherits:
-
Object
- Object
- Bayarcash::FpxDirectDebit
- Defined in:
- lib/bayarcash/fpx_direct_debit.rb
Overview
FPX Direct Debit constants: application types, payer id types, frequency modes, and mandate status codes, together with their human-readable labels.
Constant Summary collapse
- ENROLMENT =
Application type
"01"- MAINTENANCE =
"02"- TERMINATION =
"03"- NRIC =
Buyer / payer ID type
1- OLD_IC =
2- PASSPORT =
3- BUSINESS_REGISTRATION =
4- OTHERS =
5- MODE_DAILY =
Frequency mode
"DL"- MODE_WEEKLY =
"WK"- MODE_MONTHLY =
"MT"- MODE_YEARLY =
"YR"- STATUS_NEW =
Status code
0- STATUS_WAITING_APPROVAL =
1- STATUS_FAILED_BANK_VERIFICATION =
2- STATUS_ACTIVE =
3- STATUS_TERMINATED =
4- STATUS_APPROVED =
5- STATUS_REJECTED =
6- STATUS_CANCELLED =
7- STATUS_ERROR =
8- STATUS_LABELS =
{ STATUS_NEW => "New", STATUS_WAITING_APPROVAL => "Waiting Approval", STATUS_FAILED_BANK_VERIFICATION => "Bank Verification Failed", STATUS_APPROVED => "Approved", STATUS_REJECTED => "Rejected", STATUS_CANCELLED => "Cancelled", STATUS_ERROR => "Error", STATUS_ACTIVE => "Active", STATUS_TERMINATED => "Terminated" }.freeze
Class Method Summary collapse
- .get_application_type_text(application_type) ⇒ String?
- .get_frequency_mode_text(frequency_mode_code) ⇒ String?
-
.get_status_text(status_code) ⇒ String
Label for the status, or "UNKNOWN STATUS".
Class Method Details
.get_application_type_text(application_type) ⇒ String?
56 57 58 59 60 61 62 |
# File 'lib/bayarcash/fpx_direct_debit.rb', line 56 def self.get_application_type_text(application_type) case application_type when ENROLMENT then "Enrollment" when MAINTENANCE then "Maintenance" when TERMINATION then "Termination" end end |
.get_frequency_mode_text(frequency_mode_code) ⇒ String?
66 67 68 69 70 71 72 73 |
# File 'lib/bayarcash/fpx_direct_debit.rb', line 66 def self.get_frequency_mode_text(frequency_mode_code) case frequency_mode_code when MODE_DAILY then "Daily" when MODE_WEEKLY then "Weekly" when MODE_MONTHLY then "Monthly" when MODE_YEARLY then "Yearly" end end |
.get_status_text(status_code) ⇒ String
Returns label for the status, or "UNKNOWN STATUS".
50 51 52 |
# File 'lib/bayarcash/fpx_direct_debit.rb', line 50 def self.get_status_text(status_code) STATUS_LABELS.fetch(status_code.to_i, "UNKNOWN STATUS") end |