Cards.php 1.3 KB

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