DisputeService.php 2.8 KB

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