ReviewService.php 1.7 KB

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