-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathOrganizationPartnerEndpoint.php
58 lines (50 loc) · 1.47 KB
/
OrganizationPartnerEndpoint.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
namespace Mollie\Api\Endpoints;
use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\Resources\BaseResource;
use Mollie\Api\Resources\Partner;
use Mollie\Api\Resources\ResourceFactory;
class OrganizationPartnerEndpoint extends EndpointAbstract
{
protected $resourcePath = "organizations/me/partner";
protected function getResourceCollectionObject($count, $links)
{
throw new \BadMethodCallException('not implemented');
}
/**
* Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
*
* @return BaseResource
*/
protected function getResourceObject()
{
return new Partner($this->client);
}
/**
* Retrieve details about the partner status of the currently authenticated organization.
*
* Will throw an ApiException if the resource cannot be found.
*
* @return Partner
* @throws ApiException
*/
public function get()
{
return $this->rest_read('', []);
}
/**
* @param string $id
* @param array $filters
*
* @return mixed
* @throws \Mollie\Api\Exceptions\ApiException
*/
protected function rest_read($id, array $filters)
{
$result = $this->client->performHttpCall(
self::REST_READ,
$this->getResourcePath() . $this->buildQueryString($filters)
);
return ResourceFactory::createFromApiResult($result, $this->getResourceObject());
}
}