1 | <?php |
||
9 | class YourMembershipClient |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * Guzzle Client |
||
14 | * @var \GuzzleHttp\Client |
||
15 | */ |
||
16 | private $client; |
||
17 | /** |
||
18 | * YourMembership Request |
||
19 | * @var Request |
||
20 | */ |
||
21 | private $request; |
||
22 | |||
23 | 1 | public function __construct(Client $client, string $apiKey, string $saPasscode) |
|
24 | { |
||
25 | 1 | $this->client = $client; |
|
26 | 1 | $this->request = new Request($apiKey, $saPasscode); |
|
27 | 1 | $sessionID = $this->createSession(); |
|
28 | 1 | Request::setSessionID($sessionID); |
|
29 | |||
30 | 1 | } |
|
31 | /** |
||
32 | * Makes API Call to YourMembership |
||
33 | * @method makeCall |
||
34 | * @author PA |
||
35 | * @date 2017-01-10 |
||
36 | * @param string $method Your Membership API Method |
||
37 | * @param array $arguments Your Membership API Call Arguments |
||
38 | * @return Response |
||
39 | */ |
||
40 | 1 | public function makeCall(string $method, array $arguments = []) |
|
50 | |||
51 | /** |
||
52 | * Creates a new Session with YourMembership |
||
53 | * @method createSession |
||
54 | * @author PA |
||
55 | * @date 2017-01-10 |
||
56 | * @return string SessionID |
||
57 | */ |
||
58 | 1 | private function createSession() : string |
|
64 | |||
65 | } |
||
66 |