stripe 9.3.0.pre.beta.1 → 9.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -203
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +0 -11
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/request.rb +0 -2
  7. data/lib/stripe/api_version.rb +0 -1
  8. data/lib/stripe/object_types.rb +0 -16
  9. data/lib/stripe/resources/account.rb +1 -2
  10. data/lib/stripe/resources/application_fee.rb +1 -2
  11. data/lib/stripe/resources/balance_transaction.rb +1 -1
  12. data/lib/stripe/resources/customer.rb +5 -13
  13. data/lib/stripe/resources/dispute.rb +2 -4
  14. data/lib/stripe/resources/event.rb +17 -16
  15. data/lib/stripe/resources/financial_connections/account.rb +0 -39
  16. data/lib/stripe/resources/invoice.rb +1 -6
  17. data/lib/stripe/resources/issuing/authorization.rb +89 -0
  18. data/lib/stripe/resources/issuing/transaction.rb +44 -0
  19. data/lib/stripe/resources/quote.rb +0 -100
  20. data/lib/stripe/resources/source.rb +1 -2
  21. data/lib/stripe/resources/subscription_schedule.rb +0 -18
  22. data/lib/stripe/resources/terminal/reader.rb +0 -54
  23. data/lib/stripe/resources/transfer.rb +1 -2
  24. data/lib/stripe/resources/treasury/outbound_transfer.rb +1 -5
  25. data/lib/stripe/resources.rb +0 -16
  26. data/lib/stripe/stripe_client.rb +26 -60
  27. data/lib/stripe/stripe_configuration.rb +0 -2
  28. data/lib/stripe/util.rb +1 -8
  29. data/lib/stripe/version.rb +1 -1
  30. data/lib/stripe.rb +0 -46
  31. metadata +4 -21
  32. data/lib/stripe/request_signing_authenticator.rb +0 -83
  33. data/lib/stripe/resources/capital/financing_offer.rb +0 -32
  34. data/lib/stripe/resources/capital/financing_summary.rb +0 -12
  35. data/lib/stripe/resources/capital/financing_transaction.rb +0 -13
  36. data/lib/stripe/resources/customer_session.rb +0 -12
  37. data/lib/stripe/resources/financial_connections/inferred_balance.rb +0 -13
  38. data/lib/stripe/resources/financial_connections/transaction.rb +0 -13
  39. data/lib/stripe/resources/gift_cards/card.rb +0 -25
  40. data/lib/stripe/resources/gift_cards/transaction.rb +0 -56
  41. data/lib/stripe/resources/issuing/card_bundle.rb +0 -13
  42. data/lib/stripe/resources/issuing/card_design.rb +0 -58
  43. data/lib/stripe/resources/order.rb +0 -89
  44. data/lib/stripe/resources/quote_phase.rb +0 -29
  45. data/lib/stripe/resources/quote_preview_invoice.rb +0 -42
  46. data/lib/stripe/resources/quote_preview_schedule.rb +0 -10
  47. data/lib/stripe/resources/tax/form.rb +0 -39
  48. data/lib/stripe/resources/tax/registration.rb +0 -19
@@ -6,12 +6,9 @@ module Stripe
6
6
  # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
7
7
  class Account < APIResource
8
8
  extend Stripe::APIOperations::List
9
- extend Stripe::APIOperations::NestedResource
10
9
 
11
10
  OBJECT_NAME = "financial_connections.account"
12
11
 
13
- nested_resource_class_methods :inferred_balance, operations: %i[list]
14
-
15
12
  def disconnect(params = {}, opts = {})
16
13
  request_stripe_object(
17
14
  method: :post,
@@ -39,24 +36,6 @@ module Stripe
39
36
  )
40
37
  end
41
38
 
42
- def subscribe(params = {}, opts = {})
43
- request_stripe_object(
44
- method: :post,
45
- path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
46
- params: params,
47
- opts: opts
48
- )
49
- end
50
-
51
- def unsubscribe(params = {}, opts = {})
52
- request_stripe_object(
53
- method: :post,
54
- path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
55
- params: params,
56
- opts: opts
57
- )
58
- end
59
-
60
39
  def self.disconnect(account, params = {}, opts = {})
