stripe 21.0.0 → 21.1.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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_operations/request.rb +16 -7
  3. data/lib/stripe/api_operations/save.rb +4 -4
  4. data/lib/stripe/api_requestor.rb +54 -34
  5. data/lib/stripe/api_resource.rb +1 -2
  6. data/lib/stripe/api_version.rb +1 -1
  7. data/lib/stripe/connection_manager.rb +3 -0
  8. data/lib/stripe/event_types.rb +20 -0
  9. data/lib/stripe/events/v2_core_account_closed_event.rb +2 -2
  10. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +2 -2
  11. data/lib/stripe/events/v2_core_claimable_sandbox_claimed_event.rb +44 -0
  12. data/lib/stripe/events/v2_core_claimable_sandbox_created_event.rb +44 -0
  13. data/lib/stripe/events/v2_core_claimable_sandbox_expired_event.rb +44 -0
  14. data/lib/stripe/events/v2_core_claimable_sandbox_expiring_event.rb +44 -0
  15. data/lib/stripe/events/v2_core_claimable_sandbox_updated_event.rb +44 -0
  16. data/lib/stripe/object_types.rb +1 -0
  17. data/lib/stripe/params/billing_portal/configuration_create_params.rb +1 -1
  18. data/lib/stripe/params/billing_portal/configuration_update_params.rb +1 -1
  19. data/lib/stripe/params/checkout/session_create_params.rb +8 -1
  20. data/lib/stripe/params/coupon_create_params.rb +1 -1
  21. data/lib/stripe/params/financial_connections/session_create_params.rb +1 -1
  22. data/lib/stripe/params/invoice_item_create_params.rb +1 -1
  23. data/lib/stripe/params/payment_intent_capture_params.rb +663 -1
  24. data/lib/stripe/params/payment_intent_confirm_params.rb +663 -1
  25. data/lib/stripe/params/payment_intent_create_params.rb +664 -2
  26. data/lib/stripe/params/payment_intent_update_params.rb +664 -2
  27. data/lib/stripe/params/payment_link_update_params.rb +4 -0
  28. data/lib/stripe/params/product_create_params.rb +4 -1
  29. data/lib/stripe/params/product_update_params.rb +4 -1
  30. data/lib/stripe/params/quote_create_params.rb +1 -1
  31. data/lib/stripe/params/quote_update_params.rb +1 -1
  32. data/lib/stripe/params/reporting/report_run_create_params.rb +4 -0
  33. data/lib/stripe/params/tax/registration_create_params.rb +13 -1
  34. data/lib/stripe/params/test_helpers/treasury/inbound_transfer_fail_params.rb +23 -1
  35. data/lib/stripe/params/test_helpers/treasury/inbound_transfer_return_inbound_transfer_params.rb +34 -1
  36. data/lib/stripe/params/treasury/inbound_transfer_fail_params.rb +23 -1
  37. data/lib/stripe/params/treasury/inbound_transfer_return_inbound_transfer_params.rb +34 -1
  38. data/lib/stripe/params/v2/core/account_create_params.rb +138 -4
  39. data/lib/stripe/params/v2/core/account_link_create_params.rb +19 -1
  40. data/lib/stripe/params/v2/core/account_update_params.rb +138 -4
  41. data/lib/stripe/params/v2/core/claimable_sandbox_create_params.rb +63 -0
  42. data/lib/stripe/params/v2/core/claimable_sandbox_renew_onboarding_link_params.rb +32 -0
  43. data/lib/stripe/params/v2/core/claimable_sandbox_retrieve_params.rb +17 -0
  44. data/lib/stripe/params/v2/money_management/financial_account_list_params.rb +1 -1
  45. data/lib/stripe/params/v2/money_management/financial_address_create_params.rb +2 -2
  46. data/lib/stripe/params.rb +7 -0
  47. data/lib/stripe/request_options.rb +19 -2
  48. data/lib/stripe/resources/apps/install.rb +2 -2
  49. data/lib/stripe/resources/balance_transaction.rb +1 -1
  50. data/lib/stripe/resources/charge.rb +274 -5
  51. data/lib/stripe/resources/checkout/session.rb +4 -0
  52. data/lib/stripe/resources/confirmation_token.rb +2 -2
  53. data/lib/stripe/resources/coupon.rb +6 -3
  54. data/lib/stripe/resources/dispute.rb +1 -1
  55. data/lib/stripe/resources/event.rb +2 -2
  56. data/lib/stripe/resources/issuing/card.rb +1 -1
  57. data/lib/stripe/resources/payment_attempt_record.rb +4 -1
  58. data/lib/stripe/resources/payment_intent.rb +575 -2
  59. data/lib/stripe/resources/payment_method.rb +2 -2
  60. data/lib/stripe/resources/payment_record.rb +4 -1
  61. data/lib/stripe/resources/product.rb +2 -0
  62. data/lib/stripe/resources/radar/payment_evaluation.rb +1 -1
  63. data/lib/stripe/resources/refund.rb +38 -0
  64. data/lib/stripe/resources/reporting/report_run.rb +2 -0
  65. data/lib/stripe/resources/reserve/hold.rb +1 -1
  66. data/lib/stripe/resources/setup_attempt.rb +2 -2
  67. data/lib/stripe/resources/setup_intent.rb +1 -1
  68. data/lib/stripe/resources/tax/registration.rb +16 -1
  69. data/lib/stripe/resources/treasury/inbound_transfer.rb +35 -7
  70. data/lib/stripe/resources/treasury/outbound_payment.rb +37 -9
  71. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -9
  72. data/lib/stripe/resources/treasury/received_credit.rb +1 -1
  73. data/lib/stripe/resources/treasury/received_debit.rb +1 -1
  74. data/lib/stripe/resources/v2/core/account.rb +246 -3
  75. data/lib/stripe/resources/v2/core/account_link.rb +18 -1
  76. data/lib/stripe/resources/v2/core/account_person_token.rb +2 -0
  77. data/lib/stripe/resources/v2/core/account_token.rb +3 -1
  78. data/lib/stripe/resources/v2/core/claimable_sandbox.rb +269 -0
  79. data/lib/stripe/resources/v2/core/event_base.rb +8 -25
  80. data/lib/stripe/resources/v2/core/event_notification.rb +32 -0
  81. data/lib/stripe/resources.rb +17 -0
  82. data/lib/stripe/services/apps/install_service.rb +2 -2
  83. data/lib/stripe/services/checkout/session_service.rb +2 -0
  84. data/lib/stripe/services/event_service.rb +1 -1
  85. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +3 -3
  86. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +4 -4
  87. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +4 -4
  88. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -1
  89. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -1
  90. data/lib/stripe/services/v2/core/account_link_service.rb +1 -1
  91. data/lib/stripe/services/v2/core/account_token_service.rb +2 -2
  92. data/lib/stripe/services/v2/core/accounts/person_token_service.rb +2 -1
  93. data/lib/stripe/services/v2/core/claimable_sandbox_service.rb +49 -0
  94. data/lib/stripe/services/v2/core_service.rb +2 -1
  95. data/lib/stripe/services.rb +2 -0
  96. data/lib/stripe/stripe_client.rb +6 -0
  97. data/lib/stripe/stripe_configuration.rb +9 -2
  98. data/lib/stripe/stripe_event_notification_handler.rb +26 -0
  99. data/lib/stripe/stripe_object.rb +22 -9
  100. data/lib/stripe/version.rb +1 -1
  101. data/rbi/stripe.rbi +6888 -221
  102. metadata +12 -2
