stripe 20.2.0.pre.alpha.1 → 20.2.0.pre.alpha.2

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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/event_types.rb +8 -0
  3. data/lib/stripe/events/v2_extend_object_definition_created_event.rb +61 -0
  4. data/lib/stripe/events/v2_extend_object_definition_version_created_event.rb +65 -0
  5. data/lib/stripe/object_types.rb +4 -0
  6. data/lib/stripe/params/account_session_create_params.rb +200 -0
  7. data/lib/stripe/params/checkout/session_create_params.rb +42 -1
  8. data/lib/stripe/params/confirmation_token_create_params.rb +21 -0
  9. data/lib/stripe/params/customer_tax_exemption_create_params.rb +29 -1
  10. data/lib/stripe/params/invoice_create_params.rb +8 -1
  11. data/lib/stripe/params/invoice_update_params.rb +8 -1
  12. data/lib/stripe/params/payment_attempt_record_report_authenticated_params.rb +49 -1
  13. data/lib/stripe/params/payment_intent_capture_params.rb +57 -1
  14. data/lib/stripe/params/payment_intent_confirm_params.rb +91 -1
  15. data/lib/stripe/params/payment_intent_create_params.rb +91 -1
  16. data/lib/stripe/params/payment_intent_decrement_authorization_params.rb +57 -1
  17. data/lib/stripe/params/payment_intent_increment_authorization_params.rb +57 -1
  18. data/lib/stripe/params/payment_intent_update_params.rb +91 -1
  19. data/lib/stripe/params/payment_method_configuration_create_params.rb +21 -0
  20. data/lib/stripe/params/payment_method_configuration_update_params.rb +21 -0
  21. data/lib/stripe/params/payment_method_create_params.rb +21 -0
  22. data/lib/stripe/params/quote_create_params.rb +1 -1
  23. data/lib/stripe/params/quote_update_params.rb +1 -1
  24. data/lib/stripe/params/radar/payment_evaluation_create_params.rb +13 -1
  25. data/lib/stripe/params/refund_create_params.rb +4 -0
  26. data/lib/stripe/params/setup_intent_confirm_params.rb +37 -0
  27. data/lib/stripe/params/setup_intent_create_params.rb +37 -0
  28. data/lib/stripe/params/setup_intent_update_params.rb +21 -0
  29. data/lib/stripe/params/subscription_create_params.rb +4 -0
  30. data/lib/stripe/params/subscription_list_params.rb +5 -1
  31. data/lib/stripe/params/subscription_update_params.rb +4 -0
  32. data/lib/stripe/params/tax/certificate_create_params.rb +21 -0
  33. data/lib/stripe/params/tax/certificate_delete_params.rb +8 -0
  34. data/lib/stripe/params/tax/certificate_list_params.rb +33 -0
  35. data/lib/stripe/params/tax/certificate_retrieve_params.rb +15 -0
  36. data/lib/stripe/params/tax/form_create_params.rb +504 -0
  37. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +21 -0
  38. data/lib/stripe/params/v2/core/account_session_create_params.rb +13 -0
  39. data/lib/stripe/params/v2/extend/object_definition_list_params.rb +17 -0
  40. data/lib/stripe/params/v2/extend/object_definition_retrieve_params.rb +10 -0
  41. data/lib/stripe/params/v2/extend/object_definitions/version_list_params.rb +19 -0
  42. data/lib/stripe/params/v2/extend/object_definitions/version_retrieve_params.rb +12 -0
  43. data/lib/stripe/params.rb +21 -0
  44. data/lib/stripe/resources/account_session.rb +81 -0
  45. data/lib/stripe/resources/apps/install.rb +1 -1
  46. data/lib/stripe/resources/charge.rb +354 -2
  47. data/lib/stripe/resources/checkout/session.rb +30 -0
  48. data/lib/stripe/resources/confirmation_token.rb +84 -0
  49. data/lib/stripe/resources/coupon.rb +6 -3
  50. data/lib/stripe/resources/customer_tax_exemption.rb +32 -1
  51. data/lib/stripe/resources/invoice.rb +3 -0
  52. data/lib/stripe/resources/payment_attempt_record.rb +133 -0
  53. data/lib/stripe/resources/payment_intent.rb +100 -2
  54. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +46 -1
  55. data/lib/stripe/resources/payment_method.rb +84 -0
  56. data/lib/stripe/resources/payment_method_configuration.rb +34 -0
  57. data/lib/stripe/resources/payment_record.rb +133 -0
  58. data/lib/stripe/resources/radar/payment_evaluation.rb +37 -2
  59. data/lib/stripe/resources/refund.rb +38 -0
  60. data/lib/stripe/resources/reporting/report_run.rb +2 -0
  61. data/lib/stripe/resources/setup_attempt.rb +3 -0
  62. data/lib/stripe/resources/setup_intent.rb +19 -1
  63. data/lib/stripe/resources/subscription.rb +3 -1
  64. data/lib/stripe/resources/tax/certificate.rb +81 -0
  65. data/lib/stripe/resources/tax/form.rb +11 -0
  66. data/lib/stripe/resources/tax/form_correction.rb +43 -0
  67. data/lib/stripe/resources/treasury/inbound_transfer.rb +29 -1
  68. data/lib/stripe/resources/treasury/outbound_payment.rb +29 -1
  69. data/lib/stripe/resources/treasury/outbound_transfer.rb +29 -1
  70. data/lib/stripe/resources/v2/core/account_session.rb +27 -0
  71. data/lib/stripe/resources/v2/data/search_result_list.rb +1 -1
  72. data/lib/stripe/resources/v2/extend/object_definition.rb +40 -0
  73. data/lib/stripe/resources/v2/extend/object_definition_version.rb +168 -0
  74. data/lib/stripe/resources/v2/tax/operations_resolve_address_result.rb +1 -1
  75. data/lib/stripe/resources.rb +17 -0
  76. data/lib/stripe/services/apps/install_service.rb +1 -1
  77. data/lib/stripe/services/tax/certificate_service.rb +52 -0
  78. data/lib/stripe/services/tax/form_service.rb +11 -0
  79. data/lib/stripe/services/tax_service.rb +2 -1
  80. data/lib/stripe/services/v2/extend/object_definition_service.rb +39 -0
  81. data/lib/stripe/services/v2/extend/object_definitions/version_service.rb +34 -0
  82. data/lib/stripe/services/v2/extend_service.rb +2 -1
  83. data/lib/stripe/services.rb +9 -0
  84. data/lib/stripe/stripe_event_notification_handler.rb +8 -0
  85. data/lib/stripe/stripe_service.rb +13 -9
  86. data/lib/stripe/version.rb +1 -1
  87. data/lib/stripe/webhook.rb +7 -1
  88. data/lib/stripe/workload_identity_exchange.rb +2 -2
  89. data/rbi/stripe.rbi +4320 -69
  90. metadata +20 -2
