1 | <?php |
||
32 | class GuzzleRequest implements RequestInterface |
||
33 | { |
||
34 | /** |
||
35 | * The requestscheme |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private $requestTemplate = "//webservices.amazon.%s/onca/xml?%s"; |
||
40 | |||
41 | /** |
||
42 | * The scheme for the uri. E.g. http or https. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | private $scheme = 'http'; |
||
47 | |||
48 | /** |
||
49 | * @var ClientInterface |
||
50 | */ |
||
51 | private $client; |
||
52 | |||
53 | /** |
||
54 | * Initialize instance |
||
55 | * |
||
56 | * @param ClientInterface $client |
||
57 | */ |
||
58 | 4 | public function __construct(ClientInterface $client) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 2 | public function perform(OperationInterface $operation, ConfigurationInterface $configuration) |
|
79 | |||
80 | /** |
||
81 | * Sets the scheme. |
||
82 | * |
||
83 | * @param string $scheme |
||
84 | */ |
||
85 | 2 | public function setScheme($scheme) |
|
93 | |||
94 | /** |
||
95 | * Prepares the parameters for the request |
||
96 | * |
||
97 | * @param OperationInterface $operation |
||
98 | * @param ConfigurationInterface $configuration |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | 2 | protected function prepareRequestParams(OperationInterface $operation, ConfigurationInterface $configuration) |
|
126 | |||
127 | /** |
||
128 | * Builds the final querystring including the signature |
||
129 | * |
||
130 | * @param array $params |
||
131 | * @param ConfigurationInterface $configuration |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 2 | protected function buildQueryString(array $params, ConfigurationInterface $configuration) |
|
148 | |||
149 | /** |
||
150 | * Calculates the signature for the request |
||
151 | * |
||
152 | * @param array $params |
||
153 | * @param string $country |
||
154 | * @param string $secret |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | 2 | protected function buildSignature(array $params, $country, $secret) |
|
169 | } |
||
170 |