agnostic helpers to use as foundation in packages and other project

2.10.09 2023-09-28 16:57 UTC

This package is auto-updated.

Last update: 2024-05-28 18:39:56 UTC


Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabsInsight

The goal of this Laravel package is to wrap the Publisher Network Affiliate API like Zanox, Tradedoubler, Commission Junction etc.. and provide simple methods to get deals and sales report and return a common interface for your use.


Common methods are:

  • getDeals : get the network deals.
  • getSales : get the network sales.
  • getStats : get the network deals stats.
  • getMerchants : get the network merchants.
  • checkLogin : check if logged in network.
  • login : login in into network.
  • getTrackingParameter : get network tracking params.
  • loadAvailableNetworks : get all available network.
  • hasNetwork : check if network are available.
  • addNetwork : add a network class that implements Network interface.


  • php: >=7.0.0
  • illuminate/support
  • padosoft/support


You can install the package via composer:

$ composer require padosoft/laravel-affiliate-network

You must install this service provider.

// config/app.php
'provider' => [

You don't need to register the command in app/Console/Kernel.php, because it provides by AffiliateNetworkServiceProvider register() method.

You can publish the config file of this package with this command:

php artisan vendor:publish --provider="Padosoft\AffiliateNetwork\AffiliateNetworkServiceProvider"

The following config file will be published in config/laravel-affiliate-network.php

return array(
    'zanox' => array(
        'username' => env(
        'password' => env(
    'tradedoubler' => array(
        'username' => env(
        'password' => env(
    'commissionjunction' => array(
        'username' => env(
        'password' => env(

In your app config folder you can copy from src/config/.env.example the settings for yours .env file used in laravel-affiliate-network.php. If you use mathiasgrimm/laravel-env-validator in src/config folder you'll find an example for validate the env settings.

Networks Supported

  • CommissionJunction
  • Effiliation
  • Netaffiliation
  • TradeDoubler
  • Zanox
  • WebGains


Create new php file, add composer autoload and start using functions.


require "vendor/autoload.php";
//if not 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>';
    echo '</pre>';

In Laravel:


$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>';
    echo '</pre>';

Change log

Please see CHANGELOG for more information what has changed recently.


$ composer test


Please see CONTRIBUTING for details.


If you discover any security related issues, please email instead of using the issue tracker.


About Padosoft

Padosoft ( is a software house based in Florence, Italy. Specialized in E-commerce and web sites.


The MIT License (MIT). Please see License File for more information.