@@ -0,0 +1,168 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Extend
7
+ # Represents an immutable version of an object definition.
8
+ # It defines the fields of the object records created from it.
9
+ class ObjectDefinitionVersion < APIResource
10
+ OBJECT_NAME = "v2.extend.object_definition_version"
11
+ def self.object_name
12
+ "v2.extend.object_definition_version"
13
+ end
14
+
15
+ class ParentDetails < ::Stripe::StripeObject
16
+ # The plural API name used in this definition's object record API paths.
17
+ attr_reader :api_name_plural
18
+ # The singular API name used in this definition's object record tags.
19
+ attr_reader :api_name_singular
20
+ # The ID of the parent object definition.
21
+ attr_reader :id
22
+
23
+ def self.inner_class_types
24
+ @inner_class_types = {}
25
+ end
26
+
27
+ def self.field_remappings
28
+ @field_remappings = {}
29
+ end
30
+ end
31
+
32
+ class Properties < ::Stripe::StripeObject
33
+ class Items < ::Stripe::StripeObject
34
+ class Items < ::Stripe::StripeObject
35
+ def self.inner_class_types
36
+ @inner_class_types = {}
37
+ end
38
+
39
+ def self.field_remappings
40
+ @field_remappings = {}
41
+ end
42
+ end
43
+ # A required list of values for enum types.
44
+ attr_reader :allowed_values
45
+ # An optional default value for the field.
46
+ attr_reader :default_value
47
+ # An optional human-readable description of the field.
48
+ attr_reader :description
49
+ # An optional exclusive maximum value for integer or decimal types.
50
+ attr_reader :exclusive_maximum
51
+ # An optional exclusive minimum value for integer or decimal types.
52
+ attr_reader :exclusive_minimum
53
+ # Whether or not the field is deprecated (default false).
54
+ attr_reader :is_deprecated
55
+ # The required scalar schema for each array item. Array values retain their supplied order, and
56
+ # order is significant. Values are never sorted. Empty arrays are valid unless min_items is positive.
57
+ attr_reader :items
58
+ # An optional maximum number of array items. It defaults to and cannot exceed 100.
59
+ attr_reader :max_items
60
+ # An optional maximum length validation for string fields.
61
+ attr_reader :max_length
62
+ # An optional maximum value for integer or decimal types.
63
+ attr_reader :maximum
64
+ # An optional minimum number of array items. Empty arrays are valid when this is absent or zero.
65
+ attr_reader :min_items
66
+ # An optional minimum length validation for string fields.
67
+ attr_reader :min_length
68
+ # An optional minimum value for integer or decimal types.
69
+ attr_reader :minimum
70
+ # The type referenced by object reference fields.
71
+ attr_reader :referenced_type
72
+ # Whether or not the field is required (default false).
73
+ attr_reader :required
74
+ # An optional human-readable name for the field.
75
+ attr_reader :title
76
+ # The data type of the field.
77
+ attr_reader :type
78
+ # Whether array item values must be unique (default false). Duplicate values are allowed by default.
79
+ attr_reader :unique_items
80
+
81
+ def self.inner_class_types
82
+ @inner_class_types = { items: Items }
83
+ end
84
+
85
+ def self.field_remappings
86
+ @field_remappings = {}
87
+ end
88
+ end
89
+ # A required list of values for enum types.
90
+ attr_reader :allowed_values
91
+ # An optional default value for the field.
92
+ attr_reader :default_value
93
+ # An optional human-readable description of the field.
94
+ attr_reader :description
95
+ # An optional exclusive maximum value for integer or decimal types.
96
+ attr_reader :exclusive_maximum
97
+ # An optional exclusive minimum value for integer or decimal types.
98
+ attr_reader :exclusive_minimum
99
+ # Whether or not the field is deprecated (default false).
100
+ attr_reader :is_deprecated
101
+ # The required scalar schema for each array item. Array values retain their supplied order, and
102
+ # order is significant. Values are never sorted. Empty arrays are valid unless min_items is positive.
103
+ attr_reader :items
104
+ # An optional maximum number of array items. It defaults to and cannot exceed 100.
105
+ attr_reader :max_items
106
+ # An optional maximum length validation for string fields.
107
+ attr_reader :max_length
108
+ # An optional maximum value for integer or decimal types.
109
+ attr_reader :maximum
110
+ # An optional minimum number of array items. Empty arrays are valid when this is absent or zero.
111
+ attr_reader :min_items
112
+ # An optional minimum length validation for string fields.
113
+ attr_reader :min_length
114
+ # An optional minimum value for integer or decimal types.
115
+ attr_reader :minimum
116
+ # The type referenced by object reference fields.
117
+ attr_reader :referenced_type
118
+ # Whether or not the field is required (default false).
119
+ attr_reader :required
120
+ # An optional human-readable name for the field.
121
+ attr_reader :title
122
+ # The data type of the field.
123
+ attr_reader :type
124
+ # Whether array item values must be unique (default false). Duplicate values are allowed by default.
125
+ attr_reader :unique_items
126
+
127
+ def self.inner_class_types
128
+ @inner_class_types = { items: Items }
129
+ end
130
+
131
+ def self.field_remappings
132
+ @field_remappings = {}
133
+ end
134
+ end
135
+ # Time at which the object definition version was created.
136
+ attr_reader :created
137
+ # A description of what this version of the object definition represents.
138
+ attr_reader :description
139
+ # The human-readable plural name of this version.
140
+ attr_reader :display_name_plural
141
+ # The human-readable singular name of this version.
142
+ attr_reader :display_name_singular
143
+ # The complete version ID, consisting of the object definition ID, `@`, and a semantic version.
144
+ attr_reader :id
145
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
146
+ attr_reader :livemode
147
+ # String representing the object's type. Objects of the same type share the same value of the object field.
148
+ attr_reader :object
149
+ # The ID of the parent object definition.
150
+ attr_reader :object_definition
151
+ # The stable identity and API names of the parent object definition.
152
+ attr_reader :parent_details
153
+ # The schema of the object record fields defined by this object definition.
154
+ attr_reader :properties
155
+ # The semantic version of this object definition version, in `major.minor.patch` format.
156
+ attr_reader :version
157
+
158
+ def self.inner_class_types
159
+ @inner_class_types = { parent_details: ParentDetails, properties: Properties }
160
+ end
161
+
162
+ def self.field_remappings
163
+ @field_remappings = {}
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
@@ -5,7 +5,7 @@ module Stripe
5
5
  module V2
