PHP code example of padosoft / laravel-affiliate-network
1. Go to this page and download the library: Download padosoft/laravel-affiliate-network library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
padosoft / laravel-affiliate-network example snippets
ot in laravel need to define this functions
if (!function_exists('public_path')){
function public_path(){
return dirname(__FILE__);
}
}
$objNetworkManager= new NetworkManager();
$objNetworkManager->login('Zanox',$_ENV['ZANOX_USERNAME'], $_ENV['ZANOX_PASSWORD']);
$isLogged = $objNetworkManager->checkLogin('Zanox');
if ($isLogged){
echo '<h1>Deals</h1>';
$arrDeals = $objNetworkManager->getDeals('Zanox');
echo '<pre>';
var_dump($arrDeals);
echo '</pre>';
}
$networkManager=app(NetworkManager::class);
$dateFrom=new DateTime();
$dateTo= new DateTime();
//if you want to specify specific Merchant:
$arrMerchantID = array(
array('cid' => '9716', 'name' => 'Zalando IT')
);
$networkManager->login('Zanox',$_ENV['ZANOX_USERNAME'], $_ENV['ZANOX_PASSWORD']);
$isLogged = $networkManager->checkLogin('Zanox');
if ($isLogged){
echo '<h1>Transactions</h1>';
$transactions = $networkManager->getSales('Zanox',$dateFrom,$dateTo,$arrMerchantID);
echo '<h1>Deals</h1>';
$arrDeals = $networkManager->getDeals('Zanox');
echo '<pre>';
var_dump($arrDeals);
echo '</pre>';
}