@@ -0,0 +1,269 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Core
7
+ # A claimable sandbox is a Stripe sandbox that a user can claim into a new or existing Stripe account
8
+ # through an onboarding link. You can prefill it with an email address, sandbox name, and country.
9
+ # Claimable sandboxes have 60 days to be claimed. After this expiration time has passed,
10
+ # if the sandbox is not claimed, it will be deleted.
11
+ class ClaimableSandbox < APIResource
12
+ OBJECT_NAME = "v2.core.claimable_sandbox"
13
+ def self.object_name
14
+ "v2.core.claimable_sandbox"
15
+ end
16
+
17
+ class OnboardingLinkDetails < ::Stripe::StripeObject
18
+ # Time at which the onboarding link expires. Represented as an RFC 3339 timestamp in UTC
19
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
20
+ attr_reader :expires_at
21
+ # The URL the user will be redirected to if the onboarding link is expired or invalid.
22
+ # The URL specified should attempt to generate a new onboarding link,
23
+ # and re-direct the user to this new onboarding link so that they can proceed with the onboarding flow.
24
+ attr_reader :refresh_url
25
+ # The URL offered to the user as a way back to your app after they claim the sandbox.
26
+ attr_reader :return_url
27
+ # The URL that lets a user claim the sandbox or continue onboarding their Stripe account,
28
+ # depending on the sandbox's status.
29
+ attr_reader :url
30
+
31
+ def self.inner_class_types
32
+ @inner_class_types = {}
33
+ end
34
+
35
+ def self.field_remappings
36
+ @field_remappings = {}
37
+ end
38
+ end
39
+
40
+ class OwnerDetails < ::Stripe::StripeObject
41
+ # The ID of the live mode Stripe account that owns the sandbox.
42
+ # This field is only set when `owner_details.app_install_status` is `installed`.
43
+ attr_reader :account
44
+ # Indicates whether the platform app is installed on the sandbox’s live mode owner account.
45
+ attr_reader :app_install_status
46
+
47
+ def self.inner_class_types
48
+ @inner_class_types = {}
49
+ end
50
+
51
+ def self.field_remappings
52
+ @field_remappings = {}
53
+ end
54
+ end
55
+
56
+ class Prefill < ::Stripe::StripeObject
57
+ # Country in which the account holder resides, or in which the business is legally established.
58
+ # Use two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
59
+ attr_reader :country
60
+ # Email address of the user who will claim the sandbox.
61
+ # Stripe sends this address an invitation to claim the sandbox and a reminder before the unclaimed sandbox expires.
62
+ attr_reader :email
63
+ # Name for the sandbox.
64
+ attr_reader :name
65
+
66
+ def self.inner_class_types
67
+ @inner_class_types = {}
68
+ end
69
+
70
+ def self.field_remappings
71
+ @field_remappings = {}
72
+ end
73
+ end
74
+
75
+ class SandboxDetails < ::Stripe::StripeObject
76
+ class ApiKeys < ::Stripe::StripeObject
77
+ class Mcp < ::Stripe::StripeObject
78
+ class SecretKey < ::Stripe::StripeObject
79
+ # The plaintext token for the API key.
80
+ attr_reader :token
81
+
82
+ def self.inner_class_types
83
+ @inner_class_types = {}
84
+ end
85
+
86
+ def self.field_remappings
87
+ @field_remappings = {}
88
+ end
89
+ end
90
+ # Time at which the API key was created. Represented as an RFC 3339 timestamp in UTC
91
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
92
+ attr_reader :created
93
+ # Time at which the API key expires. Represented as an RFC 3339 timestamp in UTC
94
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
95
+ attr_reader :expires_at
96
+ # Unique identifier of the API key.
97
+ attr_reader :id
98
+ # Token for the secret key. Present only in the create response;
99
+ # null in subsequent retrieve responses.
100
+ attr_reader :secret_key
101
+ # Current status of the API key.
102
+ attr_reader :status
103
+ # Type of the API key.
104
+ attr_reader :type
105
+
106
+ def self.inner_class_types
107
+ @inner_class_types = { secret_key: SecretKey }
108
+ end
109
+
110
+ def self.field_remappings
111
+ @field_remappings = {}
112
+ end
113
+ end
114
+
115
+ class Publishable < ::Stripe::StripeObject
116
+ class PublishableKey < ::Stripe::StripeObject
117
+ # The plaintext token for the API key.
118
+ attr_reader :token
119
+
120
+ def self.inner_class_types
121
+ @inner_class_types = {}
122
+ end
123
+
124
+ def self.field_remappings
125
+ @field_remappings = {}
126
+ end
127
+ end
128
+ # Time at which the API key was created. Represented as an RFC 3339 timestamp in UTC
129
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
130
+ attr_reader :created
131
+ # Time at which the API key expires. Represented as an RFC 3339 timestamp in UTC
132
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
133
+ attr_reader :expires_at
134
+ # Unique identifier of the API key.
135
+ attr_reader :id
136
+ # Token for the publishable key. Present only in the create response;
137
+ # null in subsequent retrieve responses.
138
+ attr_reader :publishable_key
139
+ # Current status of the API key.
140
+ attr_reader :status
141
+ # Type of the API key.
142
+ attr_reader :type
143
+
144
+ def self.inner_class_types
145
+ @inner_class_types = { publishable_key: PublishableKey }
146
+ end
147
+
148
+ def self.field_remappings
149
+ @field_remappings = {}
150
+ end
151
+ end
152
+
153
+ class Secret < ::Stripe::StripeObject
154
+ class SecretKey < ::Stripe::StripeObject
155
+ # The plaintext token for the API key.
156
+ attr_reader :token
157
+
158
+ def self.inner_class_types
159
+ @inner_class_types = {}
160
+ end
161
+
162
+ def self.field_remappings
163
+ @field_remappings = {}
164
+ end
165
+ end
166
+ # Time at which the API key was created. Represented as an RFC 3339 timestamp in UTC
167
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
168
+ attr_reader :created
169
+ # Time at which the API key expires. Represented as an RFC 3339 timestamp in UTC
170
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
171
+ attr_reader :expires_at
172
+ # Unique identifier of the API key.
173
+ attr_reader :id
174
+ # Token for the secret key. Present only in the create response;
175
+ # null in subsequent retrieve responses.
176
+ attr_reader :secret_key
177
+ # Current status of the API key.
178
+ attr_reader :status
179
+ # Type of the API key.
180
+ attr_reader :type
181
+
182
+ def self.inner_class_types
183
+ @inner_class_types = { secret_key: SecretKey }
184
+ end
185
+
186
+ def self.field_remappings
187
+ @field_remappings = {}
188
+ end
189
+ end
190
+ # Object hash for the sandbox's MCP key.
191
+ # Null unless `enable_mcp_access: true` was passed in the creation request.
192
+ attr_reader :mcp
193
+ # Object hash for the sandbox's publishable key.
194
+ attr_reader :publishable
195
+ # Object hash for the sandbox's secret key.
196
+ attr_reader :secret
197
+
198
+ def self.inner_class_types
199
+ @inner_class_types = { mcp: Mcp, publishable: Publishable, secret: Secret }
200
+ end
201
+
202
+ def self.field_remappings
203
+ @field_remappings = {}
204
+ end
205
+ end
206
+ # The sandbox's Stripe account ID.
207
+ attr_reader :account
208
+ # Keys that can be used to set up an integration for this sandbox and operate on the account.
209
+ # Present in the create response. To fetch this field in the retrieve response,
210
+ # pass `sandbox_details.api_keys` in the `include` parameter.
211
+ attr_reader :api_keys
212
+
213
+ def self.inner_class_types
214
+ @inner_class_types = { api_keys: ApiKeys }
215
+ end
216
+
217
+ def self.field_remappings
218
+ @field_remappings = {}
219
+ end
220
+ end
221
+ # The distribution channel used to pre-install your Stripe App on the claimable sandbox.
222
+ # Use `testing` to install your app's external test version or `public` to install its published version.
223
+ attr_reader :channel
224
+ # Time at which the sandbox was claimed. Set when the status is `claimed` or `live`.
225
+ # Represented as an RFC 3339 timestamp in UTC with millisecond precision,
226
+ # for example `2022-09-18T13:22:18.123Z`.
227
+ attr_reader :claimed_at
228
+ # Time at which the sandbox was created. Represented as an RFC 3339 timestamp in UTC
229
+ # with millisecond precision, for example `2022-09-18T13:22:18.123Z`.
230
+ attr_reader :created
231
+ # Time at which the unclaimed sandbox expires. Null when the status is `claimed` or `live`.
232
+ # Represented as an RFC 3339 timestamp in UTC with millisecond precision,
233
+ # for example `2022-09-18T13:22:18.123Z`.
234
+ attr_reader :expires_at
235
+ # Unique identifier for the claimable sandbox.
236
+ attr_reader :id
237
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
238
+ attr_reader :livemode
239
+ # String representing the object's type. Objects of the same type share the same value of the object field.
240
+ attr_reader :object
241
+ # Details about the onboarding link.
242
+ # Null when the sandbox status is `live` or `expired`.
243
+ attr_reader :onboarding_link_details
244
+ # Details about the live mode owner account of the sandbox.
245
+ # This will be null until the sandbox is claimed.
246
+ attr_reader :owner_details
247
+ # Values prefilled during the creation of the sandbox. When a user claims the sandbox, they will be able to update these values.
248
+ attr_reader :prefill
249
+ # Data about the Stripe sandbox object.
250
+ attr_reader :sandbox_details
251
+ # Status of the sandbox.
252
+ attr_reader :status
253
+
254
+ def self.inner_class_types
255
+ @inner_class_types = {
256
+ onboarding_link_details: OnboardingLinkDetails,
257
+ owner_details: OwnerDetails,
258
+ prefill: Prefill,
259
+ sandbox_details: SandboxDetails,
260
+ }
261
+ end
262
+
263
+ def self.field_remappings
264
+ @field_remappings = {}
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
@@ -4,31 +4,14 @@ module Stripe
4
4
  module V2
