Class: Stripe::Review

Inherits:
APIResource show all
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](docs.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

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

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

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, 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_zipObject (readonly)

The ZIP or postal code of the card used, if applicable.



57
58
59
# File 'lib/stripe/resources/review.rb', line 57

def billing_zip
  @billing_zip
end

#chargeObject (readonly)

The charge associated with this review.



59
60
61
# File 'lib/stripe/resources/review.rb', line 59

def charge
  @charge
end

#closed_reasonObject (readonly)

The reason the review was closed, or null if it has not yet been closed. One of ‘approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, `canceled`, `payment_never_settled`, or `acknowledged`.



61
62
63
# File 'lib/stripe/resources/review.rb', line 61

def closed_reason
  @closed_reason
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



63
64
65
# File 'lib/stripe/resources/review.rb', line 63

def created
  @created
end

#idObject (readonly)

Unique identifier for the object.



65
66
67
# File 'lib/stripe/resources/review.rb', line 65

def id
  @id
end

#ip_addressObject (readonly)

The IP address where the payment originated.



67
68
69
# File 'lib/stripe/resources/review.rb', line 67

def ip_address
  @ip_address
end

#ip_address_locationObject (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.



69
70
71
# File 'lib/stripe/resources/review.rb', line 69

def ip_address_location
  @ip_address_location
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



71
72
73
# File 'lib/stripe/resources/review.rb', line 71

def livemode
  @livemode
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



73
74
75
# File 'lib/stripe/resources/review.rb', line 73

def object
  @object
end

#openObject (readonly)

If ‘true`, the review needs action.



75
76
77
# File 'lib/stripe/resources/review.rb', line 75

def open
  @open
end

#opened_reasonObject (readonly)

The reason the review was opened. One of ‘rule` or `manual`.



77
78
79
# File 'lib/stripe/resources/review.rb', line 77

def opened_reason
  @opened_reason
end

#payment_intentObject (readonly)

The PaymentIntent ID associated with this review, if one exists.



79
80
81
# File 'lib/stripe/resources/review.rb', line 79

def payment_intent
  @payment_intent
end

#reasonObject (readonly)

The reason the review is currently open or closed. One of ‘rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, `canceled`, `payment_never_settled`, or `acknowledged`.



81
82
83
# File 'lib/stripe/resources/review.rb', line 81

def reason
  @reason
end

#sessionObject (readonly)

Information related to the browsing session of the user who initiated the payment.



83
84
85
# File 'lib/stripe/resources/review.rb', line 83

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.



96
97
98
99
100
101
102
103
# File 'lib/stripe/resources/review.rb', line 96

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

.field_remappingsObject



114
115
116
# File 'lib/stripe/resources/review.rb', line 114

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



110
111
112
# File 'lib/stripe/resources/review.rb', line 110

def self.inner_class_types
  @inner_class_types = { ip_address_location: IpAddressLocation, session: Session }
end

.list(params = {}, 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.



106
107
108
# File 'lib/stripe/resources/review.rb', line 106

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/reviews", params: params, opts: opts)
end

.object_nameObject



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.



86
87
88
89
90
91
92
93
# File 'lib/stripe/resources/review.rb', line 86

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