当前位置: 首页>>代码示例>>PHP>>正文


PHP Oara_Utilities类代码示例

本文整理汇总了PHP中Oara_Utilities的典型用法代码示例。如果您正苦于以下问题:PHP Oara_Utilities类的具体用法?PHP Oara_Utilities怎么用?PHP Oara_Utilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Oara_Utilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTransactionList

 /**
  * (non-PHPdoc)
  *
  * @see library/Oara/Network/Oara_Network_Publisher_Base#getTransactionList($merchantId, $dStartDate, $dEndDate)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $dEndDate->addDay(1);
     $valuesFormExport = Oara_Utilities::cloneArray($this->_exportTransactionParameters);
     $valuesFormExport[] = new Oara_Curl_Parameter('pDate1', $dStartDate->toString("MM/d/yyyy"));
     $valuesFormExport[] = new Oara_Curl_Parameter('pDate2', $dEndDate->toString("MM/d/yyyy"));
     $urls = array();
     $urls[] = new Oara_Curl_Request('https://www.auto-europe.co.uk/afftools/iatareport_popup.cfm?', $valuesFormExport);
     $exportReport = $this->_client->post($urls);
     $xmlTransactionList = self::readTransactions($exportReport[0]);
     foreach ($xmlTransactionList as $xmlTransaction) {
         $transaction = array();
         $transaction['merchantId'] = 1;
         $date = new Zend_date($xmlTransaction['Booked'], "MM/dd/yyyy");
         $transaction['date'] = $date->toString("yyyy-MM-dd 00:00:00");
         $transaction['amount'] = (double) $xmlTransaction['commissionValue'];
         $transaction['commission'] = (double) $xmlTransaction['commission'];
         $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
         $transaction['unique_id'] = $xmlTransaction['Res #'];
         if (isset($xmlTransaction['Affiliate1']) && isset($xmlTransaction['Affiliate2'])) {
             $customId = (string) $xmlTransaction['Affiliate1'] . (string) $xmlTransaction['Affiliate2'];
             $customId = "afal-" . current(unpack('H*', base64_decode(str_replace(array(".", "-"), array("/", "+"), $customId))));
             $transaction['custom_id'] = $customId;
         }
         $totalTransactions[] = $transaction;
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:34,代码来源:AutoEurope.php

示例2: __construct

 /**
  * Constructor and Login
  * @param $credentials
  * @return Oara_Network_Publisher_Daisycon
  */
 public function __construct($credentials)
 {
     $this->_credentials = $credentials;
     $dir = COOKIES_BASE_DIR . DIRECTORY_SEPARATOR . $credentials['cookiesDir'] . DIRECTORY_SEPARATOR . $credentials['cookiesSubDir'] . DIRECTORY_SEPARATOR;
     if (!Oara_Utilities::mkdir_recursive($dir, 0777)) {
         throw new Exception('Problem creating folder in Access');
     }
     $cookies = $dir . $credentials["cookieName"] . '_cookies.txt';
     unlink($cookies);
     $this->_options = array(CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0", CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true, CURLOPT_COOKIEJAR => $cookies, CURLOPT_COOKIEFILE => $cookies, CURLOPT_HTTPAUTH => CURLAUTH_ANY, CURLOPT_AUTOREFERER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTPHEADER => array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: es,en-us;q=0.7,en;q=0.3', 'Accept-Encoding: gzip, deflate', 'Connection: keep-alive', 'Cache-Control: max-age=0'), CURLOPT_ENCODING => "gzip", CURLOPT_VERBOSE => false);
 }
开发者ID:rao0088,项目名称:php-oara,代码行数:16,代码来源:Simpl.php

示例3: __construct

 /**
  * Constructor and Login.
  *
  * @param $url -
  *        	Url Login
  * @param $valuesLogin -
  *        	Array with the login parameters
  * @return none
  */
 public function __construct($url, array $valuesLogin, $credentials)
 {
     if (!isset($credentials["cookiesDir"])) {
         $credentials["cookiesDir"] = "Oara";
     }
     if (!isset($credentials["cookiesSubDir"])) {
         $credentials["cookiesSubDir"] = "Import";
     }
     if (!isset($credentials["cookieName"])) {
         $credentials["cookieName"] = "default";
     }
     // Setting cookies
     $isDianomi = $credentials['networkName'] == "Dianomi" ? true : false;
     $isTD = $credentials['networkName'] == "TradeDoubler" || $credentials['networkName'] == "Stream20" || $credentials['networkName'] == "Wehkamp" || $credentials['networkName'] == "Steak";
     // $isAW = $credentials['networkName'] == "AffiliateWindow";
     $dir = COOKIES_BASE_DIR . DIRECTORY_SEPARATOR . $credentials['cookiesDir'] . DIRECTORY_SEPARATOR . $credentials['cookiesSubDir'] . DIRECTORY_SEPARATOR;
     if (!Oara_Utilities::mkdir_recursive($dir, 0777)) {
         throw new Exception('Problem creating folder in Access');
     }
     // Deleting the last cookie
     if ($handle = opendir($dir)) {
         /* This is the correct way to loop over the directory. */
         while (false !== ($file = readdir($handle))) {
             if ($credentials['cookieName'] == strstr($file, '_', true)) {
                 unlink($dir . $file);
                 break;
             }
         }
         closedir($handle);
     }
     $cookieName = $credentials["cookieName"];
     $cookies = $dir . $cookieName . '_cookies.txt';
     $this->_cookiePath = $cookies;
     $this->_options = array(CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:23.0) Gecko/20100101 Firefox/32.0", CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true, CURLOPT_COOKIEJAR => $cookies, CURLOPT_COOKIEFILE => $cookies, CURLOPT_HTTPAUTH => CURLAUTH_ANY, CURLOPT_AUTOREFERER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HEADER => false, CURLOPT_VERBOSE => false);
     // Init curl
     $ch = curl_init();
     $options = $this->_options;
     $options[CURLOPT_URL] = $url;
     $options[CURLOPT_POST] = true;
     $options[CURLOPT_FOLLOWLOCATION] = true;
     // Login form fields
     $arg = self::getPostFields($valuesLogin);
     $options[CURLOPT_POSTFIELDS] = $arg;
     // problem with SMG about the redirects and headers
     if ($isTD) {
         $options[CURLOPT_HEADER] = true;
         $options[CURLOPT_FOLLOWLOCATION] = false;
     }
     curl_setopt_array($ch, $options);
     $result = curl_exec($ch);
     $err = curl_errno($ch);
     $errmsg = curl_error($ch);
     $info = curl_getinfo($ch);
     // Close curl session
     curl_close($ch);
     if ($isDianomi) {
         $result = true;
     }
     while ($isTD && ($info['http_code'] == 301 || $info['http_code'] == 302)) {
         // redirect manually, cookies must be set, which curl does not itself
         // extract new location
         preg_match_all('|Location: (.*)\\n|U', $result, $results);
         $location = implode(';', $results[1]);
         $ch = curl_init();
         $options = $this->_options;
         $options[CURLOPT_URL] = str_replace("/publisher/..", "", $location);
         $options[CURLOPT_HEADER] = true;
         $options[CURLOPT_FOLLOWLOCATION] = false;
         curl_setopt_array($ch, $options);
         $result = curl_exec($ch);
         $err = curl_errno($ch);
         $errmsg = curl_error($ch);
         $info = curl_getinfo($ch);
         curl_close($ch);
     }
     $this->_constructResult = $result;
     if ($result == false) {
         throw new Exception("Failed to connect");
     } else {
         $this->_connected = true;
     }
 }
开发者ID:shivsoji,项目名称:php-oara,代码行数:91,代码来源:Access.php

示例4: getTransactionList

 /**
  * (non-PHPdoc)
  * @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($aMerchantIds, $dStartDate, $dEndDate, $sTransactionStatus)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $context = stream_context_create(array('http' => array('header' => "Authorization: Basic " . base64_encode("{$this->_user}:{$this->_pass}"))));
     $from = urlencode($dStartDate->toString("yyyy-MM-dd HH:mm:ss"));
     $data = file_get_contents("http://api.webepartners.pl/wydawca/Auctions?from={$from}", false, $context);
     $dataArray = json_decode($data, true);
     foreach ($dataArray as $transactionObject) {
         if (in_array($transactionObject["ProgramId"], $merchantList)) {
             $transaction = array();
             $transaction['merchantId'] = $transactionObject["ProgramId"];
             $transaction['date'] = $transactionObject["AuctionDate"];
             if (isset($transactionObject["AuctionId"]) && $transactionObject["AuctionId"] != '') {
                 $transaction['unique_id'] = $transactionObject["AuctionId"];
             }
             if (isset($transactionObject["subID"]) && $transactionObject["subID"] != '') {
                 $transaction['custom_id'] = $transactionObject["subID"];
             }
             if ($transactionObject["AuctionStatusId"] == 3 || $transactionObject["AuctionStatusId"] == 4 || $transactionObject["AuctionStatusId"] == 5) {
                 $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
             } else {
                 if ($transactionObject["AuctionStatusId"] == 1) {
                     $transaction['status'] = Oara_Utilities::STATUS_PENDING;
                 } else {
                     if ($transactionObject["AuctionStatusId"] == 2) {
                         $transaction['status'] = Oara_Utilities::STATUS_DECLINED;
                     } else {
                         if ($transactionObject["AuctionStatusId"] == 6) {
                             $transaction['status'] = Oara_Utilities::STATUS_PAID;
                         }
                     }
                 }
             }
             $transaction['amount'] = Oara_Utilities::parseDouble($transactionObject["OrderCost"]);
             $transaction['commission'] = Oara_Utilities::parseDouble($transactionObject["Commission"]);
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:43,代码来源:WebePartners.php

示例5: getTransactionList

 /**
  * (non-PHPdoc)
  * 
  * @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($aMerchantIds, $dStartDate, $dEndDate, $sTransactionStatus)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $valuesFormExport = array();
     if ($this->_transactionList == null) {
         $urls = array();
         $valuesExport = array(new Oara_Curl_Parameter('D', '{"C":"Pap_Affiliates_Reports_TransactionsGrid", "M":"getCSVFile", "S":"' . $this->_s . '", "FormResponse":"Y", "sort_col":"dateinserted", "sort_asc":false, "offset":0, "limit":30, "columns":[["id"],["id"],["commission"],["totalcost"],["fixedcost"],["t_orderid"],["productid"],["dateinserted"],["name"],["rtype"],["tier"],["commissionTypeName"],["rstatus"],["merchantnote"],["channel"]]}'));
         $urls[] = new Oara_Curl_Request('https://vpnaffiliates.com/affiliates/scripts/server.php?', $valuesExport);
         $exportReport = array();
         $exportReport = $this->_client->post($urls);
         $this->_transactionList = str_getcsv($exportReport[0], "\n");
     }
     $exportData = $this->_transactionList;
     $num = count($exportData);
     for ($i = 1; $i < $num; $i++) {
         $transactionExportArray = str_getcsv($exportData[$i], ",");
         // print_r($transactionExportArray);
         $transaction = array();
         $transaction['merchantId'] = 1;
         $transaction['uniqueId'] = $transactionExportArray[3];
         $transactionDate = new Zend_Date($transactionExportArray[5], 'yyyy-MM-dd HH:mm:ss', 'en');
         $transaction['date'] = $transactionDate->toString("yyyy-MM-dd HH:mm:ss");
         unset($transactionDate);
         $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
         $transaction['amount'] = Oara_Utilities::parseDouble($transactionExportArray[1]);
         $transaction['commission'] = Oara_Utilities::parseDouble($transactionExportArray[0]);
         // print_r($transaction);
         if ($transaction['date'] >= $dStartDate->toString("yyyy-MM-dd HH:mm:ss") && $transaction['date'] <= $dEndDate->toString("yyyy-MM-dd HH:mm:ss")) {
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:38,代码来源:VpnAffiliates.php

示例6: getTransactionList

 /**
  * (non-PHPdoc)
  * @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($idMerchant, $dStartDate, $dEndDate)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $affiliate_id = $this->_id;
     $auth_key = $this->_apikey;
     $strUrl = 'https://www.avantlink.ca/api.php';
     $strUrl .= "?affiliate_id={$affiliate_id}";
     $strUrl .= "&auth_key={$auth_key}";
     $strUrl .= "&module=AffiliateReport";
     $strUrl .= "&output=" . urlencode('csv');
     $strUrl .= "&report_id=8";
     $strUrl .= "&date_begin=" . urlencode($dStartDate->toString("yyyy-MM-dd HH:mm:ss"));
     $strUrl .= "&date_end=" . urlencode($dEndDate->toString("yyyy-MM-dd HH:mm:ss"));
     $strUrl .= "&include_inactive_merchants=0";
     $strUrl .= "&search_results_include_cpc=0";
     $returnResult = self::makeCall($strUrl);
     $exportData = str_getcsv($returnResult, "\r\n");
     $num = count($exportData);
     for ($i = 1; $i < $num; $i++) {
         $transactionExportArray = str_getcsv($exportData[$i], ",");
         if (count($transactionExportArray) > 1 && in_array((int) $transactionExportArray[17], $merchantList)) {
             $transaction = array();
             $merchantId = (int) $transactionExportArray[17];
             $transaction['merchantId'] = $merchantId;
             $transactionDate = new Zend_Date($transactionExportArray[11], 'MM-dd-yyyy HH:mm:ss');
             $transaction['date'] = $transactionDate->toString("yyyy-MM-dd HH:mm:ss");
             $transaction['unique_id'] = (int) $transactionExportArray[5];
             if ($transactionExportArray[4] != null) {
                 $transaction['custom_id'] = $transactionExportArray[4];
             }
             $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
             $transaction['amount'] = Oara_Utilities::parseDouble(preg_replace("/[^0-9\\.,]/", "", $transactionExportArray[6]));
             $transaction['commission'] = Oara_Utilities::parseDouble(preg_replace("/[^0-9\\.,]/", "", $transactionExportArray[7]));
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:shivsoji,项目名称:php-oara,代码行数:42,代码来源:AvantLink.php

示例7: getTransactionList

 /**
  * (non-PHPdoc)
  * @see library/Oara/Network/Oara_Network_Publisher_Base#getTransactionList($merchantId, $dStartDate, $dEndDate)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $totalOverviews = array();
     $urls = array();
     $urls[] = new Oara_Curl_Request('http://book.terravision.eu/partner/my/stats', array());
     $exportReport = $this->_client->get($urls);
     $dom = new Zend_Dom_Query($exportReport[0]);
     $results = $dom->query('input[name="form[_token]"]');
     $token = null;
     foreach ($results as $result) {
         $token = $result->getAttribute("value");
     }
     $valuesFormExport = array();
     $valuesFormExport[] = new Oara_Curl_Parameter('form[year]', $dStartDate->toString("yyyy"));
     $valuesFormExport[] = new Oara_Curl_Parameter('fform[_token]', $token);
     $valuesFormExport[] = new Oara_Curl_Parameter('show', 'Show');
     $urls = array();
     $urls[] = new Oara_Curl_Request('http://book.terravision.eu/partner/my/stats?', $valuesFormExport);
     $exportReport = $this->_client->post($urls);
     $stringToFind = $dStartDate->toString("MM-yyyy");
     /*** load the html into the object ***/
     $dom = new Zend_Dom_Query($exportReport[0]);
     $results = $dom->query('.frame > table');
     $exportData = self::htmlToCsv(self::DOMinnerHTML($results->current()));
     $num = count($exportData);
     $transactionCounter = 0;
     $valueCounter = 0;
     $commissionCounter = 0;
     for ($i = 1; $i < $num - 1; $i++) {
         $transactionArray = str_getcsv($exportData[$i], ";");
         if ($transactionArray[0] == $stringToFind) {
             $transactionCounter = $transactionArray[12];
             $valueCounter += $transactionArray[14];
             $commissionCounter += $transactionArray[16];
         }
     }
     if ($transactionCounter > 0) {
         $dateList = Oara_Utilities::daysOfDifference($dStartDate, $dEndDate);
         for ($i = 0; $i < count($dateList); $i++) {
             $transaction = array();
             $transaction['merchantId'] = 1;
             $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
             $transaction['date'] = $dateList[$i]->toString("yyyy-MM-dd HH:mm:ss");
             $transaction['amount'] = $valueCounter / count($dateList);
             $transaction['commission'] = $commissionCounter / count($dateList);
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:55,代码来源:TerraVision.php

示例8: getTransactionList

 /**
  * (non-PHPdoc)
  * @see library/Oara/Network/Oara_Network_Publisher_Base#getTransactionList($merchantId,$dStartDate,$dEndDate)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     //Set the webservice
     $publisherStatisticsServiceUrl = 'https://api.affili.net/V2.0/PublisherStatistics.svc?wsdl';
     $publisherStatisticsService = new Oara_Import_Soap_Client($publisherStatisticsServiceUrl, array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE, 'soap_version' => SOAP_1_1));
     $iterationNumber = self::calculeIterationNumber(count($merchantList), 100);
     for ($currentIteration = 0; $currentIteration < $iterationNumber; $currentIteration++) {
         $merchantListSlice = array_slice($merchantList, 100 * $currentIteration, 100);
         $merchantListAux = array();
         foreach ($merchantListSlice as $merchant) {
             $merchantListAux[] = (string) $merchant;
         }
         //Call the function
         $params = array('StartDate' => strtotime($dStartDate->toString("yyyy-MM-dd")), 'EndDate' => strtotime($dEndDate->toString("yyyy-MM-dd")), 'TransactionStatus' => 'All', 'ProgramIds' => $merchantListAux);
         $currentPage = 1;
         $transactionList = self::affilinetCall('transaction', $publisherStatisticsService, $params, 0, $currentPage);
         while (isset($transactionList->TotalRecords) && $transactionList->TotalRecords > 0 && isset($transactionList->TransactionCollection->Transaction)) {
             $transactionCollection = array();
             if (!is_array($transactionList->TransactionCollection->Transaction)) {
                 $transactionCollection[] = $transactionList->TransactionCollection->Transaction;
             } else {
                 $transactionCollection = $transactionList->TransactionCollection->Transaction;
             }
             $transactionList = Oara_Utilities::soapConverter($transactionCollection, $this->_transactionConverterConfiguration);
             foreach ($transactionList as $transaction) {
                 //$transaction['merchantId'] = 3901;
                 $tDate = new Zend_Date($transaction["date"], "yyyy-MM-ddTHH:mm:ss");
                 $transaction["date"] = $tDate->toString("yyyy-MM-dd HH:mm:ss");
                 if ($transaction['status'] == 'Confirmed') {
                     $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
                 } else {
                     if ($transaction['status'] == 'Open') {
                         $transaction['status'] = Oara_Utilities::STATUS_PENDING;
                     } else {
                         if ($transaction['status'] == 'Cancelled') {
                             $transaction['status'] = Oara_Utilities::STATUS_DECLINED;
                         }
                     }
                 }
                 $totalTransactions[] = $transaction;
             }
             $currentPage++;
             $transactionList = self::affilinetCall('transaction', $publisherStatisticsService, $params, 0, $currentPage);
         }
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:52,代码来源:AffiliNet.php

示例9: getTransactionList

 /**
  * (non-PHPdoc)
  *
  * @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($aMerchantIds, $dStartDate, $dEndDate)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $valuesFromExport = array();
     $valuesFromExport[] = new Oara_Curl_Parameter('getExcel', '1');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_sSearchMode', 'custom');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_nType', 'sale');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_sPeriod', 'day');
     $valuesFromExport[] = new Oara_Curl_Parameter('export', 'csv');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_nStatus', '3');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_nNbRowsByPage', '50');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_nProgId', '');
     $valuesFromExport[] = new Oara_Curl_Parameter('p_sStartDate', $dStartDate->toString("dd/MM/yyyy"));
     $valuesFromExport[] = new Oara_Curl_Parameter('p_sEndDate', $dEndDate->toString("dd/MM/yyyy"));
     $valuesFromExport[] = new Oara_Curl_Parameter('p_nPage', '1');
     $urls = array();
     $urls[] = new Oara_Curl_Request('http://v2.afilio.com.br/include/lib/aff_lib_manage_sale.php?', $valuesFromExport);
     $exportReport = $this->_client->get($urls);
     $dom = new Zend_Dom_Query($exportReport[0]);
     $tableList = $dom->query('table');
     $exportData = self::htmlToCsv(self::DOMinnerHTML($tableList->next()));
     $num = count($exportData);
     for ($i = 0; $i < $num; $i++) {
         $transactionExportArray = explode(";,", $exportData[$i]);
         if (isset($merchantMap[$transactionExportArray[0]]) && in_array($merchantMap[$transactionExportArray[0]], $merchantList)) {
             $transaction = array();
             $transaction['merchantId'] = $merchantMap[$transactionExportArray[0]];
             $transaction['unique_id'] = $transactionExportArray[4];
             $transactionDate = new Zend_Date($transactionExportArray[1], 'dd/MM/yy HH:mm:dd', 'en');
             $transaction['date'] = $transactionDate->toString("yyyy-MM-dd HH:mm:ss");
             $transaction['customId'] = $transactionExportArray[5];
             if ($transactionExportArray[7] == "Accepted" || $transactionExportArray[7] == "Accepté") {
                 $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
             } else {
                 if ($transactionExportArray[7] == "Pending" || $transactionExportArray[7] == "En attente") {
                     $transaction['status'] = Oara_Utilities::STATUS_PENDING;
                 } else {
                     if ($transactionExportArray[7] == "Rejected" || $transactionExportArray[7] == "Refusé" || $transactionExportArray[7] == "Refused") {
                         $transaction['status'] = Oara_Utilities::STATUS_DECLINED;
                     } else {
                         throw new Exception("New status found {$transactionExportArray[7]}");
                     }
                 }
             }
             $transaction['amount'] = Oara_Utilities::parseDouble(preg_replace('/[^0-9\\.,]/', "", $transactionExportArray[6]));
             $transaction['commission'] = Oara_Utilities::parseDouble(preg_replace('/[^0-9\\.,]/', "", $transactionExportArray[6]));
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:garygarside,项目名称:php-oara,代码行数:56,代码来源:Afilio.php

示例10: getMerchant

 /**
  * Get the merchant for an Id
  * @param integer $merchantId
  * @return array
  */
 public function getMerchant(array $merchantIds = null)
 {
     $merchantList = array();
     if ($merchantIds != null) {
         $iteration = 0;
         $arraySlice = array_slice($merchantIds, $this->_pageSize * $iteration, $this->_pageSize);
         while (!empty($arraySlice)) {
             $params = array();
             $params['aMerchantIds'] = $arraySlice;
             $merchantApiList = $this->_apiClient->getMerchant($params)->getMerchantReturn;
             $merchantList = array_merge($merchantList, Oara_Utilities::soapConverter($merchantApiList, $this->_merchantConverterConfiguration));
             $iteration++;
             $arraySlice = array_slice($merchantIds, $this->_pageSize * $iteration, $this->_pageSize);
         }
     }
     return $merchantList;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:22,代码来源:AffiliateWindow.php

示例11: getPaymentHistory

 /**
  * (non-PHPdoc)
  * @see Oara/Network/Oara_Network_Publisher_Base#getPaymentHistory()
  */
 public function getPaymentHistory()
 {
     $paymentHistory = array();
     $urls = array();
     $valuesFromExport = $this->_exportPaymentParameters;
     $urls[] = new Oara_Curl_Request('http://users.buy.at/ma/index.php/affiliatePayments/paymentsHistory?', $valuesFromExport);
     $exportReport = $this->_client->get($urls);
     $exportData = str_getcsv($exportReport[0], "\r\n");
     $num = count($exportData);
     for ($j = 1; $j < $num; $j++) {
         $paymentData = str_getcsv($exportData[$j], ",");
         $obj = array();
         $date = new Zend_Date($paymentData[0], "dd-MM-yyyy");
         $obj['date'] = $date->toString("yyyy-MM-dd HH:mm:ss");
         $obj['method'] = $paymentData[1];
         $obj['value'] = Oara_Utilities::parseDouble($paymentData[2]);
         $obj['pid'] = $paymentData[4];
         $paymentHistory[] = $obj;
     }
     return $paymentHistory;
 }
开发者ID:garygarside,项目名称:php-oara,代码行数:25,代码来源:BuyAt.php

示例12: getPaymentHistory

 /**
  * (non-PHPdoc)
  * @see Oara/Network/Oara_Network_Base#getPaymentHistory()
  */
 public function getPaymentHistory()
 {
     $paymentHistory = array();
     $urls = array();
     $urls[] = new Oara_Curl_Request('https://publisher.ebaypartnernetwork.com/PublisherAccountPaymentHistory', array());
     $exportReport = $this->_client->get($urls);
     $dom = new Zend_Dom_Query($exportReport[0]);
     $results = $dom->query('table .aruba_report_table');
     if (count($results) > 0) {
         $exportData = self::htmlToCsv(self::DOMinnerHTML($results->current()));
         for ($j = 1; $j < count($exportData); $j++) {
             $paymentExportArray = str_getcsv($exportData[$j], ";");
             $obj = array();
             $paymentDate = new Zend_Date($paymentExportArray[0], "dd/MM/yy", "en");
             $obj['date'] = $paymentDate->toString("yyyy-MM-dd HH:mm:ss");
             $obj['pid'] = $paymentDate->toString("yyyyMMdd");
             $obj['method'] = 'BACS';
             if (preg_match("/[-+]?[0-9]*,?[0-9]*\\.?[0-9]+/", $paymentExportArray[2], $matches)) {
                 $obj['value'] = Oara_Utilities::parseDouble($matches[0]);
             } else {
                 throw new Exception("Problem reading payments");
             }
             $paymentHistory[] = $obj;
         }
     }
     return $paymentHistory;
 }
开发者ID:robryanx,项目名称:php-oara,代码行数:31,代码来源:Ebay.php

示例13: getTransactionList

 /**
  * (non-PHPdoc)
  * @see Oara_Network::getTransactionList()
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $filter = new Zend_Filter_LocalizedToNormalized(array('precision' => 2));
     self::login();
     $valuesFormExport = Oara_Utilities::cloneArray($this->_exportTransactionParameters);
     $valuesFormExport[] = new Oara_Curl_Parameter('startDate', self::formatDate($dStartDate));
     $valuesFormExport[] = new Oara_Curl_Parameter('endDate', self::formatDate($dEndDate));
     $urls = array();
     $urls[] = new Oara_Curl_Request('http://publisher.tradedoubler.com/pan/aReport3Internal.action?', $valuesFormExport);
     $exportReport = $this->_client->get($urls);
     $exportReport[0] = self::checkReportError($exportReport[0], $urls[0]);
     $exportData = str_getcsv($exportReport[0], "\r\n");
     $num = count($exportData);
     for ($i = 2; $i < $num - 1; $i++) {
         $transactionExportArray = str_getcsv($exportData[$i], ",");
         if (!isset($transactionExportArray[2])) {
             throw new Exception('Problem getting transaction\\n\\n');
         }
         if ($transactionExportArray[0] !== '') {
             $transaction = array();
             $transaction['merchantId'] = 1;
             $transactionDate = self::toDate($transactionExportArray[4]);
             $transaction['date'] = $transactionDate->toString("yyyy-MM-dd HH:mm:ss");
             if ($transactionExportArray[8] != '') {
                 $transaction['unique_id'] = $transactionExportArray[8];
             } else {
                 if ($transactionExportArray[7] != '') {
                     $transaction['unique_id'] = $transactionExportArray[7];
                 } else {
                     throw new Exception("No Identifier");
                 }
             }
             if ($transactionExportArray[9] != '') {
                 $transaction['custom_id'] = $transactionExportArray[9];
             }
             if ($transactionExportArray[11] == 'A') {
                 $transaction['status'] = Oara_Utilities::STATUS_CONFIRMED;
             } else {
                 if ($transactionExportArray[11] == 'P') {
                     $transaction['status'] = Oara_Utilities::STATUS_PENDING;
                 } else {
                     if ($transactionExportArray[11] == 'D') {
                         $transaction['status'] = Oara_Utilities::STATUS_DECLINED;
                     }
                 }
             }
             if ($transactionExportArray[18] != '') {
                 $transaction['amount'] = Oara_Utilities::parseDouble($transactionExportArray[18]);
             } else {
                 $transaction['amount'] = Oara_Utilities::parseDouble($transactionExportArray[19]);
             }
             $transaction['commission'] = Oara_Utilities::parseDouble($transactionExportArray[19]);
             $totalTransactions[] = $transaction;
         }
     }
     return $totalTransactions;
 }
开发者ID:netzkind,项目名称:php-oara,代码行数:62,代码来源:Stream20.php

示例14: getPaymentHistory

 /**
  * (non-PHPdoc)
  * @see Oara/Network/Oara_Network_Publisher_Base#getPaymentHistory()
  */
 public function getPaymentHistory()
 {
     $paymentHistory = array();
     foreach ($this->_idBox as $id) {
         $urls = array();
         $paymentExport = array();
         $paymentExport[] = new Oara_Curl_Parameter('idbox_store_id', $id);
         $urls[] = new Oara_Curl_Request($this->_networkServer . "/gp/associates/network/your-account/payment-history.html?", $paymentExport);
         $exportReport = $this->_client->get($urls);
         $dom = new Zend_Dom_Query($exportReport[0]);
         $results = $dom->query('.paymenthistory');
         $count = count($results);
         $yearArray = array();
         if ($count == 1) {
             $paymentTable = $results->current();
             $paymentReport = self::htmlToCsv(self::DOMinnerHTML($paymentTable));
             for ($i = 2; $i < count($paymentReport) - 1; $i++) {
                 $paymentExportArray = str_getcsv($paymentReport[$i], ";");
                 $obj = array();
                 $paymentDate = new Zend_Date($paymentExportArray[0], "M d yyyy", "en");
                 $obj['date'] = $paymentDate->toString("yyyy-MM-dd HH:mm:ss");
                 $obj['pid'] = $paymentDate->toString("yyyyMMdd") . substr((string) base_convert(md5($id), 16, 10), 0, 5);
                 $obj['method'] = 'BACS';
                 if (preg_match("/[0-9]*,?[0-9]*\\.?[0-9]+/", $paymentExportArray[4], $matches)) {
                     $obj['value'] = Oara_Utilities::parseDouble($matches[0]);
                     $paymentHistory[] = $obj;
                 }
             }
         } else {
             //throw new Exception('Problem getting the payments');
         }
     }
     return $paymentHistory;
 }
开发者ID:shivsoji,项目名称:php-oara,代码行数:38,代码来源:Amazon.php

示例15: getTransactionList

 /**
  * (non-PHPdoc)
  * @see library/Oara/Network/Oara_Network_Publisher_Interface#getTransactionList($aMerchantIds, $dStartDate, $dEndDate, $sTransactionStatus)
  */
 public function getTransactionList($merchantList = null, Zend_Date $dStartDate = null, Zend_Date $dEndDate = null, $merchantMap = null)
 {
     $totalTransactions = array();
     $dirDestination = realpath(dirname(__FILE__)) . '/../../data/pdf';
     $now = new Zend_Date();
     if ($now->toString("yyyy-MM") != $dStartDate->toString("yyyy-MM")) {
         $fileName = "S_M_{$this->_apiPassword}_" . $dStartDate->toString("yyyyMM") . ".txt.gz";
         // Raising this value may increase performance
         $buffer_size = 4096;
         // read 4kb at a time
         $local_file = $dirDestination . "/" . $fileName;
         $url = "http://affjet.dc.fubra.net/tools/ItunesConnect/ic.php?user=" . urlencode($this->_user) . "&password=" . urlencode($this->_password) . "&apiPassword=" . urlencode($this->_apiPassword) . "&type=M&date=" . $dStartDate->toString("yyyyMM");
         $context = \stream_context_create(array('http' => array('header' => "Authorization: Basic " . base64_encode("{$this->_httpLogin}"))));
         \file_put_contents($local_file, \file_get_contents($url, false, $context));
         $out_file_name = \str_replace('.gz', '', $local_file);
         // Open our files (in binary mode)
         $file = \gzopen($local_file, 'rb');
         if ($file != null) {
             $out_file = \fopen($out_file_name, 'wb');
             // Keep repeating until the end of the input file
             while (!\gzeof($file)) {
                 // Read buffer-size bytes
                 // Both fwrite and gzread and binary-safe
                 \fwrite($out_file, \gzread($file, $buffer_size));
             }
             // Files are done, close files
             \fclose($out_file);
             \gzclose($file);
             unlink($local_file);
             $salesReport = file_get_contents($out_file_name);
             $salesReport = explode("\n", $salesReport);
             for ($i = 1; $i < count($salesReport) - 1; $i++) {
                 $row = str_getcsv($salesReport[$i], "\t");
                 if ($row[15] != 0) {
                     $sub = false;
                     if ($row[7] < 0) {
                         $sub = true;
                         $row[7] = abs($row[7]);
                     }
                     for ($j = 0; $j < $row[7]; $j++) {
                         $obj = array();
                         $obj['merchantId'] = "1";
                         $obj['date'] = $dEndDate->toString("yyyy-MM-dd") . " 00:00:00";
                         $obj['custom_id'] = $row[4];
                         $comission = 0.3;
                         if ($row[2] == "FUBRA1PETROLPRICES1" || $row[2] == "com.fubra.petrolpricespro.subscriptionYear") {
                             $value = 2.99;
                             $obj['amount'] = Oara_Utilities::parseDouble($value);
                             $obj['commission'] = Oara_Utilities::parseDouble($value - $value * $comission);
                         } else {
                             if ($row[2] == "FUBRA1WORLDAIRPORTCODES1") {
                                 if ($obj['date'] < "2013-04-23 00:00:00") {
                                     $value = 0.6899999999999999;
                                     $obj['amount'] = Oara_Utilities::parseDouble($value);
                                     $obj['commission'] = Oara_Utilities::parseDouble($value - $value * $comission);
                                 } else {
                                     $value = 1.49;
                                     $obj['amount'] = Oara_Utilities::parseDouble($value);
                                     $obj['commission'] = Oara_Utilities::parseDouble($value - $value * $comission);
                                 }
                             } else {
                                 throw new Exception("APP not found {$row[2]}");
                             }
                         }
                         if ($sub) {
                             $obj['amount'] = -$obj['amount'];
                             $obj['commission'] = -$obj['commission'];
                         }
                         $obj['status'] = Oara_Utilities::STATUS_CONFIRMED;
                         $totalTransactions[] = $obj;
                     }
                 }
             }
             unlink($out_file_name);
         }
     } else {
         $dateArray = Oara_Utilities::daysOfDifference($dStartDate, $dEndDate);
         $dateArraySize = sizeof($dateArray);
         for ($z = 0; $z < $dateArraySize; $z++) {
             $transactionDate = $dateArray[$z];
             $fileName = "S_D_{$this->_apiPassword}_" . $transactionDate->toString("yyyyMMdd") . ".txt.gz";
             // Raising this value may increase performance
             $buffer_size = 4096;
             // read 4kb at a time
             $local_file = $dirDestination . "/" . $fileName;
             $url = "http://affjet.dc.fubra.net/tools/ItunesConnect/ic.php?user=" . urlencode($this->_user) . "&password=" . urlencode($this->_password) . "&apiPassword=" . urlencode($this->_apiPassword) . "&type=D&date=" . $transactionDate->toString("yyyyMMdd");
             $context = \stream_context_create(array('http' => array('header' => "Authorization: Basic " . base64_encode("{$this->_httpLogin}"))));
             \file_put_contents($local_file, \file_get_contents($url, false, $context));
             $out_file_name = \str_replace('.gz', '', $local_file);
             // Open our files (in binary mode)
             $file = \gzopen($local_file, 'rb');
             if ($file != null) {
                 $out_file = \fopen($out_file_name, 'wb');
                 // Keep repeating until the end of the input file
                 while (!\gzeof($file)) {
                     // Read buffer-size bytes
//.........这里部分代码省略.........
开发者ID:netzkind,项目名称:php-oara,代码行数:101,代码来源:ItunesConnect.php


注:本文中的Oara_Utilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。