diff --git a/src/Infusionsoft/Api/Rest/AffiliateService.php b/src/Infusionsoft/Api/Rest/AffiliateService.php new file mode 100644 index 0000000..f752c8c --- /dev/null +++ b/src/Infusionsoft/Api/Rest/AffiliateService.php @@ -0,0 +1,86 @@ +client->restfulRequest('get', $this->getFullUrl($this->id . '/clawbacks'), $params); + } + + /** + * Retrieves a list of all affiliate payments + * + * @param array $params + * @return array + */ + public function payments($params = []) + { + return $this->client->restfulRequest('get', $this->getFullUrl($this->id . '/payments'), $params); + } + + /** + * Retrieve a list of Commissions based on Affiliate or Date Range + * + * @param array $params + * @return array + */ + public function commissions($params = []) + { + return $this->client->restfulRequest('get', $this->getFullUrl('/commissions'), $params); + } + + /** + * Retrieve a list of Commission Programs + * + * @param array $params + * @return array + */ + public function programs($params = []) + { + return $this->client->restfulRequest('get', $this->getFullUrl('/programs'), $params); + } + + /** + * Retrieves a list of all affiliate redirects + * + * @param array $params + * @return array + */ + public function redirectLinks($params = []) + { + return $this->client->restfulRequest('get', $this->getFullUrl('/redirectlinks'), $params); + } + + /** + * Retrieve a list of affiliate summaries + * + * @param array $params + * @return array + */ + public function summaries($params = []) + { + return $this->client->restfulRequest('get', $this->getFullUrl('/summaries'), $params); + } +} \ No newline at end of file diff --git a/src/Infusionsoft/Api/Rest/LocaleService.php b/src/Infusionsoft/Api/Rest/LocaleService.php new file mode 100644 index 0000000..8f3b708 --- /dev/null +++ b/src/Infusionsoft/Api/Rest/LocaleService.php @@ -0,0 +1,48 @@ +client->restfulRequest('get', $this->getFullUrl('/countries')); + } + + /** + * Retrieves a list of all provinces for given country + * + * @param array $params + * @return array + */ + public function provinces($country_code = '') + { + return $this->client->restfulRequest('get', $this->getFullUrl('/countries/' . $country_code . '/provinces')); + } +} \ No newline at end of file diff --git a/src/Infusionsoft/Infusionsoft.php b/src/Infusionsoft/Infusionsoft.php index 80f4050..1d51ad3 100644 --- a/src/Infusionsoft/Infusionsoft.php +++ b/src/Infusionsoft/Infusionsoft.php @@ -568,9 +568,13 @@ public function affiliatePrograms() /** * @return \Infusionsoft\Api\AffiliateService */ - public function affiliates() + public function affiliates($api = 'rest') { - return $this->getApi('AffiliateService'); + if ($api == 'xml') { + return $this->getApi('AffiliateService'); + } + + return $this->getRestApi('AffiliateService'); } /** @@ -655,6 +659,14 @@ public function invoices() return $this->getApi('InvoiceService'); } + /** + * @return \Infusionsoft\Api\Rest\LocaleService + */ + public function locales() + { + return $this->getRestApi('LocaleService'); + } + /** * @return \Infusionsoft\Api\Rest\MerchantService */ @@ -854,4 +866,3 @@ public function getRestApi($class) } } -