Dispute.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class Dispute
  5. *
  6. * @property string $id
  7. * @property string $object
  8. * @property int $amount
  9. * @property mixed $balance_transactions
  10. * @property string $charge
  11. * @property int $created
  12. * @property string $currency
  13. * @property mixed $evidence
  14. * @property mixed $evidence_details
  15. * @property bool $is_charge_refundable
  16. * @property bool $livemode
  17. * @property mixed $metadata
  18. * @property string $reason
  19. * @property string $status
  20. *
  21. * @package Stripe
  22. */
  23. class Dispute extends ApiResource
  24. {
  25. /**
  26. * @param string $id The ID of the dispute to retrieve.
  27. * @param array|string|null $options
  28. *
  29. * @return Dispute
  30. */
  31. public static function retrieve($id, $options = null)
  32. {
  33. return self::_retrieve($id, $options);
  34. }
  35. /**
  36. * @param array|null $params
  37. * @param array|string|null $options
  38. *
  39. * @return array An array of Disputes.
  40. */
  41. public static function all($params = null, $options = null)
  42. {
  43. return self::_all($params, $options);
  44. }
  45. /**
  46. * @param string $id The ID of the dispute to update.
  47. * @param array|null $params
  48. * @param array|string|null $options
  49. *
  50. * @return Dispute The updated dispute.
  51. */
  52. public static function update($id, $params = null, $options = null)
  53. {
  54. return self::_update($id, $params, $options);
  55. }
  56. /**
  57. * @param array|string|null $options
  58. *
  59. * @return Dispute The saved charge.
  60. */
  61. public function save($options = null)
  62. {
  63. return $this->_save($options);
  64. }
  65. /**
  66. * @param array|string|null $options
  67. *
  68. * @return Dispute The closed dispute.
  69. */
  70. public function close($options = null)
  71. {
  72. $url = $this->instanceUrl() . '/close';
  73. list($response, $opts) = $this->_request('post', $url, null, $options);
  74. $this->refreshFrom($response, $opts);
  75. return $this;
  76. }
  77. }