Class: Stripe::Review
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Review
- Extended by:
- APIOperations::List
- Defined in:
- lib/stripe/resources/review.rb
Overview
Reviews can be used to supplement automated fraud detection with human expertise.
Learn more about [Radar](stripe.com/radar) and reviewing payments [here](stripe.com/docs/radar/reviews).
Defined Under Namespace
Classes: IpAddressLocation, Session
Constant Summary collapse
- OBJECT_NAME =
"review"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#billing_zip ⇒ Object
readonly
The ZIP or postal code of the card used, if applicable.
-
#charge ⇒ Object
readonly
The charge associated with this review.
-
#closed_reason ⇒ Object
readonly
The reason the review was closed, or null if it has not yet been closed.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#ip_address ⇒ Object
readonly
The IP address where the payment originated.
-
#ip_address_location ⇒ Object
readonly
Information related to the location of the payment.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#open ⇒ Object
readonly
If ‘true`, the review needs action.
-
#opened_reason ⇒ Object
readonly
The reason the review was opened.
-
#payment_intent ⇒ Object
readonly
The PaymentIntent ID associated with this review, if one exists.
-
#reason ⇒ Object
readonly
The reason the review is currently open or closed.
-
#session ⇒ Object
readonly
Information related to the browsing session of the user who initiated the payment.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.approve(review, params = {}, opts = {}) ⇒ Object
Approves a Review object, closing it and removing it from the list of reviews.
-
.list(filters = {}, opts = {}) ⇒ Object
Returns a list of Review objects that have open set to true.
- .object_name ⇒ Object
Instance Method Summary collapse
-
#approve(params = {}, opts = {}) ⇒ Object
Approves a Review object, closing it and removing it from the list of reviews.
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#billing_zip ⇒ Object (readonly)
The ZIP or postal code of the card used, if applicable.
25 26 27 |
# File 'lib/stripe/resources/review.rb', line 25 def billing_zip @billing_zip end |
#charge ⇒ Object (readonly)
The charge associated with this review.
27 28 29 |
# File 'lib/stripe/resources/review.rb', line 27 def charge @charge end |
#closed_reason ⇒ Object (readonly)
The reason the review was closed, or null if it has not yet been closed. One of ‘approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`.
29 30 31 |
# File 'lib/stripe/resources/review.rb', line 29 def closed_reason @closed_reason end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
31 32 33 |
# File 'lib/stripe/resources/review.rb', line 31 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
33 34 35 |
# File 'lib/stripe/resources/review.rb', line 33 def id @id end |
#ip_address ⇒ Object (readonly)
The IP address where the payment originated.
35 36 37 |
# File 'lib/stripe/resources/review.rb', line 35 def ip_address @ip_address end |
#ip_address_location ⇒ Object (readonly)
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.
37 38 39 |
# File 'lib/stripe/resources/review.rb', line 37 def ip_address_location @ip_address_location end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
39 40 41 |
# File 'lib/stripe/resources/review.rb', line 39 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
41 42 43 |
# File 'lib/stripe/resources/review.rb', line 41 def object @object end |
#open ⇒ Object (readonly)
If ‘true`, the review needs action.
43 44 45 |
# File 'lib/stripe/resources/review.rb', line 43 def open @open end |
#opened_reason ⇒ Object (readonly)
The reason the review was opened. One of ‘rule` or `manual`.
45 46 47 |
# File 'lib/stripe/resources/review.rb', line 45 def opened_reason @opened_reason end |
#payment_intent ⇒ Object (readonly)
The PaymentIntent ID associated with this review, if one exists.
47 48 49 |
# File 'lib/stripe/resources/review.rb', line 47 def payment_intent @payment_intent end |
#reason ⇒ Object (readonly)
The reason the review is currently open or closed. One of ‘rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`.
49 50 51 |
# File 'lib/stripe/resources/review.rb', line 49 def reason @reason end |
#session ⇒ Object (readonly)
Information related to the browsing session of the user who initiated the payment.
51 52 53 |
# File 'lib/stripe/resources/review.rb', line 51 def session @session end |
Class Method Details
.approve(review, params = {}, opts = {}) ⇒ Object
Approves a Review object, closing it and removing it from the list of reviews.
64 65 66 67 68 69 70 71 |
# File 'lib/stripe/resources/review.rb', line 64 def self.approve(review, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/reviews/%<review>s/approve", { review: CGI.escape(review) }), params: params, opts: opts ) end |
.list(filters = {}, opts = {}) ⇒ Object
Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
74 75 76 |
# File 'lib/stripe/resources/review.rb', line 74 def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/reviews", params: filters, opts: opts) end |
.object_name ⇒ Object
13 14 15 |
# File 'lib/stripe/resources/review.rb', line 13 def self.object_name "review" end |
Instance Method Details
#approve(params = {}, opts = {}) ⇒ Object
Approves a Review object, closing it and removing it from the list of reviews.
54 55 56 57 58 59 60 61 |
# File 'lib/stripe/resources/review.rb', line 54 def approve(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/reviews/%<review>s/approve", { review: CGI.escape(self["id"]) }), params: params, opts: opts ) end |