61
40
  request_stripe_object(
62
41
  method: :post,
@@ -83,24 +62,6 @@ module Stripe
83
62
  opts: opts
84
63
  )
85
64
  end
86
-
87
- def self.subscribe(account, params = {}, opts = {})
88
- request_stripe_object(
89
- method: :post,
90
- path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
91
- params: params,
92
- opts: opts
93
- )
94
- end
95
-
96
- def self.unsubscribe(account, params = {}, opts = {})
97
- request_stripe_object(
98
- method: :post,
99
- path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
100
- params: params,
101
- opts: opts
102
- )
103
- end
104
65
  end
105
66
  end
106
67
  end
@@ -134,12 +134,7 @@ module Stripe
134
134
  end
135
135
 
136
136
  def self.upcoming(params = {}, opts = {})
137
- request_stripe_object(
138
- method: :get,
139
- path: "/v1/invoices/upcoming",
140
- params: params,
141
- opts: opts
142
- )
137
+ request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts)
143
138
  end
144
139
 
145
140
  def self.void_invoice(invoice, params = {}, opts = {})
@@ -49,6 +49,95 @@ module Stripe
49
49
  opts: opts
50
50
  )
51
51
  end
52
+
53
+ def test_helpers
54
+ TestHelpers.new(self)
55
+ end
56
+
57
+ class TestHelpers < APIResourceTestHelpers
58
+ RESOURCE_CLASS = Authorization
59
+
60
+ def self.capture(authorization, params = {}, opts = {})
61
+ request_stripe_object(
62
+ method: :post,
63
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(authorization) }),
64
+ params: params,
65
+ opts: opts
66
+ )
67
+ end
68
+
69
+ def self.create(params = {}, opts = {})
70
+ request_stripe_object(
71
+ method: :post,
72
+ path: "/v1/test_helpers/issuing/authorizations",
73
+ params: params,
74
+ opts: opts
75
+ )
76
+ end
77
+
78
+ def self.expire(authorization, params = {}, opts = {})
79
+ request_stripe_object(
80
+ method: :post,
81
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
82
+ params: params,
83
+ opts: opts
84
+ )
85
+ end
86
+
87
+ def self.increment(authorization, params = {}, opts = {})
88
+ request_stripe_object(
89
+ method: :post,
90
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
91
+ params: params,
92
+ opts: opts
93
+ )
94
+ end
95
+
96
+ def self.reverse(authorization, params = {}, opts = {})
97
+ request_stripe_object(
98
+ method: :post,
99
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(authorization) }),
100
+ params: params,
101
+ opts: opts
102
+ )
103
+ end
104
+
105
+ def capture(params = {}, opts = {})
106
+ @resource.request_stripe_object(
107
+ method: :post,
108
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(@resource["id"]) }),
109
+ params: params,
110
+ opts: opts
111
+ )
112
+ end
113
+
114
+ def expire(params = {}, opts = {})
115
+ @resource.request_stripe_object(
116
+ method: :post,
117
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(@resource["id"]) }),
118
+ params: params,
119
+ opts: opts
120
+ )
121
+ end
122
+
123
+ def increment(params = {}, opts = {})
124
+ @resource.request_stripe_object(
125
+ method: :post,
126
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(@resource["id"]) }),
127
+ params: params,
128
+ opts: opts
129
+ )
130
+ end
131
+
132
+ def reverse(params = {}, opts = {})
133
+ @resource.request_stripe_object(
134
+ method: :post,
135
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(@resource["id"]) }),
136
+ params: params,
137
+ opts: opts
138
+ )
139
+ end
140
+ end
52
141
  end
53
142
  end
54
143
  end
@@ -13,6 +13,50 @@ module Stripe
13
13
  include Stripe::APIOperations::Save
14
14
 
15
15
  OBJECT_NAME = "issuing.transaction"
