Odyssey
Public Member Functions | Protected Attributes | List of all members
UpdateIpayV3 Class Reference
Inheritance diagram for UpdateIpayV3:

Public Member Functions

 up ()
 
 down ()
 

Protected Attributes

 $trusted_table = "cutrustedmaster"
 
 $trusted_default
 

Detailed Description

Updates trusted master to include EnrollMICR for IPAY_V3

Definition at line 13 of file 2019080900_UpdateIpayV3.php.

Member Function Documentation

◆ down()

UpdateIpayV3::down ( )

Assuming the previous state was properly added without EnrollMICR, re-add it as such.

Returns
void

Definition at line 128 of file 2019080900_UpdateIpayV3.php.

128  {
129 
130  $def = $this->trusted_default;
131  unset ($def['trustedfields']['EnrollMICR']);
132 
133  $sql = "update {$this->trusted_table} set trustedfields = '"
134  . json_encode($def['trustedfields'])
135  . "' where trustedid = 'IPAY_V3'";
136 
137  $this->query($sql);
138  }

◆ up()

UpdateIpayV3::up ( )

See if IPAY_V3 exists, if so if the EnrollMIRC key is not present update it. If there's more than 1 record, we wind up updating all of them and something else is messed up.

Returns
void

Definition at line 86 of file 2019080900_UpdateIpayV3.php.

86  {
87 
88  if ($this->hasTable($this->trusted_table)) {
89 
90  $def = $this->trusted_default;
91  $ipay_row = $this->fetchRow("select * from {$this->trusted_table} where trustedid = 'IPAY_V3'");
92 
93  if (count($ipay_row) > 0) {
94 
95  $details = json_decode($ipay_row['trustedfields'], 1);
96  if (array_key_exists('EnrollMICR', $details)) {
97 
98  return;
99  }
100 
101  // Else . . .
102  $sql = "update {$this->trusted_table} set trustedfields = '"
103  . json_encode($def['trustedfields'])
104  . "' where trustedid = 'IPAY_V3'";
105 
106  $this->query($sql);
107 
108  return;
109  }
110 
111  if (count($ipay_row) == 0) {
112 
113  $sql = "insert into {$this->trusted_table} (trustedid, trustedvendor, trustedtype, hcuinterface, trustedfields)"
114  . " values('{$def['trustedid']}', '{$def['trustedvendor']}', '{$def['trustedtype']},'"
115  . " '{$def['hcuinterface']}', '" . json_encode($def['trustedfields']) . "'";
116 
117  $this->query($sql);
118  }
119  }
120 
121 
122  }

The documentation for this class was generated from the following file: