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