stripe 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56384c5d588a2d922c4cd813adfd6015bce5169cd334ae8dd6f45c16fcb07392
4
- data.tar.gz: 5f9460024d8c4d1b7cd0ac44883d4aa9a3ed52e0104b129bdf0eacfff62e1698
3
+ metadata.gz: 01a1d2aa23c160486a8b0fa5c08dfad964af0d9340a52c6283b5cf2ce1f25200
4
+ data.tar.gz: ce2b83885e40945f062d5e5ebb4bf37c780726eaeb850570f32a9288b75b11b0
5
5
  SHA512:
6
- metadata.gz: 7b53fda899dfd3e44e27482860880228f93c3948425fef83c33ff106504cdae9441a3438488f80416946f653736389491cd5fc0c5e5e6d2ed604ffc50aa6a013
7
- data.tar.gz: 602f93db8d61c5f7953e7f930eb7e74d09a0bc01fc02b32277cd6335a12cb93fa7f5c2767b111bac5c4d19a129fc1ed6749780cb8d1285d52e342f87523c47ee
6
+ metadata.gz: bc5fbfa15c3feed8c3ecdc56ce4deef4d0afd732ccf28f08504327ed347293817fe5dde146cf8e59561c247abdaa17355d585c62c3d4c010225088e0c1251097
7
+ data.tar.gz: cc407b09a64595638a226f18ac0905b583950af18e6ba99a9e6dc029bd7d49962e110dfaff64085148749072e4dd052fa51e90a18e743334cded2c518df6727b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.1.0 - 2022-05-19
4
+ * [#1057](https://github.com/stripe/stripe-ruby/pull/1057) API Updates
5
+ * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction`
6
+ * Add support for `retrieve_payment_method` method on resource `Customer`
7
+ * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
8
+
9
+
10
+
3
11
  ## 6.0.0 - 2022-05-09
4
12
  * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
5
13
  Major version release. The [migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-Guide-for-v6) contains more information.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.0
1
+ 6.1.0
@@ -8,6 +8,8 @@ module Stripe
8
8
  # class MyAPIResource < APIResource
9
9
  # class TestHelpers < APIResourceTestHelpers
10
10
  class APIResourceTestHelpers
11
+ include Stripe::APIOperations::Request
12
+
11
13
  def initialize(resource)
12
14
  @resource = resource
13
15
  end
@@ -107,6 +107,16 @@ module Stripe
107
107
  Token::OBJECT_NAME => Token,
108
108
  Topup::OBJECT_NAME => Topup,
109
109
  Transfer::OBJECT_NAME => Transfer,
110
+ Treasury::CreditReversal::OBJECT_NAME => Treasury::CreditReversal,
111
+ Treasury::DebitReversal::OBJECT_NAME => Treasury::DebitReversal,
112
+ Treasury::FinancialAccount::OBJECT_NAME => Treasury::FinancialAccount,
113
+ Treasury::InboundTransfer::OBJECT_NAME => Treasury::InboundTransfer,
114
+ Treasury::OutboundPayment::OBJECT_NAME => Treasury::OutboundPayment,
115
+ Treasury::OutboundTransfer::OBJECT_NAME => Treasury::OutboundTransfer,
116
+ Treasury::ReceivedCredit::OBJECT_NAME => Treasury::ReceivedCredit,
117
+ Treasury::ReceivedDebit::OBJECT_NAME => Treasury::ReceivedDebit,
118
+ Treasury::Transaction::OBJECT_NAME => Treasury::Transaction,
119
+ Treasury::TransactionEntry::OBJECT_NAME => Treasury::TransactionEntry,
110
120
  UsageRecord::OBJECT_NAME => UsageRecord,
111
121
  UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
112
122
  WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
@@ -41,6 +41,30 @@ module Stripe
41
41
  )
42
42
  end
43
43
 
44
+ def retrieve_payment_method(payment_method, params = {}, opts = {})
45
+ request_stripe_object(
46
+ method: :get,
47
+ path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(self["id"]), payment_method: CGI.escape(payment_method) }),
48
+ params: params,
49
+ opts: opts
50
+ )
51
+ end
52
+
53
+ def self.retrieve_payment_method(
54
+ customer,
55
+ payment_method,
56
+ params = {},
57
+ opts = {}
58
+ )
59
+ resp, opts = execute_resource_request(
60
+ :get,
61
+ format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }),
62
+ params,
63
+ opts
64
+ )
65
+ Util.convert_to_stripe_object(resp.data, opts)
66
+ end
67
+
44
68
  custom_method :delete_discount, http_verb: :delete, http_path: "discount"
45
69
 
46
70
  save_nested_resource :source
@@ -4,9 +4,12 @@
4
4
  module Stripe
5
5
  module FinancialConnections
6
6
  class Account < APIResource
7
+ extend Stripe::APIOperations::List
8
+
7
9
  OBJECT_NAME = "financial_connections.account"
8
10
 
9
11
  custom_method :disconnect, http_verb: :post
12
+ custom_method :list_owners, http_verb: :get, http_path: "owners"
10
13
  custom_method :refresh_account, http_verb: :post, http_path: "refresh"
11
14
 
12
15
  def disconnect(params = {}, opts = {})
@@ -18,6 +21,15 @@ module Stripe
18
21
  )
19
22
  end
20
23
 
24
+ def list_owners(params = {}, opts = {})
25
+ request_stripe_object(
26
+ method: :get,
27
+ path: resource_url + "/owners",
28
+ params: params,
29
+ opts: opts
30
+ )
31
+ end
32
+
21
33
  def refresh_account(params = {}, opts = {})
22
34
  request_stripe_object(
23
35
  method: :post,
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class CreditReversal < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "treasury.credit_reversal"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class DebitReversal < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "treasury.debit_reversal"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,35 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class FinancialAccount < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+ include Stripe::APIOperations::Save
10
+
11
+ OBJECT_NAME = "treasury.financial_account"
12
+
13
+ custom_method :retrieve_features, http_verb: :get, http_path: "features"
14
+ custom_method :update_features, http_verb: :post, http_path: "features"
15
+
16
+ def retrieve_features(params = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: resource_url + "/features",
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
24
+
25
+ def update_features(params = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :post,
28
+ path: resource_url + "/features",
29
+ params: params,
30
+ opts: opts
31
+ )
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class InboundTransfer < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "treasury.inbound_transfer"
11
+
12
+ custom_method :cancel, http_verb: :post
13
+
14
+ def cancel(params = {}, opts = {})
15
+ request_stripe_object(
16
+ method: :post,
17
+ path: resource_url + "/cancel",
18
+ params: params,
19
+ opts: opts
20
+ )
21
+ end
22
+
23
+ def test_helpers
24
+ TestHelpers.new(self)
25
+ end
26
+
27
+ class TestHelpers < APIResourceTestHelpers
28
+ RESOURCE_CLASS = InboundTransfer
29
+
30
+ custom_method :fail, http_verb: :post
31
+ custom_method :return_inbound_transfer, http_verb: :post, http_path: "return"
32
+ custom_method :succeed, http_verb: :post
33
+
34
+ def fail(params = {}, opts = {})
35
+ @resource.request_stripe_object(
36
+ method: :post,
37
+ path: resource_url + "/fail",
38
+ params: params,
39
+ opts: opts
40
+ )
41
+ end
42
+
43
+ def return_inbound_transfer(params = {}, opts = {})
44
+ @resource.request_stripe_object(
45
+ method: :post,
46
+ path: resource_url + "/return",
47
+ params: params,
48
+ opts: opts
49
+ )
50
+ end
51
+
52
+ def succeed(params = {}, opts = {})
53
+ @resource.request_stripe_object(
54
+ method: :post,
55
+ path: resource_url + "/succeed",
56
+ params: params,
57
+ opts: opts
58
+ )
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class OutboundPayment < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "treasury.outbound_payment"
11
+
12
+ custom_method :cancel, http_verb: :post
13
+
14
+ def cancel(params = {}, opts = {})
15
+ request_stripe_object(
16
+ method: :post,
17
+ path: resource_url + "/cancel",
18
+ params: params,
19
+ opts: opts
20
+ )
21
+ end
22
+
23
+ def test_helpers
24
+ TestHelpers.new(self)
25
+ end
26
+
27
+ class TestHelpers < APIResourceTestHelpers
28
+ RESOURCE_CLASS = OutboundPayment
29
+
30
+ custom_method :fail, http_verb: :post
31
+ custom_method :post, http_verb: :post
32
+ custom_method :return_outbound_payment, http_verb: :post, http_path: "return"
33
+
34
+ def fail(params = {}, opts = {})
35
+ @resource.request_stripe_object(
36
+ method: :post,
37
+ path: resource_url + "/fail",
38
+ params: params,
39
+ opts: opts
40
+ )
41
+ end
42
+
43
+ def post(params = {}, opts = {})
44
+ @resource.request_stripe_object(
45
+ method: :post,
46
+ path: resource_url + "/post",
47
+ params: params,
48
+ opts: opts
49
+ )
50
+ end
51
+
52
+ def return_outbound_payment(params = {}, opts = {})
53
+ @resource.request_stripe_object(
54
+ method: :post,
55
+ path: resource_url + "/return",
56
+ params: params,
57
+ opts: opts
58
+ )
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class OutboundTransfer < APIResource
7
+ extend Stripe::APIOperations::Create
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "treasury.outbound_transfer"
11
+
12
+ custom_method :cancel, http_verb: :post
13
+
14
+ def cancel(params = {}, opts = {})
15
+ request_stripe_object(
16
+ method: :post,
17
+ path: resource_url + "/cancel",
18
+ params: params,
19
+ opts: opts
20
+ )
21
+ end
22
+
23
+ def test_helpers
24
+ TestHelpers.new(self)
25
+ end
26
+
27
+ class TestHelpers < APIResourceTestHelpers
28
+ RESOURCE_CLASS = OutboundTransfer
29
+
30
+ custom_method :fail, http_verb: :post
31
+ custom_method :post, http_verb: :post
32
+ custom_method :return_outbound_transfer, http_verb: :post, http_path: "return"
33
+
34
+ def fail(params = {}, opts = {})
35
+ @resource.request_stripe_object(
36
+ method: :post,
37
+ path: resource_url + "/fail",
38
+ params: params,
39
+ opts: opts
40
+ )
41
+ end
42
+
43
+ def post(params = {}, opts = {})
44
+ @resource.request_stripe_object(
45
+ method: :post,
46
+ path: resource_url + "/post",
47
+ params: params,
48
+ opts: opts
49
+ )
50
+ end
51
+
52
+ def return_outbound_transfer(params = {}, opts = {})
53
+ @resource.request_stripe_object(
54
+ method: :post,
55
+ path: resource_url + "/return",
56
+ params: params,
57
+ opts: opts
58
+ )
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,30 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class ReceivedCredit < APIResource
7
+ extend Stripe::APIOperations::List
8
+
9
+ OBJECT_NAME = "treasury.received_credit"
10
+
11
+ def test_helpers
12
+ TestHelpers.new(self)
13
+ end
14
+
15
+ class TestHelpers < APIResourceTestHelpers
16
+ RESOURCE_CLASS = ReceivedCredit
17
+
18
+ def self.create(params = {}, opts = {})
19
+ resp, opts = execute_resource_request(
20
+ :post,
21
+ "/v1/test_helpers/treasury/received_credits",
22
+ params,
23
+ opts
24
+ )
25
+ Util.convert_to_stripe_object(resp.data, opts)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class ReceivedDebit < APIResource
7
+ extend Stripe::APIOperations::List
8
+
9
+ OBJECT_NAME = "treasury.received_debit"
10
+
11
+ def test_helpers
12
+ TestHelpers.new(self)
13
+ end
14
+
15
+ class TestHelpers < APIResourceTestHelpers
16
+ RESOURCE_CLASS = ReceivedDebit
17
+
18
+ def self.create(params = {}, opts = {})
19
+ resp, opts = execute_resource_request(
20
+ :post,
21
+ "/v1/test_helpers/treasury/received_debits",
22
+ params,
23
+ opts
24
+ )
25
+ Util.convert_to_stripe_object(resp.data, opts)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class Transaction < APIResource
7
+ extend Stripe::APIOperations::List
8
+
9
+ OBJECT_NAME = "treasury.transaction"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Treasury
6
+ class TransactionEntry < APIResource
7
+ extend Stripe::APIOperations::List
8
+
9
+ OBJECT_NAME = "treasury.transaction_entry"
10
+
11
+ def self.resource_url
12
+ "/v1/treasury/transaction_entries"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -94,6 +94,16 @@ require "stripe/resources/three_d_secure"
94
94
  require "stripe/resources/token"
95
95
  require "stripe/resources/topup"
96
96
  require "stripe/resources/transfer"
97
+ require "stripe/resources/treasury/credit_reversal"
98
+ require "stripe/resources/treasury/debit_reversal"
99
+ require "stripe/resources/treasury/financial_account"
100
+ require "stripe/resources/treasury/inbound_transfer"
101
+ require "stripe/resources/treasury/outbound_payment"
102
+ require "stripe/resources/treasury/outbound_transfer"
103
+ require "stripe/resources/treasury/received_credit"
104
+ require "stripe/resources/treasury/received_debit"
105
+ require "stripe/resources/treasury/transaction"
106
+ require "stripe/resources/treasury/transaction_entry"
97
107
  require "stripe/resources/usage_record"
98
108
  require "stripe/resources/usage_record_summary"
99
109
  require "stripe/resources/webhook_endpoint"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "6.0.0"
4
+ VERSION = "6.1.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: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-20 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.
@@ -142,6 +142,16 @@ files:
142
142
  - lib/stripe/resources/token.rb
143
143
  - lib/stripe/resources/topup.rb
144
144
  - lib/stripe/resources/transfer.rb
145
+ - lib/stripe/resources/treasury/credit_reversal.rb
146
+ - lib/stripe/resources/treasury/debit_reversal.rb
147
+ - lib/stripe/resources/treasury/financial_account.rb
148
+ - lib/stripe/resources/treasury/inbound_transfer.rb
149
+ - lib/stripe/resources/treasury/outbound_payment.rb
150
+ - lib/stripe/resources/treasury/outbound_transfer.rb
151
+ - lib/stripe/resources/treasury/received_credit.rb
152
+ - lib/stripe/resources/treasury/received_debit.rb
153
+ - lib/stripe/resources/treasury/transaction.rb
154
+ - lib/stripe/resources/treasury/transaction_entry.rb
145
155
  - lib/stripe/resources/usage_record.rb
146
156
  - lib/stripe/resources/usage_record_summary.rb
147
157
  - lib/stripe/resources/webhook_endpoint.rb
@@ -180,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
190
  - !ruby/object:Gem::Version
181
191
  version: '0'
182
192
  requirements: []
183
- rubygems_version: 3.1.2
193
+ rubygems_version: 3.3.7
184
194
  signing_key:
185
195
  specification_version: 4
186
196
  summary: Ruby bindings for the Stripe API