DisputeService.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  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 your disputes.
  12. *
  13. * @param null|array $params
  14. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Collection<\Stripe\Dispute>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/disputes', $params, $opts);
  23. }
  24. /**
  25. * Closing the dispute for a charge indicates that you do not have any evidence to
  26. * submit and are essentially dismissing the dispute, acknowledging it as lost.
  27. *
  28. * The status of the dispute will change from <code>needs_response</code> to
  29. * <code>lost</code>. <em>Closing a dispute is irreversible</em>.
  30. *
  31. * @param string $id
  32. * @param null|array $params
  33. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  34. *
  35. * @throws \Stripe\Exception\ApiErrorException if the request fails
  36. *
  37. * @return \Stripe\Dispute
  38. */
  39. public function close($id, $params = null, $opts = null)
  40. {
  41. return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts);
  42. }
  43. /**
  44. * Retrieves the dispute with the given ID.
  45. *
  46. * @param string $id
  47. * @param null|array $params
  48. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  49. *
  50. * @throws \Stripe\Exception\ApiErrorException if the request fails
  51. *
  52. * @return \Stripe\Dispute
  53. */
  54. public function retrieve($id, $params = null, $opts = null)
  55. {
  56. return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
  57. }
  58. /**
  59. * When you get a dispute, contacting your customer is always the best first step.
  60. * If that doesn’t work, you can submit evidence to help us resolve the dispute in
  61. * your favor. You can do this in your <a
  62. * href="https://dashboard.stripe.com/disputes">dashboard</a>, but if you prefer,
  63. * you can use the API to submit evidence programmatically.
  64. *
  65. * Depending on your dispute type, different evidence fields will give you a better
  66. * chance of winning your dispute. To figure out which evidence fields to provide,
  67. * see our <a href="/docs/disputes/categories">guide to dispute types</a>.
  68. *
  69. * @param string $id
  70. * @param null|array $params
  71. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  72. *
  73. * @throws \Stripe\Exception\ApiErrorException if the request fails
  74. *
  75. * @return \Stripe\Dispute
  76. */
  77. public function update($id, $params = null, $opts = null)
  78. {
  79. return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
  80. }
  81. }