16
+
17
+ def test_helpers
18
+ TestHelpers.new(self)
19
+ end
20
+
21
+ class TestHelpers < APIResourceTestHelpers
22
+ RESOURCE_CLASS = Transaction
23
+
24
+ def self.create_force_capture(params = {}, opts = {})
25
+ request_stripe_object(
26
+ method: :post,
27
+ path: "/v1/test_helpers/issuing/transactions/create_force_capture",
28
+ params: params,
29
+ opts: opts
30
+ )
31
+ end
32
+
33
+ def self.create_unlinked_refund(params = {}, opts = {})
34
+ request_stripe_object(
35
+ method: :post,
36
+ path: "/v1/test_helpers/issuing/transactions/create_unlinked_refund",
37
+ params: params,
38
+ opts: opts
39
+ )
40
+ end
41
+
42
+ def self.refund(transaction, params = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :post,
45
+ path: format("/v1/test_helpers/issuing/transactions/%<transaction>s/refund", { transaction: CGI.escape(transaction) }),
46
+ params: params,
47
+ opts: opts
48
+ )
49
+ end
50
+
51
+ def refund(params = {}, opts = {})
52
+ @resource.request_stripe_object(
53
+ method: :post,
54
+ path: format("/v1/test_helpers/issuing/transactions/%<transaction>s/refund", { transaction: CGI.escape(@resource["id"]) }),
55
+ params: params,
56
+ opts: opts
57
+ )
58
+ end
59
+ end
16
60
  end
17
61
  end
18
62
  end
@@ -8,14 +8,9 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
10
  include Stripe::APIOperations::Save
11
- extend Stripe::APIOperations::NestedResource
12
11
 
13
12
  OBJECT_NAME = "quote"
14
13
 
15
- nested_resource_class_methods :preview_invoice, operations: %i[list]
16
- nested_resource_class_methods :preview_subscription_schedule,
17
- operations: %i[list]
18
-
19
14
  def accept(params = {}, opts = {})
20
15
  request_stripe_object(
21
16
  method: :post,
@@ -34,15 +29,6 @@ module Stripe
34
29
  )
35
30
  end
36
31
 
37
- def draft_quote(params = {}, opts = {})
38
- request_stripe_object(
39
- method: :post,
40
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
41
- params: params,
42
- opts: opts
43
- )
44
- end
45
-
46
32
  def finalize_quote(params = {}, opts = {})
47
33
  request_stripe_object(
48
34
  method: :post,
@@ -70,24 +56,6 @@ module Stripe
70
56
  )
71
57
  end
72
58
 
73
- def list_lines(params = {}, opts = {})
74
- request_stripe_object(
75
- method: :get,
76
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
77
- params: params,
78
- opts: opts
79
- )
80
- end
81
-
82
- def mark_stale_quote(params = {}, opts = {})
83
- request_stripe_object(
84
- method: :post,
85
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
86
- params: params,
87
- opts: opts
88
- )
89
- end
90
-
91
59
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
92
60
  config = opts[:client]&.config || Stripe.config
93
61
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -100,24 +68,6 @@ module Stripe
100
68
  )
101
69
  end
102
70
 
103
- def preview_invoice_lines(preview_invoice, params = {}, opts = {})
104
- request_stripe_object(
105
- method: :get,
106
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
107
- params: params,
108
- opts: opts
109
- )
110
- end
111
-
112
- def reestimate(params = {}, opts = {})
113
- request_stripe_object(
114
- method: :post,
115
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
116
- params: params,
117
- opts: opts
118
- )
119
- end
120
-
121
71
  def self.accept(quote, params = {}, opts = {})
122
72
  request_stripe_object(
123
73
  method: :post,
@@ -136,15 +86,6 @@ module Stripe
136
86
  )
137
87
  end
138
88
 
139
- def self.draft_quote(quote, params = {}, opts = {})
140
- request_stripe_object(
141
- method: :post,
142
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
143
- params: params,
144
- opts: opts
145
- )
146
- end
147
-
148
89
  def self.finalize_quote(quote, params = {}, opts = {})
149
90
  request_stripe_object(
150
91
  method: :post,
@@ -172,24 +113,6 @@ module Stripe
172
113
  )
173
114
  end
174
115
 
175
- def self.list_lines(quote, params = {}, opts = {})
176
- request_stripe_object(
177
- method: :get,
178
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
179
- params: params,
180
- opts: opts
181
- )
182
- end
183
-
184
- def self.mark_stale_quote(quote, params = {}, opts = {})
185
- request_stripe_object(
186
- method: :post,
187
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
188
- params: params,
189
- opts: opts
190
- )
191
- end
192
-
193
116
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
194
117
  config = opts[:client]&.config || Stripe.config
