diff --git a/.rubocop.yml b/.rubocop.yml index b7b0f37f..ec2771f5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,12 +4,6 @@ AllCops: DisplayCopNames: true TargetRubyVersion: 2.3 - Exclude: - # brandur: Exclude ephmeral script-like files that I use to try and - # reproduce problems with the library. If you know of a better way of doing - # this (e.g. exclude files not tracked by Git), feel free to change it. - - "example_*" - Layout/CaseIndentation: EnforcedStyle: end @@ -19,12 +13,6 @@ Layout/FirstArrayElementIndentation: Layout/FirstHashElementIndentation: EnforcedStyle: consistent -# This can be re-enabled once we're 2.3+ only and can use the squiggly heredoc -# operator. Prior to that, Rubocop recommended bringing in a library like -# ActiveSupport to get heredoc indentation, which is just terrible. -Layout/HeredocIndentation: - Enabled: false - Layout/LineLength: Exclude: - "lib/stripe/object_types.rb" @@ -56,6 +44,11 @@ Metrics/ModuleLength: Style/AccessModifierDeclarations: EnforcedStyle: inline +Style/AsciiComments: + AllowedChars: + - ’ + - € + Style/FrozenStringLiteralComment: EnforcedStyle: always diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d33ff49..690b15c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 7.1.0 - 2022-08-19 +* [#1116](https://github.com/stripe/stripe-ruby/pull/1116) API Updates + * Add support for new resource `CustomerCashBalanceTransaction` +* [#1118](https://github.com/stripe/stripe-ruby/pull/1118) Update AllowedChars in rubocop config +* [#1117](https://github.com/stripe/stripe-ruby/pull/1117) Refresh rubocop config. +* [#1115](https://github.com/stripe/stripe-ruby/pull/1115) Add a support section to the readme + ## 7.1.0-beta.2 - 2022-08-11 * [#1113](https://github.com/stripe/stripe-ruby/pull/1113) API Updates for beta branch - Updated stable APIs to the latest version diff --git a/README.md b/README.md index 1f8c848b..fb22ace6 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ The library also provides other features. For example: - Built-in mechanisms for the serialization of parameters according to the expectations of Stripe's API. +## Support + +New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. + ## Documentation See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby). diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 5aa90619..9ee81adc 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -34,6 +34,7 @@ module Stripe CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem, Customer::OBJECT_NAME => Customer, CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction, + CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction, Discount::OBJECT_NAME => Discount, Dispute::OBJECT_NAME => Dispute, EphemeralKey::OBJECT_NAME => EphemeralKey, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 9d44c25f..83f61761 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -23,6 +23,7 @@ require "stripe/resources/credit_note" require "stripe/resources/credit_note_line_item" require "stripe/resources/customer" require "stripe/resources/customer_balance_transaction" +require "stripe/resources/customer_cash_balance_transaction" require "stripe/resources/discount" require "stripe/resources/dispute" require "stripe/resources/ephemeral_key" diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index 390ebd95..4bab8443 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -14,6 +14,8 @@ module Stripe nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list] + nested_resource_class_methods :cash_balance_transaction, + operations: %i[retrieve list] nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list] diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb new file mode 100644 index 00000000..667309cc --- /dev/null +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class CustomerCashBalanceTransaction < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "customer_cash_balance_transaction" + end +end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 1497a0be..2fbc1220 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1070,63 +1070,6 @@ module Stripe assert_requested :get, "#{Stripe.api_base}/v1/mandates/mandate_xxxxxxxxxxxxx?" end end - context "Order.cancel" do - should "support requests with args: order" do - Stripe::Order.cancel("order_xyz") - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/cancel?" - end - end - context "Order.create" do - should "support requests with args: description, currency, line_items" do - Stripe::Order.create( - { - description: "description", - currency: "usd", - line_items: [{ description: "my line item" }], - } - ) - assert_requested :post, "#{Stripe.api_base}/v1/orders" - end - end - context "Order.list" do - should "support requests with args: limit" do - Stripe::Order.list({ limit: 3 }) - assert_requested :get, "#{Stripe.api_base}/v1/orders?limit=3" - end - end - context "Order.list_line_items" do - should "support requests with args: order" do - Stripe::Order.list_line_items("order_xyz") - assert_requested :get, "#{Stripe.api_base}/v1/orders/order_xyz/line_items?" - end - end - context "Order.reopen" do - should "support requests with args: order" do - Stripe::Order.reopen("order_xyz") - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/reopen?" - end - end - context "Order.retrieve" do - should "support requests with args: order" do - Stripe::Order.retrieve("order_xyz") - assert_requested :get, "#{Stripe.api_base}/v1/orders/order_xyz?" - end - end - context "Order.submit" do - should "support requests with args: order, expected_total" do - Stripe::Order.submit("order_xyz", { expected_total: 100 }) - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/submit" - end - end - context "Order.update" do - should "support requests with args: order, metadata, ip_address" do - Stripe::Order.update( - "order_xyz", - { metadata: { reference_number: "123" }, ip_address: "0.0.0.0" } - ) - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz" - end - end context "PaymentIntent.apply_customer_balance" do should "support requests with args: id" do Stripe::PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx")