Пример #1
0
 function decrypt($data)
 {
     include_once PATH_CORE . 'crypt.inc.php';
     return CORE_decrypt($data);
 }
 /**
  * Get stored array by passing in database object
  */
 function setBillingFromDBObj(&$ccrs, $rebilling = false)
 {
     if ($ccrs && $ccrs->RecordCount()) {
         // account fields
         if (empty($ccrs->fields['address1'])) {
             if (!$this->setAccountFromDB($ccrs->fields['account_id'])) {
                 return false;
             }
         } else {
             $this->account = array('first_name' => $ccrs->fields['first_name'], 'last_name' => $ccrs->fields['last_name'], 'company' => $ccrs->fields['company'], 'address1' => $ccrs->fields['address1'], 'address2' => $ccrs->fields['address2'], 'city' => $ccrs->fields['city'], 'state' => $ccrs->fields['state'], 'zip' => $ccrs->fields['zip'], 'country_id' => $ccrs->fields['country_id'], 'phone' => $ccrs->fields['phone'], 'company' => $ccrs->fields['company'], 'email' => $ccrs->fields['email']);
         }
         // get the card or eft details & decrypt
         include_once PATH_CORE . 'crypt.inc.php';
         $this->billing['card_type'] = $ccrs->fields['card_type'];
         $this->billing['rebilling'] = $rebilling;
         if ($this->eft || $ccrs->fields['card_type'] == 'eft') {
             // stored eft
             $this->billing['eft_check_acct_type'] = $ccrs->fields['eft_check_acct_type'];
             $this->billing['eft_check_checkno'] = false;
             $this->billing['eft_check_acct'] = CORE_decrypt($ccrs->fields['eft_check_acct']);
             $this->billing['eft_trn'] = CORE_decrypt($ccrs->fields['eft_trn']);
             if (!empty($ccrs->fields['ssn'])) {
                 $this->billing['ssn'] = CORE_decrypt($ccrs->fields['ssn']);
             }
             if (!empty($ccrs->fields['dob'])) {
                 $this->billing['dob'] = CORE_decrypt($ccrs->fields['dob']);
             }
             if (!empty($ccrs->fields['dl_no'])) {
                 $this->billing['dl_no'] = CORE_decrypt($ccrs->fields['dl_no']);
             }
         } else {
             // stored card
             $this->billing['cc_no'] = CORE_decrypt($ccrs->fields['card_num']);
             $this->billing['exp_month'] = $ccrs->fields['card_exp_month'];
             $this->billing['exp_year'] = $ccrs->fields['card_exp_year'];
         }
         /* write back params to global */
         $this->setBillingParams();
         return true;
     } else {
         return false;
     }
 }