195
118
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -201,28 +124,5 @@ module Stripe
201
124
  &read_body_chunk_block
202
125
  )
203
126
  end
204
-
205
- def self.preview_invoice_lines(
206
- quote,
207
- preview_invoice,
208
- params = {},
209
- opts = {}
210
- )
211
- request_stripe_object(
212
- method: :get,
213
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
214
- params: params,
215
- opts: opts
216
- )
217
- end
218
-
219
- def self.reestimate(quote, params = {}, opts = {})
220
- request_stripe_object(
221
- method: :post,
222
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
223
- params: params,
224
- opts: opts
225
- )
226
- end
227
127
  end
228
128
  end
@@ -19,8 +19,7 @@ module Stripe
19
19
 
20
20
  OBJECT_NAME = "source"
21
21
 
22
- nested_resource_class_methods :source_transaction,
23
- operations: %i[retrieve list]
22
+ nested_resource_class_methods :source_transaction, operations: %i[retrieve list]
24
23
 
25
24
  def verify(params = {}, opts = {})
26
25
  request_stripe_object(
@@ -12,15 +12,6 @@ module Stripe
12
12
 
13
13
  OBJECT_NAME = "subscription_schedule"
14
14
 
15
- def amend(params = {}, opts = {})
16
- request_stripe_object(
17
- method: :post,
18
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
19
- params: params,
20
- opts: opts
21
- )
22
- end
23
-
24
15
  def cancel(params = {}, opts = {})
25
16
  request_stripe_object(
26
17
  method: :post,
@@ -39,15 +30,6 @@ module Stripe
39
30
  )
40
31
  end
41
32
 
42
- def self.amend(schedule, params = {}, opts = {})
43
- request_stripe_object(
44
- method: :post,
45
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
46
- params: params,
47
- opts: opts
48
- )
49
- end
50
-
51
33
  def self.cancel(schedule, params = {}, opts = {})
52
34
  request_stripe_object(
53
35
  method: :post,
@@ -23,33 +23,6 @@ module Stripe
23
23
  )
24
24
  end
25
25
 
26
- def collect_inputs(params = {}, opts = {})
27
- request_stripe_object(
28
- method: :post,
29
- path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(self["id"]) }),
30
- params: params,
31
- opts: opts
32
- )
33
- end
34
-
35
- def collect_payment_method(params = {}, opts = {})
36
- request_stripe_object(
37
- method: :post,
38
- path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }),
39
- params: params,
40
- opts: opts
41
- )
42
- end
43
-
44
- def confirm_payment_intent(params = {}, opts = {})
45
- request_stripe_object(
46
- method: :post,
47
- path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }),
48
- params: params,
49
- opts: opts
50
- )
51
- end
52
-
53
26
  def process_payment_intent(params = {}, opts = {})
54
27
  request_stripe_object(
55
28
  method: :post,
@@ -95,33 +68,6 @@ module Stripe
95
68
  )
96
69
  end
97
70
 
98
- def self.collect_inputs(reader, params = {}, opts = {})
99
- request_stripe_object(
100
- method: :post,
101
- path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
102
- params: params,
103
- opts: opts
104
- )
105
- end
106
-
107
- def self.collect_payment_method(reader, params = {}, opts = {})
108
- request_stripe_object(
109
- method: :post,
110
- path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
111
- params: params,
112
- opts: opts
113
- )
114
- end
115
-
116
- def self.confirm_payment_intent(reader, params = {}, opts = {})
117
- request_stripe_object(
118
- method: :post,
119
- path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
120
- params: params,
121
- opts: opts
122
- )
123
- end
124
-
125
71
  def self.process_payment_intent(reader, params = {}, opts = {})
126
72
  request_stripe_object(
127
73
  method: :post,
@@ -20,7 +20,6 @@ module Stripe
20
20
 
21
21
  OBJECT_NAME = "transfer"
22
22
 
23
- nested_resource_class_methods :reversal,
24
- operations: %i[create retrieve update list]
23
+ nested_resource_class_methods :reversal, operations: %i[create retrieve update list]
25
24
  end
26
25
  end
@@ -55,11 +55,7 @@ module Stripe
55
55
  )
