Class: Stripe::Climate::OrderService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Climate::OrderService
- Defined in:
- lib/stripe/services/climate/order_service.rb
Instance Method Summary collapse
-
#cancel(order, params = {}, opts = {}) ⇒ Object
Cancels a Climate order.
-
#create(params = {}, opts = {}) ⇒ Object
Creates a Climate order object for a given Climate product.
-
#list(params = {}, opts = {}) ⇒ Object
Lists all Climate order objects.
-
#retrieve(order, params = {}, opts = {}) ⇒ Object
Retrieves the details of a Climate order object with the given ID.
-
#update(order, params = {}, opts = {}) ⇒ Object
Updates the specified order by setting the values of the parameters passed.
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.
11 12 13 14 15 16 17 18 19 |
# File 'lib/stripe/services/climate/order_service.rb', line 11 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.
23 24 25 26 27 28 29 30 31 |
# File 'lib/stripe/services/climate/order_service.rb', line 23 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.
35 36 37 38 39 40 41 42 43 |
# File 'lib/stripe/services/climate/order_service.rb', line 35 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.
46 47 48 49 50 51 52 53 54 |
# File 'lib/stripe/services/climate/order_service.rb', line 46 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.
57 58 59 60 61 62 63 64 65 |
# File 'lib/stripe/services/climate/order_service.rb', line 57 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 |