stripe 10.3.0 → 10.4.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: 78c3e10c5e7afde049a2affb5bbb230e4e4525193353bcf4921ff2bdb7219ce9
4
- data.tar.gz: 6e194c85cf1fe5b37289e5912be22a9ae885ad8aa4c66752a5181d7767cbdc1c
3
+ metadata.gz: 0dd07d99f579b9d882dc19afc64764c1d61dc26abdbbb611d3695c29a2eabe07
4
+ data.tar.gz: 01c6ddc9a7bc7cd2334dcc870778a608684ef4a0271185a862e6a8451b1d55c9
5
5
  SHA512:
6
- metadata.gz: 28c94abdfad1445b7c4f059bbda77e05638fd5b0fe3347a2cac7529ea632ede0a17db8e43dff34ed3e22488853cfa0494f05776dcdd042ace5362de5d920e106
7
- data.tar.gz: b06f47d94deb9782211c81046795942a4b8787b13238e0e85c2dbee4f1aa946de9242d488031a0d87abe78ab0e3a61ca0a9689c19562fc9e41c5ec0d13720e39
6
+ metadata.gz: '0063778e713f31f419d02bd6a3dd0df3fa8531528a7b0bbca3f498989d9d3da3dd0f6309c65a16a669447d3f25fb9a4c1801e6f0ea1d0818075f7be9df07d1ef'
7
+ data.tar.gz: 126bd64f159d836344be4bf5c985ff2a04ec7f351b2e8c9791a2fbd32176bbff777949254acab4764f01b1c60aeefd386243e8290c968b054c55399638db9e54
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # Changelog
2
+ ## 10.4.0 - 2023-12-22
3
+ * [#1303](https://github.com/stripe/stripe-ruby/pull/1303) Update generated code
4
+ * Add support for new resource `FinancialConnections.Transaction`
5
+ * Add support for `list` and `retrieve` methods on resource `Transaction`
6
+ * Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account`
7
+ * [#1304](https://github.com/stripe/stripe-ruby/pull/1304) Add support for updatable singleton resources
8
+
2
9
  ## 10.3.0 - 2023-12-14
3
10
  * [#1294](https://github.com/stripe/stripe-ruby/pull/1294) Support sending parameters inside singleton retrieve
4
11
 
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v682
1
+ v734
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.3.0
1
+ 10.4.0
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module APIOperations
5
+ module SingletonSave
6
+ module ClassMethods
7
+ # Updates a singleton API resource
8
+ #
9
+ # Updates the identified resource with the passed in parameters.
10
+ #
11
+ # ==== Attributes
12
+ #
13
+ # * +params+ - A hash of parameters to pass to the API
14
+ # * +opts+ - A Hash of additional options (separate from the params /
15
+ # object values) to be added to the request. E.g. to allow for an
16
+ # idempotency_key to be passed in the request headers, or for the
17
+ # api_key to be overwritten. See
18
+ # {APIOperations::Request.execute_resource_request}.
19
+ def update(params = {}, opts = {})
20
+ params.each_key do |k|
21
+ raise ArgumentError, "Cannot update protected field: #{k}" if protected_fields.include?(k)
22
+ end
23
+
24
+ request_stripe_object(
25
+ method: :post,
26
+ path: resource_url,
27
+ params: params,
28
+ opts: opts
29
+ )
30
+ end
31
+ end
32
+
33
+ # The `save` method is DEPRECATED and will be removed in a future major
34
+ # version of the library. Use the `update` method on the resource instead.
35
+ #
36
+ # Updates a singleton API resource.
37
+ #
38
+ # If the resource doesn't yet have an assigned ID and the resource is one
39
+ # that can be created, then the method attempts to create the resource.
40
+ # The resource is updated otherwise.
41
+ #
42
+ # ==== Attributes
43
+ #
44
+ # * +params+ - Overrides any parameters in the resource's serialized data
45
+ # and includes them in the create or update. If +:req_url:+ is included
46
+ # in the list, it overrides the update URL used for the create or
47
+ # update.
48
+ # * +opts+ - A Hash of additional options (separate from the params /
49
+ # object values) to be added to the request. E.g. to allow for an
50
+ # idempotency_key to be passed in the request headers, or for the
51
+ # api_key to be overwritten. See
52
+ # {APIOperations::Request.execute_resource_request}.
53
+ def save(params = {}, opts = {})
54
+ # We started unintentionally (sort of) allowing attributes sent to
55
+ # +save+ to override values used during the update. So as not to break
56
+ # the API, this makes that official here.
57
+ update_attributes(params)
58
+
59
+ # Now remove any parameters that look like object attributes.
60
+ params = params.reject { |k, _| respond_to?(k) }
61
+
62
+ values = serialize_params(self).merge(params)
63
+
64
+ resp, opts = execute_resource_request(:post, resource_url, values, opts, ["save"])
65
+ initialize_from(resp.data, opts)
66
+ end
67
+ extend Gem::Deprecate
68
+ deprecate :save, "the `update` class method (for examples " \
69
+ "see https://github.com/stripe/stripe-ruby" \
70
+ "/wiki/Migration-guide-for-v8)", 2022, 11
71
+
72
+ def self.included(base)
73
+ # Set `metadata` as additive so that when it's set directly we remember
74
+ # to clear keys that may have been previously set by sending empty
75
+ # values for them.
76
+ #
77
+ # It's possible that not every object with `Save` has `metadata`, but
78
+ # it's a close enough heuristic, and having this option set when there
79
+ # is no `metadata` field is not harmful.
80
+ base.additive_object_param(:metadata)
81
+
82
+ base.extend(ClassMethods)
83
+ end
84
+ end
85
+ end
86
+ end
@@ -52,6 +52,7 @@ module Stripe
52
52
  FinancialConnections::AccountOwnership::OBJECT_NAME =>
53
53
  FinancialConnections::AccountOwnership,
54
54
  FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
55
+ FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
55
56
  FundingInstructions::OBJECT_NAME => FundingInstructions,
56
57
  Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
57
58
  Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
@@ -5,7 +5,7 @@ module Stripe
5
5
  # This object represents files hosted on Stripe's servers. You can upload
6
6
  # files with the [create file](https://stripe.com/docs/api#create_file) request
7
7
  # (for example, when uploading dispute evidence). Stripe also
8
- # creates files independetly (for example, the results of a [Sigma scheduled
8
+ # creates files independently (for example, the results of a [Sigma scheduled
9
9
  # query](https://stripe.com/docs/api#scheduled_queries)).
10
10
  #
11
11
  # Related guide: [File upload guide](https://stripe.com/docs/file-upload)
@@ -36,6 +36,24 @@ module Stripe
36
36
  )
37
37
  end
38
38
 
39
+ def subscribe(params = {}, opts = {})
40
+ request_stripe_object(
41
+ method: :post,
42
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
43
+ params: params,
44
+ opts: opts
45
+ )
46
+ end
47
+
48
+ def unsubscribe(params = {}, opts = {})
49
+ request_stripe_object(
50
+ method: :post,
51
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
52
+ params: params,
53
+ opts: opts
54
+ )
55
+ end
56
+
39
57
  def self.disconnect(account, params = {}, opts = {})
40
58
  request_stripe_object(
41
59
  method: :post,
@@ -62,6 +80,24 @@ module Stripe
62
80
  opts: opts
63
81
  )
64
82
  end
83
+
84
+ def self.subscribe(account, params = {}, opts = {})
85
+ request_stripe_object(
86
+ method: :post,
87
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
88
+ params: params,
89
+ opts: opts
90
+ )
91
+ end
92
+
93
+ def self.unsubscribe(account, params = {}, opts = {})
94
+ request_stripe_object(
95
+ method: :post,
96
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
97
+ params: params,
98
+ opts: opts
99
+ )
100
+ end
65
101
  end
66
102
  end
67
103
  end
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module FinancialConnections
6
+ # A Transaction represents a real transaction that affects a Financial Connections Account balance.
7
+ class Transaction < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "financial_connections.transaction"
11
+ end
12
+ end
13
+ end
@@ -7,7 +7,7 @@ module Stripe
7
7
  #
8
8
  # Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)
9
9
  class Settings < SingletonAPIResource
10
- include Stripe::APIOperations::Save
10
+ include Stripe::APIOperations::SingletonSave
11
11
 
12
12
  OBJECT_NAME = "tax.settings"
13
13
  end
@@ -39,6 +39,7 @@ require "stripe/resources/financial_connections/account"
39
39
  require "stripe/resources/financial_connections/account_owner"
40
40
  require "stripe/resources/financial_connections/account_ownership"
41
41
  require "stripe/resources/financial_connections/session"
42
+ require "stripe/resources/financial_connections/transaction"
42
43
  require "stripe/resources/funding_instructions"
43
44
  require "stripe/resources/identity/verification_report"
44
45
  require "stripe/resources/identity/verification_session"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "10.3.0"
4
+ VERSION = "10.4.0"
5
5
  end
data/lib/stripe.rb CHANGED
@@ -25,6 +25,7 @@ require "stripe/api_operations/list"
25
25
  require "stripe/api_operations/nested_resource"
26
26
  require "stripe/api_operations/request"
27
27
  require "stripe/api_operations/save"
28
+ require "stripe/api_operations/singleton_save"
28
29
  require "stripe/api_operations/search"
29
30
 
30
31
  # API resource support classes
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: 10.3.0
4
+ version: 10.4.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-12-14 00:00:00.000000000 Z
11
+ date: 2023-12-22 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.
@@ -39,6 +39,7 @@ files:
39
39
  - lib/stripe/api_operations/request.rb
40
40
  - lib/stripe/api_operations/save.rb
41
41
  - lib/stripe/api_operations/search.rb
42
+ - lib/stripe/api_operations/singleton_save.rb
42
43
  - lib/stripe/api_resource.rb
43
44
  - lib/stripe/api_resource_test_helpers.rb
44
45
  - lib/stripe/api_version.rb
@@ -90,6 +91,7 @@ files:
90
91
  - lib/stripe/resources/financial_connections/account_owner.rb
91
92
  - lib/stripe/resources/financial_connections/account_ownership.rb
92
93
  - lib/stripe/resources/financial_connections/session.rb
94
+ - lib/stripe/resources/financial_connections/transaction.rb
93
95
  - lib/stripe/resources/funding_instructions.rb
94
96
  - lib/stripe/resources/identity/verification_report.rb
95
97
  - lib/stripe/resources/identity/verification_session.rb