Class: Stripe::ReviewService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/review_service.rb

Defined Under Namespace

Classes: ApproveParams, ListParams, RetrieveParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#approve(review, params = {}, opts = {}) ⇒ Object

Approves a Review object, closing it and removing it from the list of reviews.



63
64
65
66
67
68
69
70
71
# File 'lib/stripe/services/review_service.rb', line 63

def approve(review, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/reviews/%<review>s/approve", { review: CGI.escape(review) }),
    params: params,
    opts: opts,
    base_address: :api
  )
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.



74
75
76
# File 'lib/stripe/services/review_service.rb', line 74

def list(params = {}, opts = {})
  request(method: :get, path: "/v1/reviews", params: params, opts: opts, base_address: :api)
end

#retrieve(review, params = {}, opts = {}) ⇒ Object

Retrieves a Review object.



79
80
81
82
83
84
85
86
87
# File 'lib/stripe/services/review_service.rb', line 79

def retrieve(review, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/reviews/%<review>s", { review: CGI.escape(review) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end