5
5
  module Core
6
6
  class EventBase < APIResource
7
- # internal use: a requestor scoped to this event's own Stripe-Context,
8
- # discarding any Stripe-Account the configured requestor may carry.
9
- # `context`, not account, is what routes a direct-retrieve `Event` (and
10
- # requests made through #fetch_related_object) to the right account --
11
- # mirrors how EventNotification#initialize scopes @client.
12
- private def scoped_requestor
13
- @scoped_requestor ||= begin
14
- scoped_config = @requestor.config.reverse_duplicate_merge(
15
- stripe_account: nil, stripe_context: context
16
- )
17
- APIRequestor.new(scoped_config)
18
- end
19
- end
20
-
21
- # Overridden so that every generated `fetch_related_object` (which calls
22
- # this method) routes through #scoped_requestor. Still combines with this
23
- # event's retained @opts so a retained api_key/stripe_version override
24
- # survives, but with @opts's own stripe_account/stripe_context forced to
25
- # the safe values first, since those are exactly what may be stale left
26
- # over from how this Event itself was retrieved.
27
- protected def _request(method:, path:, base_address:, params: {}, opts: {})
28
- req_opts = RequestOptions.extract_opts_from_hash(opts)
29
- safe_opts = @opts.merge(stripe_account: nil, stripe_context: context)
30
- req_opts = RequestOptions.combine_opts(safe_opts, req_opts)
31
- scoped_requestor.execute_request(method, path, base_address, params: params, opts: req_opts)
7
+ # An event's payload determines the scope of its related objects, even
8
+ # when the event was retrieved using a different account or context.
9
+ protected def initialize_from(values, opts, last_response = nil, api_mode:, requestor:)
10
+ requestor = requestor.with_authorization_scope(
11
+ stripe_account: nil, stripe_context: values[:context] || values["context"]
12
+ )
13
+ opts = Util.normalize_opts(opts).except(:stripe_account, :stripe_context)
14
+ super
32
15
  end
