Esempio n. 1
0
 /**
  * Prepare the data.
  *
  * This function handles the 'testTransaction' option, which is specific to
  * this processor.
  */
 function _prepare()
 {
     if ($this->_options['testTransaction']) {
         $this->_data['testTransaction'] = $this->_options['testTransaction'];
     }
     $this->_handleCardHolderName();
     return parent::_prepare();
 }
Esempio n. 2
0
 /**
  * Prepare the batch data.
  *
  * This function handles the 'testTransaction' option, which is specific to
  * this processor.
  */
 function _prepare()
 {
     $result = parent::_prepare();
     if ($result !== TRUE) {
         return $result;
     }
     //Build batch file for each type of transaction type.
     if ($this->_payment->getType() == 'EFT') {
         $batch_fields = array('trnType', 'institutionId', 'transitNumber', 'accountNumber', 'trnAmount', 'trnOrderNumber', 'ordName');
         if (is_array($batch_fields)) {
             $batch_data[] = substr($this->_payment->getType(), 0, 1);
             foreach ($batch_fields as $batch_field) {
                 $batch_data[] = $this->_data[$batch_field];
             }
         }
     } elseif ($this->_payment->getType() == 'ACH') {
         $batch_fields = array('trnType', 'routingNumber', 'accountNumber', 'accountCode', 'trnAmount', 'trnOrderNumber', 'ordName');
         if (is_array($batch_fields)) {
             $batch_data[] = substr($this->_payment->getType(), 0, 1);
             foreach ($batch_fields as $batch_field) {
                 if ($batch_field == 'accountCode') {
                     $batch_data[] = 'CC';
                 } else {
                     $batch_data[] = $this->_data[$batch_field];
                 }
             }
         }
     }
     if (is_array($batch_data)) {
         $this->batchFile = implode(',', $batch_data);
     }
     return TRUE;
 }