stripe 8.3.0 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8293f29e86f093b7980e362cf7721a56f6b7059b155e2e36b6f3975aa72aad2d
4
- data.tar.gz: f2885f99fc05115e4398ca14f5e55f8dbe77f4a2565fc1cd9dedd40e8a439ed9
3
+ metadata.gz: 69907e69481fc6350f4a226975cf5988a770b61eb1d6eed36f4d935452dcada1
4
+ data.tar.gz: 982881d50f24782e00eeb5f5c3daa6e508eccb9991b7ef02caed9e51719a8ba4
5
5
  SHA512:
6
- metadata.gz: a21a14b0a0e0096ce0801dd6b9370e6e3649630120b79f3e13c171115cdfa51fd6a186e4470fbedecd99d33c9afa7502e2952d7142896cc1ba2a2c1601a2250f
7
- data.tar.gz: 708a644e596972a37d5c0e9c37164c52df62e73d44588485b5ef7c6d991d63280f9aba9410d8a39bccbc0667ed1cbbf0e905f662e5af96e301ab42d4cfae7eab
6
+ metadata.gz: 7de7cb6d5319da3553d0663ef6bcaa5a5231578ed204ab756b9ff0e0d7396a137944b7bb7032d731257fb65089ca00da510d9f0e26c2502a6e7bd473e7c8913d
7
+ data.tar.gz: e46980b615f80e4c6a4656ad85fd83acdae65bca8a76f808572ecdccc903aae5bfcf85fab9f3c234b746a193ebec98ab216d3b65606a2e77f91a344595e10f5a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.5.0 - 2023-03-30
4
+ * [#1203](https://github.com/stripe/stripe-ruby/pull/1203) Update generated code
5
+ * Remove support for `create` method on resource `Tax.Transaction`
6
+ * This is not a breaking change, as this method was deprecated before the Tax Transactions API was released in favor of the `create_from_calculation` method.
7
+ * [#1201](https://github.com/stripe/stripe-ruby/pull/1201) Update save deprecation message
8
+
9
+ ## 8.4.0 - 2023-03-23
10
+ * [#1197](https://github.com/stripe/stripe-ruby/pull/1197) Update generated code (new)
11
+ * Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction`
12
+ * Add support for `create` and `list_line_items` methods on resource `Calculation`
13
+ * Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction`
14
+ * [#1152](https://github.com/stripe/stripe-ruby/pull/1152) Symbolize hash keys inside `convert_to_stripe_object_with_params`
15
+
3
16
  ## 8.3.0 - 2023-02-16
4
17
  * [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
5
18
  * Add support for `refund_payment` method on resource `Terminal.Reader`
data/Makefile CHANGED
@@ -1,7 +1,13 @@
1
- .PHONY: update-version codegen-format
1
+ .PHONY: update-version codegen-format test ci-test
2
2
  update-version:
3
3
  @echo "$(VERSION)" > VERSION
4
4
  @perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
5
5
 
6
6
  codegen-format:
7
+ bundle install --quiet
7
8
  bundle exec rubocop -o /dev/null --auto-correct
9
+
10
+ ci-test:
11
+ bundle install && bundle exec rake test
12
+
13
+ test: ci-test
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v226
1
+ v285
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.3.0
1
+ 8.5.0
@@ -72,7 +72,9 @@ module Stripe
72
72
  initialize_from(resp.data, opts)
73
73
  end
74
74
  extend Gem::Deprecate
75
- deprecate :save, :update, 2022, 11
75
+ deprecate :save, "the `update` class method (for examples"\
76
+ " see https://github.com/stripe/stripe-ruby"\
77
+ "/wiki/Migration-guide-for-v8)", 2022, 11
76
78
 
77
79
  def self.included(base)
78
80
  # Set `metadata` as additive so that when it's set directly we remember
@@ -89,6 +89,8 @@ module Stripe
89
89
  Subscription::OBJECT_NAME => Subscription,
90
90
  SubscriptionItem::OBJECT_NAME => SubscriptionItem,
91
91
  SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
92
+ Tax::Calculation::OBJECT_NAME => Tax::Calculation,
93
+ Tax::Transaction::OBJECT_NAME => Tax::Transaction,
92
94
  TaxCode::OBJECT_NAME => TaxCode,
93
95
  TaxId::OBJECT_NAME => TaxId,
94
96
  TaxRate::OBJECT_NAME => TaxRate,
@@ -6,7 +6,7 @@ module Stripe
6
6
  #
7
7
  # When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.
8
8
  #
9
- # Related guide: [Payment Links API](https://stripe.com/docs/payments/payment-links/api)
9
+ # Related guide: [Payment Links API](https://stripe.com/docs/payment-links)
10
10
  class PaymentLink < APIResource
11
11
  extend Stripe::APIOperations::Create
12
12
  extend Stripe::APIOperations::List
@@ -7,7 +7,7 @@ module Stripe
7
7
  # They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.
8
8
  #
9
9
  # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription),
10
- # [share a Payment Link](https://stripe.com/docs/payments/payment-links/overview),
10
+ # [share a Payment Link](https://stripe.com/docs/payment-links),
11
11
  # [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront),
12
12
  # and more about [Products and Prices](https://stripe.com/docs/products-prices/overview)
13
13
  class Product < APIResource
@@ -0,0 +1,31 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ # A Tax `Calculation` allows you to calculate the tax to collect from your customer.
7
+ class Calculation < APIResource
8
+ extend Stripe::APIOperations::Create
9
+
10
+ OBJECT_NAME = "tax.calculation"
11
+
12
+ def list_line_items(params = {}, opts = {})
13
+ request_stripe_object(
14
+ method: :get,
15
+ path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
16
+ params: params,
17
+ opts: opts
18
+ )
19
+ end
20
+
21
+ def self.list_line_items(calculation, params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :get,
24
+ path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,47 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ # A Tax transaction records the tax collected from or refunded to your customer.
7
+ class Transaction < APIResource
8
+ OBJECT_NAME = "tax.transaction"
9
+
10
+ def list_line_items(params = {}, opts = {})
11
+ request_stripe_object(
12
+ method: :get,
13
+ path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
14
+ params: params,
15
+ opts: opts
16
+ )
17
+ end
18
+
19
+ def self.create_from_calculation(params = {}, opts = {})
20
+ request_stripe_object(
21
+ method: :post,
22
+ path: "/v1/tax/transactions/create_from_calculation",
23
+ params: params,
24
+ opts: opts
25
+ )
26
+ end
27
+
28
+ def self.create_reversal(params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :post,
31
+ path: "/v1/tax/transactions/create_reversal",
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ def self.list_line_items(transaction, params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :get,
40
+ path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(transaction) }),
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
45
+ end
46
+ end
47
+ end
@@ -76,6 +76,8 @@ require "stripe/resources/source_transaction"
76
76
  require "stripe/resources/subscription"
77
77
  require "stripe/resources/subscription_item"
78
78
  require "stripe/resources/subscription_schedule"
79
+ require "stripe/resources/tax/calculation"
80
+ require "stripe/resources/tax/transaction"
79
81
  require "stripe/resources/tax_code"
80
82
  require "stripe/resources/tax_id"
81
83
  require "stripe/resources/tax_rate"
data/lib/stripe/util.rb CHANGED
@@ -133,7 +133,8 @@ module Stripe
133
133
  when Hash
134
134
  # Try converting to a known object class. If none available, fall back
135
135
  # to generic StripeObject
136
- obj = object_classes.fetch(data[:object], StripeObject)
136
+ object_name = data[:object] || data["object"]
137
+ obj = object_classes.fetch(object_name, StripeObject)
137
138
  .construct_from(data, opts)
138
139
 
139
140
  # set filters so that we can fetch the same limit, expansions, and
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "8.3.0"
4
+ VERSION = "8.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.
@@ -128,6 +128,8 @@ files:
128
128
  - lib/stripe/resources/subscription.rb
129
129
  - lib/stripe/resources/subscription_item.rb
130
130
  - lib/stripe/resources/subscription_schedule.rb
131
+ - lib/stripe/resources/tax/calculation.rb
132
+ - lib/stripe/resources/tax/transaction.rb
131
133
  - lib/stripe/resources/tax_code.rb
132
134
  - lib/stripe/resources/tax_id.rb
133
135
  - lib/stripe/resources/tax_rate.rb