33
16
  end
34
17
  end
@@ -75,6 +75,38 @@ module Stripe
75
75
  usage: ["fetch_event"])
76
76
  @client.deserialize(resp.http_body, api_mode: :v2)
77
77
  end
78
+
79
+ # The default inspect renders every instance variable, which would
80
+ # include the API key held by @client.
81
+ def inspect
82
+ "#<#{self.class}:0x#{object_id.to_s(16)} id=#{id.inspect} type=#{type.inspect}>"
83
+ end
84
+
85
+ # Implements custom encoding for YAML (Psych). Without it, Psych dumps
86
+ # every instance variable, including the API key held by @client.
87
+ def encode_with(coder)
88
+ (instance_variables - [:@client]).each do |ivar|
89
+ coder[ivar.to_s.delete_prefix("@")] = instance_variable_get(ivar)
90
+ end
91
+ end
92
+
93
+ # Implements custom decoding for YAML (Psych). A restored notification
94
+ # has no client, so it can't make requests.
95
+ def init_with(coder)
96
+ coder.map.each { |name, value| instance_variable_set("@#{name}", value) }
97
+ @client = DetachedClient.new
98
+ end
99
+
100
+ # Stands in for the client on a notification restored from YAML, so
101
+ # requests fail with an actionable error instead of a NoMethodError.
102
+ class DetachedClient
103
+ def raw_request(*)
104
+ raise AuthenticationError,
105
+ "This EventNotification was restored from a serialized copy and has no client. " \
106
+ "Parse the original payload with StripeClient#parse_event_notification to make requests."
107
+ end
108
+ end
109
+ private_constant :DetachedClient
78
110
  end
