ReviewService.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 ReviewService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of <code>Review</code> objects that have <code>open</code> set to
  12. * <code>true</code>. The objects are sorted in descending order by creation date,
  13. * with the most recently created object 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\Review>
  21. */
  22. public function all($params = null, $opts = null)
  23. {
  24. return $this->requestCollection('get', '/v1/reviews', $params, $opts);
  25. }
  26. /**
  27. * Approves a <code>Review</code> object, closing it and removing it from the list
  28. * of reviews.
  29. *
  30. * @param string $id
  31. * @param null|array $params
  32. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  33. *
  34. * @throws \Stripe\Exception\ApiErrorException if the request fails
  35. *
  36. * @return \Stripe\Review
  37. */
  38. public function approve($id, $params = null, $opts = null)
  39. {
  40. return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts);
  41. }
  42. /**
  43. * Retrieves a <code>Review</code> object.
  44. *
  45. * @param string $id
  46. * @param null|array $params
  47. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  48. *
  49. * @throws \Stripe\Exception\ApiErrorException if the request fails
  50. *
  51. * @return \Stripe\Review
  52. */
  53. public function retrieve($id, $params = null, $opts = null)
  54. {
  55. return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts);
  56. }
  57. }