2017 © Pedro Peláez
 

library daisycon-api-client

Daisycon API client

image

whitelabeled/daisycon-api-client

Daisycon API client

  • Tuesday, February 6, 2018
  • by geertw
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,645 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

Daisycon API client

Latest Stable Version Total Downloads License, (*1)

Library to retrieve sales from the Daisycon publisher API., (*2)

Usage:, (*3)

Login

<?php
require 'vendor/autoload.php';

session_start();

$client = new \whitelabeled\DaisyconApi\DaisyconClient(
    '123456',
    '848840-9900301-99494595-3994984',
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'http://localhost/verify.php'
);
$login = $client->login();

$_SESSION['state'] = $login->state;
$_SESSION['pkce'] = $login->pkceCode;

echo 'Login URL: ' . $login->loginUrl;

Verify

<?php
require 'vendor/autoload.php';

session_start();

$client = new \whitelabeled\DaisyconApi\DaisyconClient(
    '123456',
    '848840-9900301-99494595-3994984',
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'http://localhost/verify.php'
);

$refreshToken = $client->verifyAuthCode($_SESSION['state'], $_SESSION['pkce'], $_GET['state'], $_GET['code']);

// Store refreshtoken in database or persistent storage

Get transactions

<?php
require 'vendor/autoload.php';

$client = new \whitelabeled\DaisyconApi\DaisyconClient(
    '123456',
    '848840-9900301-99494595-3994984',
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'http://localhost/verify.php'
);

// Refresh token, store new token in DB:
$refreshToken = $client->refreshAccessToken($refreshToken);

// Optional:
//$client->mediaIds = ['666666', '777777'];

$transactions = $client->getTransactions(new DateTime('2016-10-30 00:00:00'));

/*
 * Returns:
Array
(
    [0] => whitelabeled\DaisyconApi\Transaction Object
        (
            [id] => 1KMDIMF49503095MFJULCM
            [partId] => F7I6
            [transactionDate] => DateTime Object
                (
                    [date] => 2016-10-30 22:07:22.000000
                    [timezone_type] => 3
                    [timezone] => Europe/Berlin
                )

            [clickDate] => DateTime Object
                (
                    [date] => 2016-10-30 21:54:09.000000
                    [timezone_type] => 3
                    [timezone] => Europe/Berlin
                )

            [approvalDate] => 
            [lastModifiedDate] => DateTime Object
                (
                    [date] => 2016-10-30 22:07:22.000000
                    [timezone_type] => 3
                    [timezone] => Europe/Berlin
                )

            [programId] => 9999
            [countryId] => 222
            [regionId] => 0
            [gender] => 
            [age] => 0
            [deviceType] => pc
            [program] => Advertisements Inc.
            [ipAddress] => ?.22.33.44
            [status] => open
            [disapprovedReason] => 
            [subId] => 222
            [subId2] => 958503
            [subId3] => 
            [reference] => 
            [commissionAmount] => 6
            [totalCommissionAmount] => 6
            [sharedCommission] => 0
            [commissionPercentage] => 100
            [revenueSharePartner] => 
            [revenue] => 0
            [extra1] => 
            [extra2] => 
            [extra3] => 
            [extra4] => 
            [extra5] => 
            [publisherDescription] => Exciting product
            [mediaId] => 123456
            [mediaName] => Super interesting website
        )

)
*/

License

© Keuze.nl BV, (*4)

MIT license, see LICENSE.txt for details., (*5)

The Versions

06/02 2018

dev-master

9999999-dev

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

06/02 2018

v2.0.1

2.0.1.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

15/01 2018

v2.0.0

2.0.0.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

12/12 2016

v1.1.1

1.1.1.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

07/12 2016

v1.1.0

1.1.0.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

04/11 2016

v1.0.1

1.0.1.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled

04/11 2016

v1.0.0

1.0.0.0

Daisycon API client

  Sources   Download

MIT

The Requires

 

by Whitelabeled