79
111
  end
80
112
  end
@@ -858,6 +858,16 @@ module Stripe
858
858
  autoload :V2CoreAccountPersonUpdatedEventNotification, "stripe/events/v2_core_account_person_updated_event"
859
859
  autoload :V2CoreAccountUpdatedEvent, "stripe/events/v2_core_account_updated_event"
860
860
  autoload :V2CoreAccountUpdatedEventNotification, "stripe/events/v2_core_account_updated_event"
861
+ autoload :V2CoreClaimableSandboxClaimedEvent, "stripe/events/v2_core_claimable_sandbox_claimed_event"
862
+ autoload :V2CoreClaimableSandboxClaimedEventNotification, "stripe/events/v2_core_claimable_sandbox_claimed_event"
863
+ autoload :V2CoreClaimableSandboxCreatedEvent, "stripe/events/v2_core_claimable_sandbox_created_event"
864
+ autoload :V2CoreClaimableSandboxCreatedEventNotification, "stripe/events/v2_core_claimable_sandbox_created_event"
865
+ autoload :V2CoreClaimableSandboxExpiredEvent, "stripe/events/v2_core_claimable_sandbox_expired_event"
866
+ autoload :V2CoreClaimableSandboxExpiredEventNotification, "stripe/events/v2_core_claimable_sandbox_expired_event"
867
+ autoload :V2CoreClaimableSandboxExpiringEvent, "stripe/events/v2_core_claimable_sandbox_expiring_event"
868
+ autoload :V2CoreClaimableSandboxExpiringEventNotification, "stripe/events/v2_core_claimable_sandbox_expiring_event"
869
+ autoload :V2CoreClaimableSandboxUpdatedEvent, "stripe/events/v2_core_claimable_sandbox_updated_event"
870
+ autoload :V2CoreClaimableSandboxUpdatedEventNotification, "stripe/events/v2_core_claimable_sandbox_updated_event"
861
871
  autoload :V2CoreEventDestinationPingEvent, "stripe/events/v2_core_event_destination_ping_event"
