Review.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * Reviews can be used to supplement automated fraud detection with human
  6. * expertise.
  7. *
  8. * Learn more about <a href="/radar">Radar</a> and reviewing payments <a
  9. * href="https://stripe.com/docs/radar/reviews">here</a>.
  10. *
  11. * @property string $id Unique identifier for the object.
  12. * @property string $object String representing the object's type. Objects of the same type share the same value.
  13. * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable.
  14. * @property null|string|\Stripe\Charge $charge The charge associated with this review.
  15. * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of <code>approved</code>, <code>refunded</code>, <code>refunded_as_fraud</code>, or <code>disputed</code>.
  16. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  17. * @property null|string $ip_address The IP address where the payment originated.
  18. * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address.
  19. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  20. * @property bool $open If <code>true</code>, the review needs action.
  21. * @property string $opened_reason The reason the review was opened. One of <code>rule</code> or <code>manual</code>.
  22. * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists.
  23. * @property string $reason The reason the review is currently open or closed. One of <code>rule</code>, <code>manual</code>, <code>approved</code>, <code>refunded</code>, <code>refunded_as_fraud</code>, or <code>disputed</code>.
  24. * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment.
  25. */
  26. class Review extends ApiResource
  27. {
  28. const OBJECT_NAME = 'review';
  29. use ApiOperations\All;
  30. use ApiOperations\Retrieve;
  31. /**
  32. * Possible string representations of the current, the opening or the closure reason of the review.
  33. * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to
  34. * determine where these are apply.
  35. *
  36. * @see https://stripe.com/docs/api/radar/reviews/object
  37. */
  38. const REASON_APPROVED = 'approved';
  39. const REASON_DISPUTED = 'disputed';
  40. const REASON_MANUAL = 'manual';
  41. const REASON_REFUNDED = 'refunded';
  42. const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud';
  43. const REASON_RULE = 'rule';
  44. /**
  45. * @param null|array $params
  46. * @param null|array|string $opts
  47. *
  48. * @throws \Stripe\Exception\ApiErrorException if the request fails
  49. *
  50. * @return Review the approved review
  51. */
  52. public function approve($params = null, $opts = null)
  53. {
  54. $url = $this->instanceUrl() . '/approve';
  55. list($response, $opts) = $this->_request('post', $url, $params, $opts);
  56. $this->refreshFrom($response, $opts);
  57. return $this;
  58. }
  59. }