Class: Stripe::Climate::OrderService

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

Defined Under Namespace

Classes: CancelParams, CreateParams, ListParams, RetrieveParams, UpdateParams

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

#cancel(order, params = {}, opts = {}) ⇒ Object

Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.



124
125
126
127
128
129
130
131
132
# File 'lib/stripe/services/climate/order_service.rb', line 124

def cancel(order, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/climate/orders/%<order>s/cancel", { order: CGI.escape(order) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#create(params = {}, opts = {}) ⇒ Object

Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance.



136
137
138
139
140
141
142
143
144
# File 'lib/stripe/services/climate/order_service.rb', line 136

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/climate/orders",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#list(params = {}, opts = {}) ⇒ Object

Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first.



148
149
150
151
152
153
154
155
156
# File 'lib/stripe/services/climate/order_service.rb', line 148

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

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

Retrieves the details of a Climate order object with the given ID.



159
160
161
162
163
164
165
166
167
# File 'lib/stripe/services/climate/order_service.rb', line 159

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

#update(order, params = {}, opts = {}) ⇒ Object

Updates the specified order by setting the values of the parameters passed.



170
171
172
173
174
175
176
177
178
# File 'lib/stripe/services/climate/order_service.rb', line 170

def update(order, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/climate/orders/%<order>s", { order: CGI.escape(order) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end