Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 71 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
# tradetracker-api-client
TradeTracker API client
# TradeTracker API client

A TradeTracker API client to communicate with the webservice and map results to real model objects.

[![Build Status](https://travis-ci.org/hypeit/tradetracker-api-client.svg?branch=master)](https://travis-ci.org/hypeit/tradetracker-api-client)
[![Total Downloads](https://poser.pugx.org/hypeit/tradetracker-api-client/downloads.svg)](https://packagist.org/packages/hypeit/tradetracker-api-client)
[![Latest Stable Version](https://poser.pugx.org/hypeit/tradetracker-api-client/v/stable.svg)](https://packagist.org/packages/hypeit/tradetracker-api-client)

## Installation

You can install the package via composer:
```bash
$ composer require hypeit/tradetracker-api-client
```

You must configure authentication in order to use the client.

```php
$authentication = new Authentication(
12345, // The customer id
'passphrase', // The passphrase
true, // Whether to not allow changes (optional)
'en_GB', // The locale to be used for results. (optional)
false // Whether to receive demo results. (optional)
);
```

Then inject the wsdl and the authentication object into the client.

```php
$client = new TradeTrackerClient('http://ws.tradetracker.com/soap/affiliate?wsdl', $authenticate);
```

## Usage

Call a client method to initiate the api call:

```php
$affiliateSites = $client->getAffiliateSites();
```

Common methods are:
- getAffiliateSites
- getCampaigns
- getClickTransactions
- getConversionTransactions
- getTransactions
- getReportAffiliateSite
- getReportCampaign
- getFeeds
- getFeedProductCategories
- getFeedProducts

Some method calls can have an optional filter:

```php
$filter = new AffiliateSiteFilter();
$filter->setLimit(5);

$affiliateSites = $client->getAffiliateSites($filter);
```

## Testing

``` bash
$ composer test
```

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.
10 changes: 10 additions & 0 deletions src/Client/TradeTrackerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ public function __construct(string $wsdl, Model\Authenticate $authenticate, arra
$this->connect($authenticate);
}

/**
* Returns the soap client used to make api calls.
*
* @return \SoapClient
*/
public function getClient()
{
return $this->client;
}

/**
* Connect and authenticate to initialize the client.
*
Expand Down