Odyssey
CuAdmin.php
1 <?php
2 /**
3  * PHP CuAdmin Class
4  *
5  * Handles CU properties
6  */
7 class CuAdmin {
8  // stored in cuadmin.flagset
9  const CU_SHOWAVAILABLE = 1; // Show Available balance
10  const CU_SHOWIMAGES = 2; // Check image retrieval on
11  const CU_3RDPARTYRDC = 4; // Use cuadmin.depositlimit for 3rd party remote deposit
12  const CU_MAILTXNS = 8; // Mail copy of transactions to CU
13  const CU_SAVETXNS = 16; // Save copy of transaction in database
14  const CU_COLLECTEMAIL = 32; // Require email addresses on transfers
15  const CU_CALCRUNBAL = 64; // Calculate running balance from account balance
16  const CU_SHOWDEPDIVIDEND = 128; // Show Dividend message on deposit accounts
17  const CU_SHOWLNINTEREST = 256; // Show YTD Interest message on loans
18  const CU_SHOWLNTXNDESC = 512; // Include description when reporting loan transactions
19  const CU_SHOWLNTXNSPLIT = 1024; // Show split principle and interest for loan transactions
20  const CU_HIDENA = 2048; // If loan balance is NA print zero
21  const CU_SORTORDER1 = 4096; // Sort account history transactions by ....accounttype, certnumber, tracenumber desc
22  const CU_SORTORDER2 = 8192; // accounttype, certnumber, date desc, sortkey desc
23  const CU_SORTORDER3 = 16384; // accounttype, certnumber, date desc, tracenumber desc
24  const CU_SORTORDER4 = 32768; // btrim(ab.accounttype,'DIS'),ab.certnumber,ah.date desc, tracenumber desc
25  const CU_LNBALUNUSABLE = 65536; // loanhistory balance missing -- hide the field
26  const CU_LNSORT1 = 131072; // Sort loan history transactions by .... lb.loannumber, lh.date desc, lh.tracenumber desc
27  const CU_LNSORT2 = 262144; // btrim(lb.loannumber,'LC'), lh.date desc, lh.tracenumber desc
28  const CU_QIFDOWN = 524288; // Allow QIF download format
29  const CU_HIDELOANDATE = 1048576; // Hide Loan Next Payment Date
30  const CU_SORTORDER5 = 2097152; // accounttype, certnumber, date desc, oid desc
31  const CU_MNYDOWN = 4194304; // Allow MNY download format Microsoft Money
32  const CU_QKNDOWN = 8388608; // Allow QKN download format Quicken WebConnect
33  const CU_SHOWNCUA = 16777216; // Show NCUA logo on Transfer screen
34  const CU_SHOWLNRATE = 33554432; // Show Current Interest Rates on Loans
35  const CU_SHOWARCLINK = 67108864; // Show link for older check images
36  const CU_MEMRESET = 134217728; // Allow members to reset their own password
37  const CU_ALLOWSWITCH = 268435456; // Allow members to switch to other accounts w/o login
38  const CU_PKT_SWITCH = 536870912; // Switch Account records included in LIVE XAC packet
39  const CU_HIDE_PYR = 1073741824; // Hide Prior Year Interest and Dividends
40  // stored in cuadmin.flagset2
41  const CU2_HIDE_PAYOFF = 1; // Hide Payoff
42  const CU2_CALL_PAYOFF = 2; // Show 'Call' for Payoff
43  const CU2_SPEC18 = 4; // Special Handling for loan type 18 Credit Cards
44  const CU2_SHOWCCRATE = 8; // Show interest rate on credit cards
45  const CU2_SHOWCCLPAY = 16; // Show Credit Card last paid date
46  const CU2_PROCRECUR = 32; // Process Repeating Transactions for this CU, they will NOT be processed until this is set
47  const CU2_ALLOWMESSAGE = 64; // Credit Union uses member messaging feature
48  const CU2_SORTORDER6 = 128; // Sort accounts by .... deposittype, accounttype, certnumber
49  const CU2_SHOWTXDEST = 256; // Show Destination Account Number for LIVE Cross-Accts
50  const CU2_SHOWHOLD = 512; // Show holds; Expect Hold Transactions in live packet
51  const CU2_SHOWCCSB = 1024; // Show Credit Card (type 18) stmnt bal
52  const CU2_USEONLDEP = 2048; // Credit Union uses OnLineDeposits
53  const CU2_CC18NOINFO = 4096; // Type 18 No balance info available
54  const CU2_CC18SHOWZERO = 8192; // Type 18 Show as From/To even if zero available
55  const CU2_HIDE_PASTDUE = 16384; // Hide Loan Past Due marker
56  const CU2_OFX_MEMACCTID = 32768; // OFX Include Member in ACCTID
57  const CU2_OFX_PASSLOAN = 65536; // OFX Include LOAN INFO
58  const CU2_10DAYPAY = 131072; // Show 10-day payoff
59  const CU2_HIDE_CCAVAIL = 262144; // Credit Card Hide Available
60  const CU2_CALL_CCAVAIL = 524288; // Credit Card Show 'Call' for Available
61  const CU2_SHOWBANNER = 1048576; // Show banner add in page top
62  const CU2_ESCHEMA = 2097152; // Use expanded schema for LoanBalance & LoanHistory
63  const CU2_SHOW_LN_ESCROW = 4194304; // Loan History show escrow amount (requires CU2_ESCHEMA)
64  const CU2_SHOW_LN_FEE = 8388608; // Loan History show fee amount (requires CU2_ESCHEMA)
65  const CU2_FRAMEFREE = 16777216; // Present Members with FRAME-FREE home banking scripts -- Menu is loaded from fmenu.html
66  const CU2_ALLOW_MBR_ALERTS = 33554432; // Allow Member Alerts Processing -- Use this to turn on Alert processing for a credit union
67  const CU2_ALIAS_REQ = 67108864; // CU requires user_alias as username
68  const CU2_SHOWPEND = 134217728; // Show pending; Expect pending Txns in live packet
69  const CU2_LNSORT3 = 268435456; // lb.oid, lh.date desc, lh.tracenumber desc
70  const CU2_RANDOM_CHAL = 536870912; // Show only 1 randomized challenge question at a time
71  const CU2_ALIAS_OK = 1073741824; // CU allows user_alias as username
72  // stored in cuadmin.flagset3
73  const CU3_ESTMNT_SIGNUP = 1; // Flag used to see if member should be able to sign up for E-Statements at first login
74  const CU3_ESTMNT_CORE = 2; // Flag for receiving eStatements directly from core
75  const CU3_SHOW_ENROLL = 4; // Flag for allowing members to enroll in home banking by showing button on login page
76  const CU3_ENROLL_MIR = 8; // Flag for having auto activate use the MIR packet
77  const CU3_MFA_AUTHCODE = 16; // CU uses MFA Authcode instead of Challenge Questions
78  const CU3_PREPEND_MBR_DESC = 32; // Prepends members to descriptions without custom message
79  const CU3_MASK_MBR_DESC = 64; // Masks the member number for descriptions without custom message and previous flag set
80  const CU3_API_PLUS = 128; // Use Plus API features (Balance Only, History on demand, M2M)
81  const CU3_API_XAC = 256; // Make a XAC packet request from the core for the member
82  const CU3_LONGCODE_MFA = 512; // By default Odyssey will use Amazon SMS services for sending MFA Codes. If this is set then it will use the LONG CODE associated with CU
83  const CU3_SORTKEY_MICR = 1024; // Allow contents of sortkey from core to override check micr info at HomeCU
84  const CU3_QBDOWN = 2048; // Allow QB download format QuickBooks
85  const CU3_ENROLL_PIN = 4096; // Flag for having auto activate use the core PIN
86  const CU3_DISALLOW_MULTIPLE_ACCOUNTS = 8192; // Flag for disallowing multiple accounts
87  const CU3_DISALLOW_MULT_ACCOUNTS_TRANSFER = 16384; // Flag for disallowing transfers between different accounts
88  const CU3_CREATE_ACCESS_CONTROL_FROM_XAC = 32768; // Flag to determine if we create Access_Control Records from XAC entries instead of the overloaded 000#1234123
89  const CU3_ALLOW_LEAD_ZEROS = 65536; // Allow CU to have leading zeros on member account numbers
90  const CU3_ALLOW_COOKIE_MIGRATION = 131072; // Allow CU to migrate older (device) cookies to the new format
91  const TABLE_NAME = 'cuadmin';
92 
93  //the credit union code to use
94  private $creditUnion;
95  private $cuAdminRepo;
96 
97  //The cu's admin info in an array
98  public $admininfo = [];
99 
100  /**
101  * CuAdmin constructor.
102  * @param string $creditUnion
103  *
104  * @throws Exception
105  */
106  public function __construct(string $creditUnion, CuAdminRepo $cuAdminRepo) {
107 
108  //make sure a valid CU was supplied
109  if ($creditUnion == NULL) {
110  throw new Exception(static::class . ": 01 - Invalid credit union {$this->creditUnion}.");
111  }
112 
113  if (!$cuAdminRepo instanceof CuAdminRepo) {
114  throw new Exception(static::class . ": need instance of CuAdminRepo");
115  }
116 
117  $this->creditUnion = $creditUnion;
118  $this->cuAdminRepo = $cuAdminRepo;
119  $this->Load();
120 
121  }
122 
123  /**
124  * Load the user model with data
125  *
126  * @throws Exception
127  */
128  private function Load() {
129 
130  $this->admininfo = $this->cuAdminRepo->Read($this->creditUnion);
131 
132  if (!$this->admininfo) {
133  throw new Exception(static::class . ": 02 - Invalid credit union {$this->creditUnion}.");
134  }
135 
136  }
137 }
Load()
Definition: CuAdmin.php:128
__construct(string $creditUnion, CuAdminRepo $cuAdminRepo)
Definition: CuAdmin.php:106