56
56
  end
57
57
 
58
- def self.return_outbound_transfer(
59
- outbound_transfer,
60
- params = {},
61
- opts = {}
62
- )
58
+ def self.return_outbound_transfer(outbound_transfer, params = {}, opts = {})
63
59
  request_stripe_object(
64
60
  method: :post,
65
61
  path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/return", { outbound_transfer: CGI.escape(outbound_transfer) }),
@@ -14,9 +14,6 @@ require "stripe/resources/bank_account"
14
14
  require "stripe/resources/billing_portal/configuration"
15
15
  require "stripe/resources/billing_portal/session"
16
16
  require "stripe/resources/capability"
17
- require "stripe/resources/capital/financing_offer"
18
- require "stripe/resources/capital/financing_summary"
19
- require "stripe/resources/capital/financing_transaction"
20
17
  require "stripe/resources/card"
21
18
  require "stripe/resources/cash_balance"
22
19
  require "stripe/resources/charge"
@@ -28,7 +25,6 @@ require "stripe/resources/credit_note_line_item"
28
25
  require "stripe/resources/customer"
29
26
  require "stripe/resources/customer_balance_transaction"
30
27
  require "stripe/resources/customer_cash_balance_transaction"
31
- require "stripe/resources/customer_session"
32
28
  require "stripe/resources/discount"
33
29
  require "stripe/resources/dispute"
34
30
  require "stripe/resources/ephemeral_key"
@@ -39,12 +35,8 @@ require "stripe/resources/file_link"
39
35
  require "stripe/resources/financial_connections/account"
40
36
  require "stripe/resources/financial_connections/account_owner"
41
37
  require "stripe/resources/financial_connections/account_ownership"
42
- require "stripe/resources/financial_connections/inferred_balance"
43
38
  require "stripe/resources/financial_connections/session"
44
- require "stripe/resources/financial_connections/transaction"
45
39
  require "stripe/resources/funding_instructions"
46
- require "stripe/resources/gift_cards/card"
47
- require "stripe/resources/gift_cards/transaction"
48
40
  require "stripe/resources/identity/verification_report"
49
41
  require "stripe/resources/identity/verification_session"
50
42
  require "stripe/resources/invoice"
@@ -52,15 +44,12 @@ require "stripe/resources/invoice_item"
52
44
  require "stripe/resources/invoice_line_item"
53
45
  require "stripe/resources/issuing/authorization"
54
46
  require "stripe/resources/issuing/card"
55
- require "stripe/resources/issuing/card_bundle"
56
- require "stripe/resources/issuing/card_design"
57
47
  require "stripe/resources/issuing/cardholder"
58
48
  require "stripe/resources/issuing/dispute"
59
49
  require "stripe/resources/issuing/transaction"
60
50
  require "stripe/resources/line_item"
61
51
  require "stripe/resources/login_link"
62
52
  require "stripe/resources/mandate"
63
- require "stripe/resources/order"
64
53
  require "stripe/resources/payment_intent"
65
54
  require "stripe/resources/payment_link"
66
55
  require "stripe/resources/payment_method"
@@ -73,9 +62,6 @@ require "stripe/resources/price"
73
62
  require "stripe/resources/product"
74
63
  require "stripe/resources/promotion_code"
75
64
  require "stripe/resources/quote"
76
- require "stripe/resources/quote_phase"
77
- require "stripe/resources/quote_preview_invoice"
78
- require "stripe/resources/quote_preview_schedule"
79
65
  require "stripe/resources/radar/early_fraud_warning"
80
66
  require "stripe/resources/radar/value_list"
81
67
  require "stripe/resources/radar/value_list_item"
@@ -95,8 +81,6 @@ require "stripe/resources/subscription_item"
95
81
  require "stripe/resources/subscription_schedule"
96
82
  require "stripe/resources/tax/calculation"
97
83
  require "stripe/resources/tax/calculation_line_item"
98
- require "stripe/resources/tax/form"
99
- require "stripe/resources/tax/registration"
100
84
  require "stripe/resources/tax/settings"
101
85
  require "stripe/resources/tax/transaction"
102
86
  require "stripe/resources/tax/transaction_line_item"