6
6
  module Tax
7
7
  # The result of resolving an address to its tax precision level.
8
- class OperationsResolveAddressResult < SingletonAPIResource
8
+ class OperationsResolveAddressResult < StripeObject
9
9
  OBJECT_NAME = "v2.tax.operations_resolve_address_result"
10
10
  def self.object_name
11
11
  "v2.tax.operations_resolve_address_result"
@@ -1257,6 +1257,13 @@ module Stripe
1257
1257
  autoload :V2DataReportRunUpdatedEventNotification, "stripe/events/v2_data_report_run_updated_event"
1258
1258
  autoload :V2ExtendExtensionRunFailedEvent, "stripe/events/v2_extend_extension_run_failed_event"
1259
1259
  autoload :V2ExtendExtensionRunFailedEventNotification, "stripe/events/v2_extend_extension_run_failed_event"
1260
+ autoload :V2ExtendObjectDefinitionCreatedEvent, "stripe/events/v2_extend_object_definition_created_event"
1261
+ autoload :V2ExtendObjectDefinitionCreatedEventNotification,
1262
+ "stripe/events/v2_extend_object_definition_created_event"
1263
+ autoload :V2ExtendObjectDefinitionVersionCreatedEvent,
1264
+ "stripe/events/v2_extend_object_definition_version_created_event"
1265
+ autoload :V2ExtendObjectDefinitionVersionCreatedEventNotification,
1266
+ "stripe/events/v2_extend_object_definition_version_created_event"
1260
1267
  autoload :V2ExtendWorkflowRunFailedEvent, "stripe/events/v2_extend_workflow_run_failed_event"
