| Total Complexity | 2 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | abstract class OrderController |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Create an order on your builder's behalf on bsecure server |
||
| 11 | * |
||
| 12 | * @param array $orderPayload |
||
| 13 | * |
||
| 14 | * @throws \bSecure\ApiResponse if the request fails |
||
| 15 | * |
||
| 16 | * @return \bSecure\ApiResponse |
||
| 17 | */ |
||
| 18 | public static function createOrder($orderPayload) |
||
| 19 | { |
||
| 20 | $requestor = new ApiRequest(); |
||
| 21 | $response = $requestor->request( |
||
| 22 | 'post', |
||
| 23 | Constant::API_ENDPOINTS['create_order'], |
||
| 24 | $orderPayload, |
||
| 25 | Constant::YES |
||
| 26 | ); |
||
| 27 | return $response[0]; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Return order's status |
||
| 32 | * |
||
| 33 | * @param string $orderRef |
||
| 34 | * |
||
| 35 | * @throws \bSecure\ApiResponse if the request fails |
||
| 36 | * @return \bSecure\ApiResponse |
||
| 37 | */ |
||
| 38 | |||
| 39 | public static function orderStatus($orderRef) |
||
| 49 | } |
||
| 50 | } |