Oara\Network\Publisher\PaidOnResults::getMerchantList PHP Method

getMerchantList() public method

(non-PHPdoc)
public getMerchantList ( )
    public function getMerchantList()
    {
        $merchants = array();
        $valuesFormExport = array(new \Oara\Curl\Parameter('apikey', $this->_apiPassword), new \Oara\Curl\Parameter('Format', 'CSV'), new \Oara\Curl\Parameter('FieldSeparator', 'comma'), new \Oara\Curl\Parameter('AffiliateID', $this->_user), new \Oara\Curl\Parameter('MerchantCategories', 'ALL'), new \Oara\Curl\Parameter('Fields', 'MerchantID,MerchantName,MerchantURL'), new \Oara\Curl\Parameter('JoinedMerchants', 'YES'), new \Oara\Curl\Parameter('MerchantsNotJoined', 'NO'));
        $urls = array();
        $urls[] = new \Oara\Curl\Request('http://affiliate.paidonresults.com/api/merchant-directory?', $valuesFormExport);
        $exportReport = $this->_client->get($urls);
        $exportData = \str_getcsv($exportReport[0], "\r\n");
        $exportData = \preg_replace("/\n/", "", $exportData);
        $num = \count($exportData);
        for ($i = 1; $i < $num; $i++) {
            $merchantExportArray = \str_getcsv($exportData[$i], ",");
            $obj = array();
            $obj['cid'] = $merchantExportArray[0];
            $obj['name'] = $merchantExportArray[1];
            $obj['url'] = $merchantExportArray[2];
            $merchants[] = $obj;
        }
        return $merchants;
    }