Orders.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace Culqi;
  3. /**
  4. * Class Orders
  5. *
  6. * @package Culqi
  7. */
  8. class Orders extends Resource {
  9. const URL_ORDERS = "/orders/";
  10. /**
  11. * @param array|null $options
  12. *
  13. * @return Get all Orders
  14. */
  15. public function all($options) {
  16. return $this->request("GET", self::URL_ORDERS, $api_key = $this->culqi->api_key, $options);
  17. }
  18. /**
  19. * @param array|null $options
  20. *
  21. * @return create Order
  22. */
  23. public function create($options = NULL) {
  24. return $this->request("POST", self::URL_ORDERS, $api_key = $this->culqi->api_key, $options);
  25. }
  26. /**
  27. * @param array|null $options
  28. *
  29. * @return confirm Order
  30. */
  31. public function confirm($id = NULL) {
  32. return $this->request("POST", self::URL_ORDERS . $id . "/confirm/", $api_key = $this->culqi->api_key);
  33. }
  34. /**
  35. * @param string|null $id
  36. *
  37. * @return get a Order
  38. */
  39. public function get($id) {
  40. return $this->request("GET", self::URL_ORDERS . $id . "/", $api_key = $this->culqi->api_key);
  41. }
  42. /**
  43. * @param string|null $id
  44. *
  45. * @return delete a Order
  46. */
  47. public function delete($id) {
  48. return $this->request("DELETE", self::URL_ORDERS . $id . "/", $api_key = $this->culqi->api_key);
  49. }
  50. /**
  51. * @param string|null $id
  52. * @param array|null $options
  53. *
  54. * @return update Order
  55. */
  56. public function update($id = NULL, $options = NULL) {
  57. return $this->request("PATCH", self::URL_ORDERS . $id . "/", $api_key = $this->culqi->api_key, $options);
  58. }
  59. }