Include latest changes from the master branch

This commit is contained in:
Pavel Krymets 2022-08-23 05:35:23 -07:00
commit c732841fd3
8 changed files with 30 additions and 69 deletions

View File

@ -4,12 +4,6 @@ AllCops:
DisplayCopNames: true DisplayCopNames: true
TargetRubyVersion: 2.3 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: Layout/CaseIndentation:
EnforcedStyle: end EnforcedStyle: end
@ -19,12 +13,6 @@ Layout/FirstArrayElementIndentation:
Layout/FirstHashElementIndentation: Layout/FirstHashElementIndentation:
EnforcedStyle: consistent 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: Layout/LineLength:
Exclude: Exclude:
- "lib/stripe/object_types.rb" - "lib/stripe/object_types.rb"
@ -56,6 +44,11 @@ Metrics/ModuleLength:
Style/AccessModifierDeclarations: Style/AccessModifierDeclarations:
EnforcedStyle: inline EnforcedStyle: inline
Style/AsciiComments:
AllowedChars:
-
-
Style/FrozenStringLiteralComment: Style/FrozenStringLiteralComment:
EnforcedStyle: always EnforcedStyle: always

View File

@ -1,5 +1,12 @@
# Changelog # 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 ## 7.1.0-beta.2 - 2022-08-11
* [#1113](https://github.com/stripe/stripe-ruby/pull/1113) API Updates for beta branch * [#1113](https://github.com/stripe/stripe-ruby/pull/1113) API Updates for beta branch
- Updated stable APIs to the latest version - Updated stable APIs to the latest version

View File

@ -16,6 +16,10 @@ The library also provides other features. For example:
- Built-in mechanisms for the serialization of parameters according to the - Built-in mechanisms for the serialization of parameters according to the
expectations of Stripe's API. 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 ## Documentation
See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby). See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).

View File

@ -34,6 +34,7 @@ module Stripe
CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem, CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem,
Customer::OBJECT_NAME => Customer, Customer::OBJECT_NAME => Customer,
CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction, CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
Discount::OBJECT_NAME => Discount, Discount::OBJECT_NAME => Discount,
Dispute::OBJECT_NAME => Dispute, Dispute::OBJECT_NAME => Dispute,
EphemeralKey::OBJECT_NAME => EphemeralKey, EphemeralKey::OBJECT_NAME => EphemeralKey,

View File

@ -23,6 +23,7 @@ require "stripe/resources/credit_note"
require "stripe/resources/credit_note_line_item" require "stripe/resources/credit_note_line_item"
require "stripe/resources/customer" require "stripe/resources/customer"
require "stripe/resources/customer_balance_transaction" require "stripe/resources/customer_balance_transaction"
require "stripe/resources/customer_cash_balance_transaction"
require "stripe/resources/discount" require "stripe/resources/discount"
require "stripe/resources/dispute" require "stripe/resources/dispute"
require "stripe/resources/ephemeral_key" require "stripe/resources/ephemeral_key"

View File

@ -14,6 +14,8 @@ module Stripe
nested_resource_class_methods :balance_transaction, nested_resource_class_methods :balance_transaction,
operations: %i[create retrieve update list] operations: %i[create retrieve update list]
nested_resource_class_methods :cash_balance_transaction,
operations: %i[retrieve list]
nested_resource_class_methods :tax_id, nested_resource_class_methods :tax_id,
operations: %i[create retrieve delete list] operations: %i[create retrieve delete list]

View File

@ -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

View File

@ -1070,63 +1070,6 @@ module Stripe
assert_requested :get, "#{Stripe.api_base}/v1/mandates/mandate_xxxxxxxxxxxxx?" assert_requested :get, "#{Stripe.api_base}/v1/mandates/mandate_xxxxxxxxxxxxx?"
end end
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 context "PaymentIntent.apply_customer_balance" do
should "support requests with args: id" do should "support requests with args: id" do
Stripe::PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") Stripe::PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx")