diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 189d7cacc..c523b8984 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v670 \ No newline at end of file +v682 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 5db40a147..9f6d0ed07 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -29,6 +29,9 @@ def self.object_names_to_classes CashBalance::OBJECT_NAME => CashBalance, Charge::OBJECT_NAME => Charge, Checkout::Session::OBJECT_NAME => Checkout::Session, + Climate::Order::OBJECT_NAME => Climate::Order, + Climate::Product::OBJECT_NAME => Climate::Product, + Climate::Supplier::OBJECT_NAME => Climate::Supplier, CountrySpec::OBJECT_NAME => CountrySpec, Coupon::OBJECT_NAME => Coupon, CreditNote::OBJECT_NAME => CreditNote, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 99e13547e..acf63de65 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -18,6 +18,9 @@ require "stripe/resources/cash_balance" require "stripe/resources/charge" require "stripe/resources/checkout/session" +require "stripe/resources/climate/order" +require "stripe/resources/climate/product" +require "stripe/resources/climate/supplier" require "stripe/resources/country_spec" require "stripe/resources/coupon" require "stripe/resources/credit_note" diff --git a/lib/stripe/resources/climate/order.rb b/lib/stripe/resources/climate/order.rb new file mode 100644 index 000000000..1e2b850e8 --- /dev/null +++ b/lib/stripe/resources/climate/order.rb @@ -0,0 +1,34 @@ +# 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 cancel(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/climate/orders/%s/cancel", { order: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + def self.cancel(order, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/climate/orders/%s/cancel", { order: CGI.escape(order) }), + params: params, + opts: opts + ) + end + end + end +end diff --git a/lib/stripe/resources/climate/product.rb b/lib/stripe/resources/climate/product.rb new file mode 100644 index 000000000..b6568d2f0 --- /dev/null +++ b/lib/stripe/resources/climate/product.rb @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Climate + # A Climate product represents a type of carbon removal unit available for reservation. + # You can retrieve it to see the current price and availability. + class Product < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "climate.product" + end + end +end diff --git a/lib/stripe/resources/climate/supplier.rb b/lib/stripe/resources/climate/supplier.rb new file mode 100644 index 000000000..49820c123 --- /dev/null +++ b/lib/stripe/resources/climate/supplier.rb @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Climate + # A supplier of carbon removal. + class Supplier < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "climate.supplier" + end + end +end