1261
1268
  autoload :V2ExtendWorkflowRunFailedEventNotification, "stripe/events/v2_extend_workflow_run_failed_event"
1262
1269
  autoload :V2ExtendWorkflowRunStartedEvent, "stripe/events/v2_extend_workflow_run_started_event"
@@ -1836,7 +1843,9 @@ module Stripe
1836
1843
  autoload :Association, "stripe/resources/tax/association"
1837
1844
  autoload :Calculation, "stripe/resources/tax/calculation"
1838
1845
  autoload :CalculationLineItem, "stripe/resources/tax/calculation_line_item"
1846
+ autoload :Certificate, "stripe/resources/tax/certificate"
1839
1847
  autoload :Form, "stripe/resources/tax/form"
1848
+ autoload :FormCorrection, "stripe/resources/tax/form_correction"
1840
1849
  autoload :Location, "stripe/resources/tax/location"
1841
1850
  autoload :Registration, "stripe/resources/tax/registration"
1842
1851
  autoload :Settings, "stripe/resources/tax/settings"
@@ -1969,6 +1978,8 @@ module Stripe
1969
1978
  end
1970
1979
 
1971
1980
  module Extend
1981
+ autoload :ObjectDefinition, "stripe/resources/v2/extend/object_definition"
1982
+ autoload :ObjectDefinitionVersion, "stripe/resources/v2/extend/object_definition_version"
1972
1983
  autoload :Workflow, "stripe/resources/v2/extend/workflow"
1973
1984
  autoload :WorkflowRun, "stripe/resources/v2/extend/workflow_run"
1974
1985
  end
@@ -2250,7 +2261,9 @@ module Stripe
2250
2261
  stripe/resources/tax/association
2251
2262
  stripe/resources/tax/calculation
2252
2263
  stripe/resources/tax/calculation_line_item
2264
+ stripe/resources/tax/certificate
2253
2265
  stripe/resources/tax/form
2266
+ stripe/resources/tax/form_correction
2254
2267
  stripe/resources/tax/location
2255
2268
  stripe/resources/tax/registration
