| Total Complexity | 7 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class ConfirmOrderMethod extends AbstractMethod |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Get Order Endpoint |
||
| 20 | */ |
||
| 21 | const ENDPOINT = '/orders'; |
||
| 22 | |||
| 23 | const CONFIRM_ENDPOINT = 'confirm'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string $orderId |
||
| 27 | */ |
||
| 28 | protected $orderId; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $orderId |
||
| 32 | * |
||
| 33 | * @return $this |
||
| 34 | */ |
||
| 35 | public function setOrderId($orderId) |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * call |
||
| 44 | * |
||
| 45 | * @return $this|AbstractMethod |
||
| 46 | * @throws \Httpful\Exception\ConnectionErrorException |
||
| 47 | * @throws \Pagantis\OrdersApiClient\Exception\HttpException |
||
| 48 | * @throws ClientException |
||
| 49 | */ |
||
| 50 | public function call() |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return bool|Order |
||
| 61 | * |
||
| 62 | * @throws \Exception |
||
| 63 | */ |
||
| 64 | public function getOrder() |
||
| 65 | { |
||
| 66 | $response = $this->getResponse(); |
||
| 67 | if ($response instanceof Response) { |
||
| 68 | $order = new Order(); |
||
| 69 | $order->import($this->getResponse()->body); |
||
| 70 | return $order; |
||
| 71 | } |
||
| 72 | |||
| 73 | return false; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * prepareRequest |
||
| 78 | */ |
||
| 79 | protected function prepareRequest() |
||
| 91 | ) |
||
| 92 | ; |
||
| 96 |