PHPackages                             padosoft/laravel-affiliate-network - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. padosoft/laravel-affiliate-network

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

padosoft/laravel-affiliate-network
==================================

agnostic helpers to use as foundation in packages and other project

2.10.09(2y ago)781.4k25[1 issues](https://github.com/padosoft/laravel-affiliate-network/issues)[1 PRs](https://github.com/padosoft/laravel-affiliate-network/pulls)MITPHPPHP &gt;=7.0.0CI failing

Since Feb 26Pushed 10mo ago11 watchersCompare

[ Source](https://github.com/padosoft/laravel-affiliate-network)[ Packagist](https://packagist.org/packages/padosoft/laravel-affiliate-network)[ Docs](https://github.com/padosoft/laravel-affiliate-network)[ RSS](/packages/padosoft-laravel-affiliate-network/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (3)Dependencies (6)Versions (213)Used By (0)

Affiliate Networks API wrapper to provide common interface for affiliate networks publish API like Zanoz, Tradedoubler, Commission Junction etc...
==================================================================================================================================================

[](#affiliate-networks-api-wrapper-to-provide-common-interface-for-affiliate-networks-publish-api-like-zanoz-tradedoubler-commission-junction-etc)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e318e55e1fa206a22b76fd773319693745884eae9ec3048fc046ffb2238243a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061646f736f66742f6c61726176656c2d616666696c696174652d6e6574776f726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/padosoft/laravel-affiliate-network)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/3faa197ff3217101b5263c784fcf89e4da3ad9f7fef43e66c9bbc3649fa3cfa7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7061646f736f66742f6c61726176656c2d616666696c696174652d6e6574776f726b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/padosoft/laravel-affiliate-network)[![Quality Score](https://camo.githubusercontent.com/e9c5f3e0c540d8897746f3253c738ee987d28612ede6111a5a1b1b33cd93945a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7061646f736f66742f6c61726176656c2d616666696c696174652d6e6574776f726b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/padosoft/laravel-affiliate-network)[![Total Downloads](https://camo.githubusercontent.com/3ba8c3fc9dfa0e7d2bb45a4ef33512f637c5b10c811f1cb476c4644f75f337d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061646f736f66742f6c61726176656c2d616666696c696174652d6e6574776f726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/padosoft/laravel-affiliate-network)[![SensioLabsInsight](https://camo.githubusercontent.com/724510486855c177b627dba135f295e5085c7708b9f2c7ce6735e8e2e783271b/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f30303038663163312d333462322d346162642d383831302d3562663538313963653435652e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/0008f1c1-34b2-4abd-8810-5bf5819ce45e)

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.

\##Overview

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.

\##Requires

- php: &gt;=7.0.0
- illuminate/support
- padosoft/support

Installation
------------

[](#installation)

You can install the package via composer:

```
$ composer require padosoft/laravel-affiliate-network
```

You must install this service provider.

```
// config/app.php
'provider' => [
    ...
    Padosoft\AffiliateNetwork\AffiliateNetworkServiceProvider::class,
    ...
];
```

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(
            'ZANOX_USERNAME',
            'padosoft'
        ),
        'password' => env(
            'ZANOX_PASSWORD',
            ''
        )
    ),
    'tradedoubler' => array(
        'username' => env(
            'TRADEDOUBLER_USERNAME',
            'padosoft'
        ),
        'password' => env(
            'TRADEDOUBLER_PASSWORD',
            ''
        )
    ),
    'commissionjunction' => array(
        'username' => env(
            'COMMISSIONJUNCTION_USERNAME',
            'padosoft'
        ),
        'password' => env(
            'COMMISSIONJUNCTION_PASSWORD',
            ''
        )
    ),
);
```

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
------------------

[](#networks-supported)

- CommissionJunction
- Effiliation
- Netaffiliation
- Publicideas.com
- TradeDoubler
- Zanox
- WebGains

Usage
-----

[](#usage)

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

```
