1. Go to this page and download the library: Download directaff/php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
directaff / php-sdk example snippets
use DirectAff\DirectAff;
$directAff = new DirectAff();
$directAff->setBaseUrl('YOUR_API_BASE_URL')
->setSecretApiKey('YOUR_SECRET_API_KEY')
->setBrandId(YOUR_BRAND_ID);
$response = $directAff->register([
'clickId' => 'exampleClickId',
'identification' => 'exampleUsername', // it can be username or email or phone, userId
'registration_date' => '2023-01-01 00:00:00'
]);
$response = $directAff->registerThroughPromoCode([
'promoCode' => 'examplePromoCode',
'identification' => 'exampleUsername', // it can be username or email or phone, userId
'ipAddress' => '127.0.0.1',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)',
'registration_date' => '2023-01-01 00:00:00'
]);