From 9b84f256a5aa35ea19433d1d16b0a0332004a1af Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:53:41 -0800 Subject: [PATCH 1/3] Update generated code for v682 (#1292) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 3 +++ lib/stripe/resources.rb | 3 +++ lib/stripe/resources/climate/order.rb | 34 ++++++++++++++++++++++++ lib/stripe/resources/climate/product.rb | 14 ++++++++++ lib/stripe/resources/climate/supplier.rb | 13 +++++++++ 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 lib/stripe/resources/climate/order.rb create mode 100644 lib/stripe/resources/climate/product.rb create mode 100644 lib/stripe/resources/climate/supplier.rb 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 From ac814f7ad3dcbf6f1c5924ccc11faa87a1f59ba3 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 30 Nov 2023 10:11:29 -0800 Subject: [PATCH 2/3] Bump version to 10.2.0 --- CHANGELOG.md | 13 +++++++++++++ VERSION | 2 +- lib/stripe/version.rb | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b7322ace..78b625b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,17 @@ # Changelog +## 10.2.0 - 2023-11-30 +* [#1292](https://github.com/stripe/stripe-ruby/pull/1292) Update generated code + * Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier` + * Add support for `cancel`, `create`, `list`, `retrieve`, and `update` methods on resource `Order` + * Add support for `list` and `retrieve` methods on resources `Product` and `Supplier` +* [#1295](https://github.com/stripe/stripe-ruby/pull/1295) Upgrade rubocop +* [#1291](https://github.com/stripe/stripe-ruby/pull/1291) Update generated code + +* [#1290](https://github.com/stripe/stripe-ruby/pull/1290) Update generated code + +* [#1288](https://github.com/stripe/stripe-ruby/pull/1288) Update generated code + + ## 10.1.0 - 2023-11-02 * [#1286](https://github.com/stripe/stripe-ruby/pull/1286) Update generated code * Add support for new resource `Tax.Registration` diff --git a/VERSION b/VERSION index 4149c39ee..2bd6f7e39 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.1.0 +10.2.0 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index 0d5c24af7..84365cf78 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "10.1.0" + VERSION = "10.2.0" end From 1ea064ad8e3d2031c56044c90714b8795855d620 Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:24:48 -0800 Subject: [PATCH 3/3] Explicitly disable MFA (#1297) --- .rubocop.yml | 2 +- stripe.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index fd4e94dc2..3b9fefdba 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -76,7 +76,7 @@ Gemspec/DeprecatedAttributeAssignment: # new in 1.30 Gemspec/DevelopmentDependencies: # new in 1.44 Enabled: true Gemspec/RequireMFA: # new in 1.23 - Enabled: true + Enabled: false Layout/LineContinuationLeadingSpace: # new in 1.31 Enabled: true Layout/LineContinuationSpacing: # new in 1.31 diff --git a/stripe.gemspec b/stripe.gemspec index b627279a9..d4f2f4a58 100644 --- a/stripe.gemspec +++ b/stripe.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| "github_repo" => "ssh://github.com/stripe/stripe-ruby", "homepage_uri" => "https://stripe.com/docs/api?lang=ruby", "source_code_uri" => "https://github.com/stripe/stripe-ruby", - "rubygems_mfa_required" => "true", + "rubygems_mfa_required" => "false", } ignored = Regexp.union(