/**
  * Save the transaction details to disk in the file name format of:
  * data/logs/transactions/TXN_TYPE/PAYMENT_STATUS.log
  *
  * @return string File name
  * @access private
  */
 private function saveDetailsToFile()
 {
     if ($this->txnIsValid) {
         $logDir1 = realpath(FLUX_DATA_DIR . '/logs/transactions');
         $logDir2 = $logDir1 . '/' . $this->ipnVariables->get('txn_type');
         $logDir3 = $logDir2 . '/' . $this->ipnVariables->get('payment_status');
         $logFile = $logDir3 . '/' . $this->ipnVariables->get('txn_id') . '.log.php';
         if (!is_dir($logDir2)) {
             mkdir($logDir2, 0600);
         }
         if (!is_dir($logDir3)) {
             mkdir($logDir3, 0600);
         }
         $fp = fopen($logFile, 'w');
         if ($fp) {
             fwrite($fp, "<?php exit('Forbidden'); ?>\n");
             foreach ($this->ipnVariables->toArray() as $key => $value) {
                 fwrite($fp, "{$key}: {$value}\n");
             }
             fclose($fp);
             return $logFile;
         }
     }
     return false;
 }
Exemple #2
0
 /**
  *
  */
 public function merge(Flux_Config $config, $recursive = true)
 {
     $mergeMethod = $recursive ? 'array_merge_recursive' : 'array_merge';
     $this->configArr = $mergeMethod($this->configArr, $config->toArray());
 }