2256
2269
  stripe/resources/tax/settings
@@ -2346,6 +2359,8 @@ module Stripe
2346
2359
  stripe/resources/v2/data/schema
2347
2360
  stripe/resources/v2/data/search_result_list
2348
2361
  stripe/resources/v2/deleted_object
2362
+ stripe/resources/v2/extend/object_definition
2363
+ stripe/resources/v2/extend/object_definition_version
2349
2364
  stripe/resources/v2/extend/workflow
2350
2365
  stripe/resources/v2/extend/workflow_run
2351
2366
  stripe/resources/v2/iam/activity_log
@@ -2823,6 +2838,8 @@ module Stripe
2823
2838
  stripe/events/v2_data_reporting_query_run_succeeded_event
2824
2839
  stripe/events/v2_data_reporting_query_run_updated_event
2825
2840
  stripe/events/v2_extend_extension_run_failed_event
2841
+ stripe/events/v2_extend_object_definition_created_event
2842
+ stripe/events/v2_extend_object_definition_version_created_event
2826
2843
  stripe/events/v2_extend_workflow_run_failed_event
2827
2844
  stripe/events/v2_extend_workflow_run_started_event
2828
2845
  stripe/events/v2_extend_workflow_run_succeeded_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,
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ class CertificateService < StripeService
7
+ # Create a tax certificate associated with a tax exemption.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/tax/certificates",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
18
+ # Delete a tax certificate associated with a tax exemption.
19
+ def delete(id, params = {}, opts = {})
20
+ request(
21
+ method: :delete,
22
+ path: format("/v1/tax/certificates/%<id>s", { id: CGI.escape(id) }),
23
+ params: params,
24
+ opts: opts,
25
+ base_address: :api
26
+ )
27
+ end
28
+
29
+ # List certificates for an existing tax exemption.
30
+ def list(params = {}, opts = {})
31
+ request(
32
+ method: :get,
33
+ path: "/v1/tax/certificates",
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :api
37
+ )
38
+ end
39
+
40
+ # Retrieve a tax certificate associated with a tax exemption.
41
+ def retrieve(id, params = {}, opts = {})
42
+ request(
43
+ method: :get,
44
+ path: format("/v1/tax/certificates/%<id>s", { id: CGI.escape(id) }),
45
+ params: params,
46
+ opts: opts,
47
+ base_address: :api
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end
@@ -4,6 +4,17 @@
4
4
  module Stripe
5
5
  module Tax
6
6
  class FormService < StripeService
7
+ # Creates a correction for a filed tax form. Supply either payee details or numerical values for the tax form type. Created correction forms are not filed automatically.
8
+ def create(id, params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: format("/v1/tax/forms/%<id>s/corrections", { id: CGI.escape(id) }),
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
7
18
  # Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.
8
19
  def list(params = {}, opts = {})
9
20
  request(method: :get, path: "/v1/tax/forms", params: params, opts: opts, base_address: :api)
@@ -3,12 +3,13 @@
3
3
 
4
4
  module Stripe
5
5
  class TaxService < StripeService
6
- attr_reader :associations, :calculations, :forms, :locations, :registrations, :settings, :transactions
6
+ attr_reader :associations, :calculations, :certificates, :forms, :locations, :registrations, :settings, :transactions
7
7
 
8
8
  def initialize(requestor)
9
9
  super
10
10
  @associations = Stripe::Tax::AssociationService.new(@requestor)
11
11
  @calculations = Stripe::Tax::CalculationService.new(@requestor)
12
+ @certificates = Stripe::Tax::CertificateService.new(@requestor)
12
13
  @forms = Stripe::Tax::FormService.new(@requestor)
13
14
  @locations = Stripe::Tax::LocationService.new(@requestor)
14
15
  @registrations = Stripe::Tax::RegistrationService.new(@requestor)
@@ -0,0 +1,39 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Extend
7
+ class ObjectDefinitionService < StripeService
8
+ attr_reader :versions
9
+
10
+ def initialize(requestor)
11
+ super
12
+ @versions = Stripe::V2::Extend::ObjectDefinitions::VersionService.new(@requestor)
13
+ end
14
+
15
+ # Lists a page of object definitions.
16
+ def list(params = {}, opts = {})
17
+ request(
18
+ method: :get,
19
+ path: "/v2/extend/object_definitions",
20
+ params: params,
21
+ opts: opts,
22
+ base_address: :api
23
+ )
24
+ end
25
+
26
+ # Retrieves an object definition.
27
+ def retrieve(id, params = {}, opts = {})
28
+ request(
29
+ method: :get,
30
+ path: format("/v2/extend/object_definitions/%<id>s", { id: CGI.escape(id) }),
31
+ params: params,
32
+ opts: opts,
33
+ base_address: :api
34
+ )
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,34 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Extend
7
+ module ObjectDefinitions
8
+ class VersionService < StripeService
9
+ # Lists a page of object definition versions in descending semantic version order.
10
+ def list(object_definition_id, params = {}, opts = {})
11
+ request(
12
+ method: :get,
13
+ path: format("/v2/extend/object_definitions/%<object_definition_id>s/versions", { object_definition_id: CGI.escape(object_definition_id) }),
14
+ params: params,
15
+ opts: opts,
16
+ base_address: :api
17
+ )
18
+ end
19
+
20
+ # Retrieves an object definition version.
21
+ def retrieve(object_definition_id, id, params = {}, opts = {})
22
+ request(
23
+ method: :get,
24
+ path: format("/v2/extend/object_definitions/%<object_definition_id>s/versions/%<id>s", { object_definition_id: CGI.escape(object_definition_id), id: CGI.escape(id) }),
25
+ params: params,
26
+ opts: opts,
27
+ base_address: :api
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -4,10 +4,11 @@
4
4
  module Stripe
5
5
  module V2
6
6
  class ExtendService < StripeService
7
- attr_reader :workflows, :workflow_runs
7
+ attr_reader :object_definitions, :workflows, :workflow_runs
8
8
 
9
9
  def initialize(requestor)
10
10
  super
11
+ @object_definitions = Stripe::V2::Extend::ObjectDefinitionService.new(@requestor)
11
12
  @workflows = Stripe::V2::Extend::WorkflowService.new(@requestor)
12
13
  @workflow_runs = Stripe::V2::Extend::WorkflowRunService.new(@requestor)
13
14
  end
@@ -279,6 +279,7 @@ module Stripe
279
279
  autoload :AssociationService, "stripe/services/tax/association_service"
280
280
  autoload :CalculationLineItemService, "stripe/services/tax/calculation_line_item_service"
281
281
  autoload :CalculationService, "stripe/services/tax/calculation_service"
282
+ autoload :CertificateService, "stripe/services/tax/certificate_service"
282
283
  autoload :FormService, "stripe/services/tax/form_service"
283
284
  autoload :LocationService, "stripe/services/tax/location_service"
284
285
  autoload :RegistrationService, "stripe/services/tax/registration_service"
@@ -505,8 +506,13 @@ module Stripe
505
506
  end
506
507
 
507
508
  module Extend
509
+ autoload :ObjectDefinitionService, "stripe/services/v2/extend/object_definition_service"
508
510
  autoload :WorkflowRunService, "stripe/services/v2/extend/workflow_run_service"
509
511
  autoload :WorkflowService, "stripe/services/v2/extend/workflow_service"
512
+
513
+ module ObjectDefinitions
514
+ autoload :VersionService, "stripe/services/v2/extend/object_definitions/version_service"
515
+ end
510
516
  end
511
517
 
512
518
  module Iam
@@ -813,6 +819,7 @@ module Stripe
813
819
  stripe/services/tax/association_service
814
820
  stripe/services/tax/calculation_line_item_service
815
821
  stripe/services/tax/calculation_service
822
+ stripe/services/tax/certificate_service
816
823
  stripe/services/tax/form_service
817
824
  stripe/services/tax/location_service
818
825
  stripe/services/tax/registration_service
@@ -945,6 +952,8 @@ module Stripe
945
952
  stripe/services/v2/data/reporting_service
946
953
  stripe/services/v2/data/schema_service
947
954
  stripe/services/v2/data_service
955
+ stripe/services/v2/extend/object_definition_service
956
+ stripe/services/v2/extend/object_definitions/version_service
948
957
  stripe/services/v2/extend/workflow_run_service
949
958
  stripe/services/v2/extend/workflow_service
950
959
  stripe/services/v2/extend_service
@@ -1746,6 +1746,14 @@ module Stripe
1746
1746
  register("v2.extend.extension_run.failed", &callback)
1747
1747
  end
1748
1748
 
1749
+ def on_v2_extend_object_definition_created(&callback)
1750
+ register("v2.extend.object_definition.created", &callback)
1751
+ end
1752
+
1753
+ def on_v2_extend_object_definition_version_created(&callback)
1754
+ register("v2.extend.object_definition_version.created", &callback)
1755
+ end
1756
+
1749
1757
  def on_v2_extend_workflow_run_failed(&callback)
1750
1758
  register("v2.extend.workflow_run.failed", &callback)
1751
1759
  end
@@ -10,15 +10,6 @@ module Stripe
10
10
 
11
11
  def request(method:, path:, base_address:, params: {}, opts: {})
12
12
  params = params.to_h if params.is_a?(RequestParams)
13
- if method == :post &&
14
- path.split("?", 2).first.start_with?("/v2/") &&
15
- path.split("?", 2).first.end_with?("/search") &&
16
- (params.key?(:limit) || params.key?("limit"))
17
- params = params.dup
18
- limit = params.delete(:limit) || params.delete("limit")
19
- separator = path.include?("?") ? "&" : "?"
20
- path = "#{path}#{separator}limit=#{URI.encode_www_form_component(limit)}"
21
- end
22
13
  @requestor.execute_request(
23
14
  method,
24
15
  path,
@@ -29,6 +20,19 @@ module Stripe
29
20
  )
30
21
  end
31
22
 
23
+ # V2 search uses POST but sends limit in the URL, not the JSON body. Rebuild
24
+ # the initial query from params; pagination uses the ordinary request path.
25
+ def request_v2_search(method:, path:, base_address:, params: {}, opts: {})
26
+ params = params.to_h if params.is_a?(RequestParams)
27
+ params = params.dup
28
+ limit = params.delete(:limit)
29
+ string_limit = params.delete("limit")
30
+ limit ||= string_limit
31
+ path = path.split("?", 2).first
32
+ path = "#{path}?limit=#{URI.encode_www_form_component(limit)}" unless limit.nil?
33
+ request(method: method, path: path, base_address: base_address, params: params, opts: opts)
34
+ end
35
+
32
36
  def request_stream(method:, path:, base_address:, params: {}, opts: {}, &read_body_chunk_block)
33
37
  @requestor.execute_request_stream(
34
38
  method,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "20.2.0-alpha.1"
4
+ VERSION = "20.2.0-alpha.2"
5
5
  end
@@ -44,7 +44,13 @@ module Stripe
44
44
  private_class_method :_build_v1_event
45
45
 
46
46
  def self._maybe_extract_from_cloud_provider_envelope(payload)
47
- payload = payload.encode("utf-8") if payload.respond_to?(:encode)
47
+ if payload.respond_to?(:encode)
48
+ payload = if payload.encoding == Encoding::BINARY
49
+ payload.dup.force_encoding(Encoding::UTF_8)
50
+ else
51
+ payload.encode(Encoding::UTF_8)
52
+ end
53
+ end
48
54
  data = JSON.parse(payload, symbolize_names: true)
49
55
 
50
56
  # Could add as many checks as we want here, but we'll start simple
@@ -16,7 +16,7 @@ module Stripe
16
16
  TOKEN_PATH = "/wif/oauth2/token"
17
17
  TOKEN_URL = "https://#{TOKEN_HOST}#{TOKEN_PATH}".freeze
18
18
 
19
- SUPPORTED_PROVIDERS = ["gcp"].freeze
19
+ SUPPORTED_PROVIDERS = %w[gcp aws].freeze
20
20
 
21
21
  # The exchange endpoint is fixed and deliberately independent of any
22
22
  # configurable `api_base`, so a misconfigured or malicious API base can
@@ -28,7 +28,7 @@ module Stripe
28
28
 
29
29
  # Number of seconds before actual expiry that a cached token is
30
30
  # considered stale and eligible for proactive refresh.
31
- REFRESH_SAFETY_MARGIN_SEC = 300
31
+ REFRESH_SAFETY_MARGIN_SEC = 120
32
32
 
33
33
  def self.validate_provider!(identity_provider)
34
34
  unless identity_provider.respond_to?(:provider) && identity_provider.respond_to?(:identity_assertion)