1 | <?php |
||
33 | final class SubscriptionsClient extends Client implements SubscriptionsClientInterface { |
||
34 | 1 | public function __construct() { |
|
37 | |||
38 | /** |
||
39 | * @inheritdoc |
||
40 | */ |
||
41 | public function cancel($productId, $token) { |
||
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | public function defer($productId, $expectedTimeMillis, $desiredTimeMillis, $token) { |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | public function refund($productId, $token) { |
||
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | 1 | public function revokeSubscription($productId, $token) { |
|
77 | |||
78 | /** |
||
79 | * Send command for Purchases Subscriptions API |
||
80 | * @param string $command subscriptions API command |
||
81 | * @param string $productId product identifier |
||
82 | * @param string $token purchase product token |
||
83 | * @return string API response body |
||
84 | * @throws InvalidCredentialsException when access grants is not granted |
||
85 | * @throws ErrorException when API error acquired |
||
86 | * @throws TransportException when HTTP transport error occurred |
||
87 | * @throws UnexpectedValueException when access token is empty for client |
||
88 | */ |
||
89 | 1 | private function sendRequest($command, $productId, $token) { |
|
92 | |||
93 | /** |
||
94 | * Send command for Purchases Subscriptions API |
||
95 | * @param Request $Request request instance |
||
96 | * @return string API response body |
||
97 | * @throws InvalidCredentialsException when access grants is not granted |
||
98 | * @throws ErrorException when API error acquired |
||
99 | * @throws TransportException when HTTP transport error occurred |
||
100 | * @throws UnexpectedValueException when access token is empty for client |
||
101 | */ |
||
102 | 1 | private function makeRequest(Request $Request) { |
|
121 | |||
122 | /** |
||
123 | * Create request instance for command |
||
124 | * @param string $command subscriptions API command |
||
125 | * @param string $productId product identifier |
||
126 | * @param string $token purchase product token |
||
127 | * @return Request HTTP request instance |
||
128 | */ |
||
129 | 1 | private function createRequest($command, $productId, $token) { |
|
139 | } |
||
140 |