suit-it/affilinet-facade

simplifies the usage of the WebService by affili.net

dev-master 2016-03-26 15:15 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:40:17 UTC


README

simplifies the usage of the WebService by affili.net

Installation

Open a command console, enter your project directory and add the following to your composer.json file:

"require": {
  "suit-it/affilinet-facade": "dev-master"
},

Examples

<?php
  define('PUBLISHER_ID', '12345');
  define('PUBLISHER_PASSWORD', 'abcde');

  $publisherLogon = new PublisherLogon(PUBLISHER_ID, PUBLISHER_PASSWORD);
  $publisherService = new PublisherService($publisherLogon);

  $programInfoMessagesResponse = $publisherService->getProgramInfoMessages([
  	'Request' => [
  		'TimeSpan' => PublisherService::TIME_SPAN_LAST_LOGIN,
  		'Query' => '',
  		'MessageStatus' => PublisherService::MESSAGE_STATUS_ALL
  	]
  ]);

  print_r(programInfoMessagesResponse);

Why? See the difference!

getProgramCategories without AffilinetFacade

<?php 

// Send a request to the Logon Service to get an authentication token
$soapLogon = new SoapClient("https://api.affili.net/V2.0/Logon.svc?wsdl");
$token = $soapLogon->Logon(array(
    'Username'  => "AFFILINET_USER_NAME",
    'Password'  => "AFFILINET_PUBLISHER_PASSWORD",
    'WebServiceType' => "Publisher"
));
 
$soapRequest = new SoapClient("https://api.affili.net/V2.0/PublisherProgram.svc?wsdl");
$response = $soapRequest->GetProgramCategories($token);
 
// Show response
print_r($response);

getProgramCategories with AffilinetFacade

  <?php
  use AffilinetFacade;
  
  // Login
  $publisherLogon = new PublisherLogon("AFFILINET_USER_NAME", "AFFILINET_PUBLISHER_PASSWORD");
  $publisherService = new PublisherService($publisherLogon);
  
  // Show response
  print_r($publisherService->getProgramCategories();

License

AffilinetFacade is released under the MIT License.