Dispute.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Stripe;
  3. class Dispute extends ApiResource
  4. {
  5. /**
  6. * @param string $id The ID of the dispute to retrieve.
  7. * @param array|string|null $options
  8. *
  9. * @return Dispute
  10. */
  11. public static function retrieve($id, $options = null)
  12. {
  13. return self::_retrieve($id, $options);
  14. }
  15. /**
  16. * @param array|null $params
  17. * @param array|string|null $options
  18. *
  19. * @return array An array of Disputes.
  20. */
  21. public static function all($params = null, $options = null)
  22. {
  23. return self::_all($params, $options);
  24. }
  25. /**
  26. * @param array|string|null $options
  27. *
  28. * @return Dispute The saved charge.
  29. */
  30. public function save($options = null)
  31. {
  32. return $this->_save($options);
  33. }
  34. /**
  35. * @param array|null $params
  36. * @param array|string|null $options
  37. *
  38. * @return Dispute The closed dispute.
  39. */
  40. public function close($options = null)
  41. {
  42. $url = $this->instanceUrl() . '/close';
  43. list($response, $opts) = $this->_request('post', $url, null, $options);
  44. $this->refreshFrom($response, $opts);
  45. return $this;
  46. }
  47. }