artjoker / cpa
Laravel CPA (Cost Per Action) network integration package
Installs: 3 572
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- illuminate/support: ^5.6|^6.0|^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- mockery/mockery: ^1.4|^1.6
- orchestra/testbench: ^4.0|^5.0|^6.0|^7.0|^8.0
- phpunit/phpunit: ^7||^8.4|^9.3.3
- sempro/phpunit-pretty-print: ^1.0|^1.4
- dev-master
- v3.0.1
- v3.0
- v2.1.29
- v2.1.28
- v2.1.27
- v2.1.26
- v2.1.25
- v2.1.24
- v2.1.23
- v2.1.22
- v2.1.21
- v2.1.20
- v2.1.19
- v2.1.18
- v2.1.17
- v2.1.16
- v2.1.15
- v2.1.14
- v2.1.13
- v2.1.12
- v2.1.11
- v2.1.10
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0
- v1.41
- v1.5.2
- v1.5.1
- v1.5
- v1.4
- v1.3
- v1.2
- v1.0
- dev-dev
- dev-new-cpa-ad-words
- dev-new_cpa_ad_words
This package is auto-updated.
Last update: 2024-10-11 20:02:16 UTC
README
inspired by wearesho-team/bobra-cpa
Laravel Package for CPA networks integration and target customer actions registration in your application. Currently supported: Admitad, Credy, DoAffiliate, Finline, LeadGid, Leads.su, PapaKarlo, Sales Doubler, Storm Digital, Loangate, Appscorp, PAP, GoodAff, LetMeAds, GuruLeads, Nolimit, MoneyGo, LeadLoan.
Installation
Install the package via composer:
$ composer require artjoker/cpa
For Laravel 5.4 and below it necessary to register the service provider
Configuration
In order to edit the default configuration you may execute:
php artisan vendor:publish --provider="Artjoker\Cpa\CpaServiceProvider"
After that, config/cpa.php
will be created.
Environment
This package can be configured by environment variables out-of-box:
- SALES_DOUBLER_ID - personal id for request to SalesDoubler
- SALES_DOUBLER_TOKEN - token for request URI for SalesDoubler
- STORM_DIGITAL_GOAL - (default: 1), goal in URL for StormDigital
- STORM_DIGITAL_SECURE - secure in URL for StormDigital
- PAPA_KARLO_TYPE - ('offer' or 'goal') postback type for PapaKarlo
- PAPA_KARLO_OFFER - (default: 35) personal offer id for PapaKarlo
- PAPA_KARLO_GOAL - (default: 75) personal goal id for PapaKarlo
- PDL_PROFIT_OFFER - ID of the advertiser in the PDL-Profit system
- DO_AFFILIATE_PATH - path for DoAffiliate API (example: pozichka-ua in http://tracker2.doaffiliate.net/pozichka-ua)
- LEADS_SU_TOKEN - token for LeadsSu
- ADMITAD_POSTBACK_KEY - postback request authentication key, constant string 32 char
- ADMITAD_CAMPAIGN_CODE - AdmitAd defined campaign code, constant string 10 char
- ADMITAD_ACTION_CODE - target action code, get it from AdmitAd
- CREDY_OFFER - offer code, get it from Credy
- LET_ME_ADS_PATH - path for LetMeAds API (example: api/v1.1/y7r/dcfgs1tg:awvv47ghn1jv1f$am/get/postback.json)
- GURU_LEADS_PATH - path for GuruLeads API (example: postback)
- CLICK2MONEY_PATH - path for Click2Money API (example: cpaCallback)
- NOLIMIT_PATH - path for Nolimit API (example: postback)
- MONEY_GO_PATH - path for MoneyGo API (example: postback)
- SD_TOP_ID - personal id for request to SD_Top
- SD_TOP_TOKEN - token for request URI for SD_Top
- LEAD_LOAN_PATH - path for LeadLoan API (example: postback)
If one of key for some CPA network not set postback requests for this network will not be done.
Register Middleware
You may register the package middleware in the app/Http/Kernel.php
file:
<?php namespace App\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's route middleware. * * @var array */ protected $routeMiddleware = [ /**** OTHER MIDDLEWARE ****/ 'lead.check' => \Artjoker\Cpa\Middleware\LeadCheckMiddleware::class ]; }
You may add middleware to your group like this:
Route::group( [ 'middleware' => [ 'lead.check' ] ], function(){ //... });
Usage
Create Lead when user registered
CpaLead::createFromCookie(auth()->user()); // or CpaLead::createFromCookie($userId);
When goal is achieved register conversion
CpaConversion::register($user, $transactionId, 'sale');
Events (e.g. 'sale') must be specified in config. You can add additional params for specific events. See config/cpa.php
samples
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.