DisputeService.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Issuing;
  4. class DisputeService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of Issuing <code>Dispute</code> objects. The objects are sorted
  8. * in descending order by creation date, with the most recently created object
  9. * appearing first.
  10. *
  11. * @param null|array $params
  12. * @param null|array|\Stripe\Util\RequestOptions $opts
  13. *
  14. * @throws \Stripe\Exception\ApiErrorException if the request fails
  15. *
  16. * @return \Stripe\Collection
  17. */
  18. public function all($params = null, $opts = null)
  19. {
  20. return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts);
  21. }
  22. /**
  23. * Creates an Issuing <code>Dispute</code> object. Individual pieces of evidence
  24. * within the <code>evidence</code> object are optional at this point. Stripe only
  25. * validates that required evidence is present during submission. Refer to <a
  26. * href="/docs/issuing/purchases/disputes#dispute-reasons-and-evidence">Dispute
  27. * reasons and evidence</a> for more details about evidence requirements.
  28. *
  29. * @param null|array $params
  30. * @param null|array|\Stripe\Util\RequestOptions $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Issuing\Dispute
  35. */
  36. public function create($params = null, $opts = null)
  37. {
  38. return $this->request('post', '/v1/issuing/disputes', $params, $opts);
  39. }
  40. /**
  41. * Retrieves an Issuing <code>Dispute</code> object.
  42. *
  43. * @param string $id
  44. * @param null|array $params
  45. * @param null|array|\Stripe\Util\RequestOptions $opts
  46. *
  47. * @throws \Stripe\Exception\ApiErrorException if the request fails
  48. *
  49. * @return \Stripe\Issuing\Dispute
  50. */
  51. public function retrieve($id, $params = null, $opts = null)
  52. {
  53. return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
  54. }
  55. /**
  56. * Submits an Issuing <code>Dispute</code> to the card network. Stripe validates
  57. * that all evidence fields required for the dispute’s reason are present. For more
  58. * details, see <a
  59. * href="/docs/issuing/purchases/disputes#dispute-reasons-and-evidence">Dispute
  60. * reasons and evidence</a>.
  61. *
  62. * @param string $id
  63. * @param null|array $params
  64. * @param null|array|\Stripe\Util\RequestOptions $opts
  65. *
  66. * @throws \Stripe\Exception\ApiErrorException if the request fails
  67. *
  68. * @return \Stripe\Issuing\Dispute
  69. */
  70. public function submit($id, $params = null, $opts = null)
  71. {
  72. return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts);
  73. }
  74. /**
  75. * Updates the specified Issuing <code>Dispute</code> object by setting the values
  76. * of the parameters passed. Any parameters not provided will be left unchanged.
  77. * Properties on the <code>evidence</code> object can be unset by passing in an
  78. * empty string.
  79. *
  80. * @param string $id
  81. * @param null|array $params
  82. * @param null|array|\Stripe\Util\RequestOptions $opts
  83. *
  84. * @throws \Stripe\Exception\ApiErrorException if the request fails
  85. *
  86. * @return \Stripe\Issuing\Dispute
  87. */
  88. public function update($id, $params = null, $opts = null)
  89. {
  90. return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
  91. }
  92. }