DisputeService.php 3.7 KB

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