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.



113
114
115
116
117
118
119
120
121
# File 'lib/stripe/services/climate/order_service.rb', line 113

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.



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

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.



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

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.



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

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.



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

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