862
872
  autoload :V2CoreEventDestinationPingEventNotification, "stripe/events/v2_core_event_destination_ping_event"
863
873
  autoload :V2MoneyManagementAdjustmentCreatedEvent, "stripe/events/v2_money_management_adjustment_created_event"
@@ -1108,6 +1118,7 @@ module Stripe
1108
1118
  autoload :AccountPerson, "stripe/resources/v2/core/account_person"
1109
1119
  autoload :AccountPersonToken, "stripe/resources/v2/core/account_person_token"
1110
1120
  autoload :AccountToken, "stripe/resources/v2/core/account_token"
1121
+ autoload :ClaimableSandbox, "stripe/resources/v2/core/claimable_sandbox"
1111
1122
  autoload :Event, "stripe/resources/v2/core/event"
1112
1123
  autoload :EventBase, "stripe/resources/v2/core/event_base"
1113
1124
  autoload :EventDestination, "stripe/resources/v2/core/event_destination"
@@ -1309,6 +1320,7 @@ module Stripe
1309
1320
  stripe/resources/v2/core/account_person
1310
1321
  stripe/resources/v2/core/account_person_token
1311
1322
  stripe/resources/v2/core/account_token
1323
+ stripe/resources/v2/core/claimable_sandbox
1312
1324
  stripe/resources/v2/core/event
1313
1325
  stripe/resources/v2/core/event_destination
1314
1326
  stripe/resources/v2/core/vault/gb_bank_account
@@ -1619,6 +1631,11 @@ module Stripe
1619
1631
  stripe/events/v2_core_account_person_deleted_event
1620
1632
  stripe/events/v2_core_account_person_updated_event
1621
1633
  stripe/events/v2_core_account_updated_event
1634
+ stripe/events/v2_core_claimable_sandbox_claimed_event
1635
+ stripe/events/v2_core_claimable_sandbox_created_event
1636
+ stripe/events/v2_core_claimable_sandbox_expired_event
1637
+ stripe/events/v2_core_claimable_sandbox_expiring_event
1638
+ stripe/events/v2_core_claimable_sandbox_updated_event
1622
1639
  stripe/events/v2_core_event_destination_ping_event
1623
1640
  stripe/events/v2_money_management_adjustment_created_event
1624
1641
  stripe/events/v2_money_management_financial_account_created_event
@@ -4,7 +4,7 @@
4
4
  module Stripe
5
5
  module Apps
6
6
  class InstallService < StripeService
7
- # Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer acting on a connected account through Stripe-Account installs or reinstalls its app there, and an embedding platform can do the same once the app's developer approves its request to embed the app. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned.
7
+ # Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer acting on a connected account through Stripe-Account installs or reinstalls its app there, and an embedding platform can do the same once the app's developer approves its request to embed the app and the platform has accepted the Embedding Platform Terms and Conditions in the Dashboard. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned.
8
8
  def create(params = {}, opts = {})
9
9
  request(
10
10
  method: :post,
@@ -15,7 +15,7 @@ module Stripe
15
15
  )
16
16
  end
17
17
 
18
- # Returns a list of app installs. An app developer filtering by its own app with its own key sees that app's installs across the accounts that installed it. An app developer acting on a connected account through Stripe-Account and filtering by its app sees that account's installs of the app, and an embedding platform acting on a connected account sees only the installs it created there. Other callers see the installs on their own account. A live key lists live installs and a test key lists test installs; the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox.
18
+ # Returns a list of app installs. An app developer filtering by its own app with its own key sees that app's installs across the accounts that installed it. An app developer acting on a connected account through Stripe-Account and filtering by its app sees that account's installs of the app, and an embedding platform acting on a connected account sees only the installs it created there. Other callers see the installs on their own account. A live key lists live installs and a test key lists test installs; the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox, and also that app's legacy test mode installs when the developer has no legacy test mode.
19
19
  def list(params = {}, opts = {})
