1 | <?php |
||
7 | class CompletePurchaseRequest extends AbstractRequest |
||
8 | { |
||
9 | |||
10 | 11 | public function getData() |
|
20 | |||
21 | 10 | public function sendData($data) |
|
25 | |||
26 | |||
27 | 10 | public function queryGateway() |
|
28 | { |
||
29 | $param = [ |
||
30 | 10 | 'tranxid' => $this->getTransactionId(), |
|
31 | 10 | 'amount' => $this->getAmountInteger(), |
|
32 | 10 | 'mertid' => $this->getMerchantId(), |
|
33 | 10 | 'hash'=>$this->getVerificationHash() |
|
34 | ]; |
||
35 | 10 | $response = $this->httpClient->get( |
|
36 | 10 | $this->getWebserviceUrl(), |
|
37 | 10 | null, |
|
38 | 10 | ['query'=>$param,'read_timeout'=>60] |
|
39 | 10 | )->send(); |
|
40 | |||
41 | 10 | if ($response->getStatusCode() !== 200) { |
|
42 | throw new InvalidResponseException(); |
||
43 | } |
||
44 | 10 | $body = (string) $response->getBody(); |
|
45 | 10 | return json_decode($body, true); |
|
46 | } |
||
47 | |||
48 | 10 | private function getVerificationHash() |
|
53 | |||
54 | 10 | private function mergeResponse($newResponse, $data) |
|
61 | } |
||
62 |