padosoft / php-oara
The goal of the Open Affiliate Report Aggregator (OARA) is to develop a set of PHP classes that can download affiliate reports from a number of affiliate networks, and store the data in a common format.
Requires
- php: >=5.3.0
- ext-curl: *
- phpoffice/phpexcel: 1.8.*
- zendframework/zend-dom: *
- dev-master
- 2.7.15
- 2.7.14
- 2.7.13
- 2.7.12
- 2.7.11
- 2.7.10
- 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.09
- 2.6.08
- 2.6.07
- 2.6.06
- 2.6.05
- 2.6.04
- 2.6.03
- 2.6.02
- 2.6.01
- 2.5.99
- 2.5.98
- 2.5.97
- 2.5.96
- 2.5.95
- 2.5.94
- 2.5.93
- 2.5.92
- 2.5.91
- 2.5.90
- 2.5.89
- 2.5.88
- 2.5.87
- 2.5.86
- 2.5.85
- 2.5.84
- 2.5.83
- 2.5.82
- 2.5.81
- 2.5.80
- 2.5.79
- 2.5.78
- 2.5.77
- 2.5.76
- 2.5.75
- 2.5.74
- 2.5.73
- 2.5.72
- 2.5.71
- 2.5.70
- 2.5.69
- 2.5.68
- 2.5.67
- 2.5.66
- 2.5.65
- 2.5.64
- 2.5.63
- 2.5.62
- 2.5.61
- 2.5.60
- 2.5.59
- 2.5.58
- 2.5.57
- 2.5.56
- 2.5.55
- 2.5.54
- 2.5.53
- 2.5.52
- 2.5.51
- 2.5.50
- 2.5.49
- 2.5.48
- 2.5.47
- 2.5.46
- 2.5.45
- 2.5.44
- 2.5.43
- 2.5.42
- 2.5.41
- 2.5.40
- 2.5.39
- 2.5.38
- 2.5.37
- 2.5.36
- 2.5.35
- 2.5.34
- 2.5.33
- 2.5.32
- 2.5.31
- 2.5.30
- 2.5.29
- 2.5.28
- 2.5.27
- 2.5.26
- 2.5.25
- 2.5.24
- 2.5.23
- 2.5.22
- 2.5.21
- 2.5.20
- 2.5.19
- 2.5.18
- 2.5.17
- 2.5.16
- 2.5.15
- 2.5.14
- 2.5.13
- 2.5.12
- 2.5.11
- 2.5.10
- 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.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
- 2.0
- 1.0
- dev-new_belboon_api
- dev-pepperjam-api
- dev-features/2020-01-15-Lead_Alliance
- dev-features/2019-12-10-PN-LinkShare
- dev-CommissionJunction-GraphQL-API
- dev-2019-01-09-JC-ADMITAD
This package is auto-updated.
Last update: 2024-10-24 13:30:30 UTC
README
The goal of the Open Affiliate Report Aggregator (OARA) is to develop a set of PHP classes that can download affiliate reports from a number of affiliate networks, and store the data in a common format.
We provide a simple structure and make it easy to add new networks using the tools available.
This project is being used as part of AffJet, which offers a hosted Affiliate Aggregator service, with a web interface and additional analysis tools.
Development is sponsored by AffJet but we welcome code contributions from anyone.
License
PHP-OARA is available under a dual license model; either AGPL or a commercial license, depending on your requirements. If you wish to use php-oara in an open source project, or one for internal use only then you can choose the AGPL. If you wish to use php-oara in a commercial project that will be available to external users, then you should contact us for a commercial license.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (LICENSE.TXT).
If you are interested in being a contributor to this project we encourage to read, fill and send this file (FubraLimited-ContributorLicenseAgreement.docx) to support@fubra.com.
Networks Supported
The list of supported networks for Publishers so far is:
- AffiliNet
- Affiliate4You
- AffiliateFuture
- AffiliateGateway
- AffiliateGroove
- AffiliateWindow
- AffiliatesUnited
- Afiliant
- Afilio
- Amazon
- AutoEurope
- AvantLink
- BTGuard
- Belboon
- Bet365
- Bol
- CgtAffiliate
- Chegg
- ClickBank
- ClixGalore
- CommissionFactory
- CommissionJunction
- Daisycon
- Demo
- Dgm
- Dianomi
- DirectTrack
- Ebay
- Effiliation
- Etrader
- FashionTraffic
- FoxTransfer
- GetCake
- Globelink
- GoogleAndroidPublisher
- Groupon
- HasOffers
- HavasMedia
- HideMyAss
- Invia
- Itunes
- Ladbrokers
- LinkShare
- Mall
- MyPcBackUP
- NetAffiliation
- Omnicom
- PaddyPower
- PaidOnResults
- ParkAndGo
- PayMode
- PepperJam
- PepperJam with api
- PerformanceHorizon
- PostAffiliatePro
- PrivateInternetAccess
- Publicidees
- PureVPN
- RentalCars
- SalesMedia
- ShareASale
- Shuttlefare
- SilverTap
- Simpl
- Skimlinks
- SkyParkSecure
- SkyScanner
- Smg
- SportCoverDirect
- Steak
- Stream20
- TerraVision
- TradeDoubler
- TradeTracker
- Tyroo
- Viagogo
- VigLink
- VpnAffiliates
- WebGains
- WebHostingHub
- WebePartners
- Wehkamp
- WinnerAffiliates
- WowTrk
- Zanox
- AffiliateGateway\AU
- AffiliateGateway\UK
- AvantLink\CA
- LinkShare\AU
- LinkShare\BR
- LinkShare\CA
- LinkShare\DE
- LinkShare\EU
- LinkShare\FR
- LinkShare\LA
- LinkShare\UK
- LinkShare\US
System Requirements
To run php-oara you will need to use PHP 5.3, and enable the CURL extension in your php.ini.
Also you will need to have GIT installed in your computer.
Getting Started
Once you have finished these steps you will be able to run the examples for the different networks.
Follow the steps
1. Create the folder with the clone of the code.
git clone https://github.com/fubralimited/php-oara.git php-oara
2. Change the directory to the root of the project
cd php-oara
3. Initialise composer
curl -s https://getcomposer.org/installer | php --
php composer.phar self-update
php composer.phar install
5. test.php
In the examples folder a "test.php" has been provided.
Instantiate a network (new \Oara\Network\Publisher\LinkShare\UK() for example), and set
the needed credentials to login.
PHP OARA on Composer
You can use the package "fubralimited/php-oara" from composer instead to import the library.
Contributing
If you want to contribute, you are welcome, please follow the next steps:
Create your own fork
-
Follow the next instructions to fork your own copy of php-oara. Please read it carefully, as you can also follow the main branch in order to request the last changes in the code.
-
Work on your own repository. Once all the code is in place you are free to add as many networks and improve the code as much as you can.
-
Send a pull request instructions When you think that your code is finished, send us a pull request and we will do the rest!
Follow the structure
We would like you to follow the structure provided. If you want to add a network, please pay attention to the next rules:
-
Create a class in the Oara/Network folder with the name of the network. This class must implement the \Oara\Network Interface
-
Implement the methods needed:
- login
- getNeededCredentials
- checkConnection
- getMerchantList
- getTransactionList
- getPaymentHistory
- paymentTransactions
Network
The network classes must implement the \Oara\Network interface, which includes these methods.
login(array $credentials)
Makes the login process with the credentials provided.
- @param array $credentials - array with credentials to login
getNeededCredentials()
Returns an array with the required parameters to login.
return Array ( Array with required parameters)
checkConnection()
It checks if we are succesfully connected to the network
return boolean (true is connected successfully)
getMerchantList()
Gets the merchants joined for the network
- return Array ( Array of Merchants )
getTransactionList(array $merchantList, \DateTime $dStartDate, \DateTime $dEndDate)
Gets the transactions for the network, from the "dStartDate" until "dEndDate" for the merchants provided
-
@param array $merchantList - array with the merchants unique id we want to retrieve the data from
-
@param \DateTime $dStartDate - start date (included)
-
@param \DateTime $dEndDate - end date (included)
-
@param array $merchantMap - array with the merchants indexed by name, only in case we can't get the merchant id in the transaction report, we may need to link it by name.
-
return Array ( Array of Transactions )
getPaymentHistory()
Gets the Payments already done for this network
- return Array ( Array of Payments )
paymentTransactions($paymentId, $merchantList, $startDate)
Gets the Transactions Id for a paymentId
-
@param array $paymentId - Payment Id of the payment we want the trasactions unique_id list.
-
@param array $merchantList - array with the merchants we want to retrieve the data from
-
@param \DateTime $startDate - start date ,it may be useful to filter the data in some networks
-
return Array ( Array of Transcation unique_id )
Entities
Merchant
It's an array with the following keys:
-
name (not null) - Merchant's name
-
cid (not null) - Merchant's unique id
-
description - Merchant's description
-
url - Merchant's url
Transaction
It's an array with the following keys:
-
merchantId (not null) - Merchant's unique id
-
date (not null) - Transaction date format, "2011-06-26 18:10:10"
-
amount (not null) - Tranasction value (double)
-
commission (not null) - Transaction commission (double)
-
status (not null) - Four different statuses:
- \Oara\Utilities::STATUS_CONFIRMED
- \Oara\Utilities::STATUS_PENDING
- \Oara\Utilities::STATUS_DECLINED
- \Oara\Utilities::STATUS_PAID
-
unique_id - Unique id for the transaction (string)
-
custom_id - Custom id (or sub id) for the transaction (string), custom param you put on your links to see the performance or who made the sale.
Payment
It's an array with the next keys:
-
pid (not null) - Payment's unique id
-
date (not null) - Payment date format, "2011-06-26 18:10:10"
-
value (not null) - Payment value
-
method (not null) - Payment method (BACS, CHEQUE, ...)
Contact
If you have any question, go to the project's website or send an email to support@affjet.com