eelcol / laravel-tradedoubler
Laravel wrapper for the TradeDoubler API
Installs: 2 106
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- illuminate/http: ^7|^8
- illuminate/support: ^7|^8
- spatie/laravel-settings: ^2.0
Requires (Dev)
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^9.5
- spatie/laravel-settings: ^2.0
This package is auto-updated.
Last update: 2025-03-26 03:43:21 UTC
README
composer require eelcol/laravel-tradedoubler
Setup .env
Change your .env to include the following variables:
TRADEDOUBLER_CLIENT_ID=...
TRADEDOUBLER_CLIENT_SECRET=...
TRADEDOUBLER_USERNAME=...
TRADEDOUBLER_PASSWORD=...
Read the following docs to get a clientId and clientSecret:
https://tradedoubler.docs.apiary.io/#/reference/o-auth-2-0/bearer-and-refresh-token
Publish assets
php artisan vendor:publish --tag=laravel-tradedoubler
php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"
Also run the migrations after publishing:
php artisan migrate
Fetch data
Load transactions
use Eelcol\LaravelTradedoubler\Support\Facades\Tradedoubler;
// last 7 days
Tradedoubler::getTransactions(now()->subDays(7), now());
// today only
Tradedoubler::getTransactions(now());
Make another GET call
Currently, only the call to load transactions is build-in. To make another GET call:
use Eelcol\LaravelTradedoubler\Support\Facades\Tradedoubler;
Tradedoubler::get('path', ['param1' => 123]);