padosoft / laravel-affiliate-network
agnostic helpers to use as foundation in packages and other project
Installs: 1 407
Dependents: 0
Suggesters: 0
Security: 0
Stars: 76
Watchers: 13
Forks: 23
Open Issues: 2
Requires
- php: >=7.0.0
- illuminate/support: ^5.0
- padosoft/php-oara: 2.7.14
- padosoft/support: ^1.12
- psr/log: ^1.1
- vlucas/phpdotenv: ^2.4
Requires (Dev)
- phpunit/phpunit: ^5.0
- dev-master
- 2.10.09
- 2.10.08
- 2.10.07
- 2.10.06
- 2.10.05
- 2.10.04
- 2.10.03
- 2.10.02
- 2.10.01
- 2.9.09
- 2.9.08
- 2.9.07
- 2.9.06
- 2.9.05
- 2.9.04
- 2.9.03
- 2.9.02
- 2.9.01
- 2.8.09
- 2.8.08
- 2.8.07
- 2.8.06
- 2.8.05
- 2.8.04
- 2.8.03
- 2.8.02
- 2.8.01
- 2.7.09
- 2.7.08
- 2.7.07
- 2.7.06
- 2.7.05
- 2.7.04
- 2.7.03
- 2.7.02
- 2.7.01
- 2.6.99
- 2.6.98
- 2.6.97
- 2.6.96
- 2.6.95
- 2.6.94
- 2.6.93
- 2.6.92
- 2.6.91
- 2.6.90
- 2.6.89
- 2.6.88
- 2.6.87
- 2.6.86
- 2.6.85
- 2.6.84
- 2.6.83
- 2.6.82
- 2.6.81
- 2.6.80
- 2.6.79
- 2.6.78
- 2.6.77
- 2.6.76
- 2.6.75
- 2.6.74
- 2.6.73
- 2.6.72
- 2.6.71
- 2.6.70
- 2.6.69
- 2.6.68
- 2.6.67
- 2.6.66
- 2.6.65
- 2.6.64
- 2.6.63
- 2.6.62
- 2.6.61
- 2.6.60
- 2.6.59
- 2.6.58
- 2.6.57
- 2.6.56
- 2.6.55
- 2.6.54
- 2.6.53
- 2.6.52
- 2.6.51
- 2.6.50
- 2.6.49
- 2.6.48
- 2.6.47
- 2.6.46
- 2.6.45
- 2.6.44
- 2.6.43
- 2.6.42
- 2.6.41
- 2.6.40
- 2.6.39
- 2.6.38
- 2.6.37
- 2.6.36
- 2.6.35
- 2.6.34
- 2.6.33
- 2.6.32
- 2.6.31
- 2.6.30
- 2.6.29
- 2.6.28
- 2.6.27
- 2.6.26
- 2.6.25
- 2.6.24
- 2.6.23
- 2.6.22
- 2.6.21
- 2.6.20
- 2.6.19
- 2.6.18
- 2.6.17
- 2.6.16
- 2.6.15
- 2.6.14
- 2.6.13
- 2.6.12
- 2.6.11
- 2.6.10
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.9
- 2.5.8
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-new_belboon_api
- dev-pepperjam-api
- dev-features/2020-01-15-Lead_Alliance
- dev-CommissionJunction-GrapQL-API
- dev-features/2019-02-13-JC-TD-MODIFICHE
This package is auto-updated.
Last update: 2024-10-28 19:34:02 UTC
README
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: >=7.0.0
- illuminate/support
- padosoft/support
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
- CommissionJunction
- Effiliation
- Netaffiliation
- Publicideas.com
- TradeDoubler
- Zanox
- WebGains
Usage
Create new php file, add composer autoload and start using functions.
<?php 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>'; var_dump($arrDeals); echo '</pre>'; }
In Laravel:
$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>'; }
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email instead of using the issue tracker.
Credits
About Padosoft
Padosoft (https://www.padosoft.com) is a software house based in Florence, Italy. Specialized in E-commerce and web sites.
License
The MIT License (MIT). Please see License File for more information.