PHP code example of tapfiliate / sdk-php

1. Go to this page and download the library: Download tapfiliate/sdk-php 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/ */

    

tapfiliate / sdk-php example snippets


$logger = new NullLogger();
$helper = new ModelFiller();
$api = new ApiClient($logger, '<Your API key>');

$clickHandler = new ClicksHandler($api, $helper);

$clicks = new Click();
// You can set specific data to Click model (e.g referral code)
$clicks->setReferralCode('<referral code>');
$clickHandler->createClick($clicks);

object(Tapfiliate\Models\Click) {
    ["id":"Tapfiliate\Models\Click":private]=> string(36) "<click id>"
    ["referralCode":"Tapfiliate\Models\Click":private]=> string(6) "<referral code>"
    ["sourceId":"Tapfiliate\Models\Click":private]=> NULL
    ["referrer":"Tapfiliate\Models\Click":private]=> NULL
    ["landingPage":"Tapfiliate\Models\Click":private]=> NULL
    ["userAgent":"Tapfiliate\Models\Click":private]=> NULL
    ["ip":"Tapfiliate\Models\Click":private]=> NULL
    ["metaData":"Tapfiliate\Models\Click":private]=> array(0) {
    }
}

php composer.phar