20
20
  request(
21
21
  method: :get,
@@ -12,6 +12,8 @@ module Stripe
12
12
  end
13
13
 
14
14
  # Creates a Checkout Session object.
15
+ #
16
+ # Validate requests on your server and protect your application's Session-creation endpoint with access controls and limits on repeated creation. See [Protect your Session-creation endpoint](https://docs.stripe.com/payments/accept-a-payment?payment-ui=elements&api-integration=checkout#protect-session-creation).
15
17
  def create(params = {}, opts = {})
16
18
  unless params.is_a?(Stripe::RequestParams)
17
19
  params = ::Stripe::Checkout::SessionCreateParams.coerce_params(params)
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class EventService < StripeService
6
- # List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
6
+ # List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object api_version attribute (not according to your current Stripe API version or Stripe-Version header). The list includes only events for the account that makes the request. A platform's list doesn't include events from its connected accounts. To list a connected account's events, make the request <a href="https://docs.stripe.com/connect/authentication">as the connected account](https://docs.stripe.com/api/events/object) using the Stripe-Account header.
7
7
  def list(params = {}, opts = {})
8
8
  request(method: :get, path: "/v1/events", params: params, opts: opts, base_address: :api)
9
9
  end
@@ -5,7 +5,7 @@ module Stripe
5
5
  module TestHelpers
6
6
  module Treasury
7
7
  class InboundTransferService < StripeService
8
- # Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.
8
+ # Transitions a test InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.
9
9
  def fail(id, params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -16,7 +16,7 @@ module Stripe
16
16
  )
17
17
  end
18
18
 
19
- # Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.
19
+ # Marks the test InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.
20
20
  def return_inbound_transfer(id, params = {}, opts = {})
21
21
  request(
22
22
  method: :post,
@@ -27,7 +27,7 @@ module Stripe
27
27
  )
28
28
  end
29
29
 
30
- # Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.
30
+ # Transitions a test InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.
31
31
  def succeed(id, params = {}, opts = {})
32
32
  request(
33
33
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module TestHelpers
6
6
  module Treasury
7
7
  class OutboundPaymentService < StripeService
8
- # Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
8
+ # Transitions a test OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
9
9
  def fail(id, params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -16,7 +16,7 @@ module Stripe
16
16
  )
17
17
  end
18
18
 
19
- # Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
19
+ # Transitions a test OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
20
20
  def post(id, params = {}, opts = {})
21
21
  request(
22
22
  method: :post,
@@ -27,7 +27,7 @@ module Stripe
27
27
  )
28
28
  end
29
29
 
30
- # Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state.
30
+ # Transitions a test OutboundPayment to the returned status. The OutboundPayment must already be in the posted state.
31
31
  def return_outbound_payment(id, params = {}, opts = {})
32
32
  request(
33
33
  method: :post,
@@ -38,7 +38,7 @@ module Stripe
38
38
  )
39
39
  end
40
40
 
41
- # Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
41
+ # Updates a test OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and can't be in the canceled or failed states.
42
42
  def update(id, params = {}, opts = {})
43
43
  request(
44
44
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module TestHelpers
6
6
  module Treasury
7
7
  class OutboundTransferService < StripeService
8
- # Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.
8
+ # Transitions a test OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.
9
9
  def fail(outbound_transfer, params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -16,7 +16,7 @@ module Stripe
16
16
  )
17
17
  end
18
18
 
19
- # Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.
19
+ # Transitions a test OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.
20
20
  def post(outbound_transfer, params = {}, opts = {})
21
21
  request(
22
22
  method: :post,
@@ -27,7 +27,7 @@ module Stripe
27
27
  )
28
28
  end
29
29
 
30
- # Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state.
30
+ # Transitions a test OutboundTransfer to the returned status. The OutboundTransfer must already be in the posted state.
31
31
  def return_outbound_transfer(outbound_transfer, params = {}, opts = {})
32
32
  request(
33
33
  method: :post,
@@ -38,7 +38,7 @@ module Stripe
38
38
  )
39
39
  end
40
40
 
41
- # Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.
41
+ # Updates a test OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and can't be in the canceled or failed states.
42
42
  def update(outbound_transfer, params = {}, opts = {})
43
43
  request(
44
44
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module TestHelpers
6
6
  module Treasury
7
7
  class ReceivedCreditService < StripeService
8
- # Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties.
8
+ # Simulates a test ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredit objects initiated by third parties.
9
9
  def create(params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module TestHelpers
6
6
  module Treasury
7
7
  class ReceivedDebitService < StripeService
8
- # Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties.
8
+ # Simulates a test ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebit objects initiated by third parties.
9
9
  def create(params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module V2
6
6
  module Core
7
7
  class AccountLinkService < StripeService
8
- # Creates an AccountLink object that includes a single-use URL that an account can use to access a Stripe-hosted flow for collecting or updating required information.
8
+ # Creates an AccountLink object that includes a single-use URL that an account can use to access a Stripe-hosted flow for collecting or updating required information, or to access its Stripe-hosted Dashboard.
9
9
  #
10
10
  # ** raises RateLimitError
11
11
  def create(params = {}, opts = {})
@@ -8,8 +8,8 @@ module Stripe
8
8
  # Create an account token with a publishable key and pass it to the Accounts v2 API to
9
9
  # create or update an account without its data touching your server.
10
10
  # Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
11
- # In live mode, you can only create account tokens with your application's publishable key.
12
- # In test mode, you can create account tokens with your secret key or publishable key.
11
+ # In live mode, you must create account tokens using a live publishable key.
12
+ # In a sandbox, you can create account tokens with secret or publishable keys.
13
13
  #
14
14
  # ** raises RateLimitError
15
15
  def create(params = {}, opts = {})
@@ -7,7 +7,8 @@ module Stripe
7
7
  module Accounts
8
8
  class PersonTokenService < StripeService
9
9
  # Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
10
- # You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode.
10
+ # In live mode, you must create person tokens using a live publishable key.
11
+ # In a sandbox, you can create person tokens with secret or publishable keys.
11
12
  #
12
13
  # ** raises RateLimitError
13
14
  def create(account_id, params = {}, opts = {})
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Core
7
+ class ClaimableSandboxService < StripeService
8
+ # Create a claimable sandbox with prefilled data. The response includes an onboarding link that lets
9
+ # a user claim the sandbox into a new or existing Stripe account.
10
+ #
11
+ # ** raises RateLimitError
12
+ def create(params = {}, opts = {})
13
+ request(
14
+ method: :post,
15
+ path: "/v2/core/claimable_sandboxes",
16
+ params: params,
17
+ opts: opts,
18
+ base_address: :api
19
+ )
20
+ end
21
+
22
+ # Renew the claimable sandbox onboarding link. This invalidates the existing onboarding link.
23
+ # The endpoint only works on a claimable sandbox with status `unclaimed` or `claimed`.
24
+ def renew_onboarding_link(id, params = {}, opts = {})
25
+ request(
26
+ method: :post,
27
+ path: format("/v2/core/claimable_sandboxes/%<id>s/renew_onboarding_link", { id: CGI.escape(id) }),
28
+ params: params,
29
+ opts: opts,
30
+ base_address: :api
31
+ )
32
+ end
33
+
34
+ # Retrieves the details of a claimable sandbox that was previously been created.
35
+ # Supply the unique claimable sandbox ID that was returned from your creation request,
36
+ # and Stripe will return the corresponding sandbox information.
37
+ def retrieve(id, params = {}, opts = {})
38
+ request(
39
+ method: :get,
40
+ path: format("/v2/core/claimable_sandboxes/%<id>s", { id: CGI.escape(id) }),
41
+ params: params,
42
+ opts: opts,
43
+ base_address: :api
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -4,13 +4,14 @@
4
4
  module Stripe
5
5
  module V2
6
6
  class CoreService < StripeService
7
- attr_reader :accounts, :account_links, :account_tokens, :events, :event_destinations, :vault
7
+ attr_reader :accounts, :account_links, :account_tokens, :claimable_sandboxes, :events, :event_destinations, :vault
8
8
 
9
9
  def initialize(requestor)
10
10
  super
11
11
  @accounts = Stripe::V2::Core::AccountService.new(@requestor)
12
12
  @account_links = Stripe::V2::Core::AccountLinkService.new(@requestor)
13
13
  @account_tokens = Stripe::V2::Core::AccountTokenService.new(@requestor)
14
+ @claimable_sandboxes = Stripe::V2::Core::ClaimableSandboxService.new(@requestor)
14
15
  @events = Stripe::V2::Core::EventService.new(@requestor)
15
16
  @event_destinations = Stripe::V2::Core::EventDestinationService.new(@requestor)
16
17
  @vault = Stripe::V2::Core::VaultService.new(@requestor)