mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-11-27 00:03:06 -05:00
* Update generated code for v1060 * Update generated code for v1062 * Update generated code for v1063 * Update generated code for v1071 * Update generated code for v1079 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
68 lines
2.8 KiB
Ruby
68 lines
2.8 KiB
Ruby
# File generated from our OpenAPI spec
|
|
# frozen_string_literal: true
|
|
|
|
module Stripe
|
|
module Climate
|
|
# Orders represent your intent to purchase a particular Climate product. When you create an order, the
|
|
# payment is deducted from your merchant balance.
|
|
class Order < APIResource
|
|
extend Stripe::APIOperations::Create
|
|
extend Stripe::APIOperations::List
|
|
include Stripe::APIOperations::Save
|
|
|
|
OBJECT_NAME = "climate.order"
|
|
def self.object_name
|
|
"climate.order"
|
|
end
|
|
|
|
# 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.
|
|
def cancel(params = {}, opts = {})
|
|
request_stripe_object(
|
|
method: :post,
|
|
path: format("/v1/climate/orders/%<order>s/cancel", { order: CGI.escape(self["id"]) }),
|
|
params: params,
|
|
opts: opts
|
|
)
|
|
end
|
|
|
|
# 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.
|
|
def self.cancel(order, params = {}, opts = {})
|
|
request_stripe_object(
|
|
method: :post,
|
|
path: format("/v1/climate/orders/%<order>s/cancel", { order: CGI.escape(order) }),
|
|
params: params,
|
|
opts: opts
|
|
)
|
|
end
|
|
|
|
# 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.
|
|
def self.create(params = {}, opts = {})
|
|
request_stripe_object(method: :post, path: "/v1/climate/orders", params: params, opts: opts)
|
|
end
|
|
|
|
# Lists all Climate order objects. The orders are returned sorted by creation date, with the
|
|
# most recently created orders appearing first.
|
|
def self.list(filters = {}, opts = {})
|
|
request_stripe_object(method: :get, path: "/v1/climate/orders", params: filters, opts: opts)
|
|
end
|
|
|
|
# Updates the specified order by setting the values of the parameters passed.
|
|
def self.update(id, params = {}, opts = {})
|
|
request_stripe_object(
|
|
method: :post,
|
|
path: format("/v1/climate/orders/%<id>s", { id: CGI.escape(id) }),
|
|
params: params,
|
|
opts: opts
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|