1 | <?php |
||
33 | class GuzzleRequest implements RequestInterface |
||
34 | { |
||
35 | /** |
||
36 | * The requestscheme |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | private $requestTemplate = "//webservices.amazon.%s/onca/xml?%s"; |
||
41 | |||
42 | /** |
||
43 | * The scheme for the uri. E.g. http or https. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | private $scheme = 'http'; |
||
48 | |||
49 | /** |
||
50 | * @var ClientInterface |
||
51 | */ |
||
52 | private $client; |
||
53 | |||
54 | /** |
||
55 | * Initialize instance |
||
56 | * |
||
57 | * @param ClientInterface $client |
||
58 | */ |
||
59 | 4 | public function __construct(ClientInterface $client) |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 2 | public function perform(OperationInterface $operation, ConfigurationInterface $configuration) |
|
85 | |||
86 | /** |
||
87 | * Sets the scheme. |
||
88 | * |
||
89 | * @param string $scheme |
||
90 | */ |
||
91 | 2 | public function setScheme($scheme) |
|
99 | |||
100 | /** |
||
101 | * Prepares the parameters for the request |
||
102 | * |
||
103 | * @param OperationInterface $operation |
||
104 | * @param ConfigurationInterface $configuration |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | 2 | protected function prepareRequestParams(OperationInterface $operation, ConfigurationInterface $configuration) |
|
132 | |||
133 | /** |
||
134 | * Builds the final querystring including the signature |
||
135 | * |
||
136 | * @param array $params |
||
137 | * @param ConfigurationInterface $configuration |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | 2 | protected function buildQueryString(array $params, ConfigurationInterface $configuration) |
|
154 | |||
155 | /** |
||
156 | * Calculates the signature for the request |
||
157 | * |
||
158 | * @param array $params |
||
159 | * @param string $country |
||
160 | * @param string $secret |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | 2 | protected function buildSignature(array $params, $country, $secret) |
|
175 | } |
||
176 |