stripe 12.7.0.pre.beta.1 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +725 -1354
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +4 -3
  5. data/VERSION +1 -1
  6. data/examples/README.md +11 -0
  7. data/examples/meter_event_stream.rb +47 -0
  8. data/examples/new_example.rb +24 -0
  9. data/examples/stripe_webhook_handler.rb +28 -0
  10. data/lib/stripe/api_operations/nested_resource.rb +1 -21
  11. data/lib/stripe/api_operations/request.rb +19 -70
  12. data/lib/stripe/api_operations/save.rb +4 -3
  13. data/lib/stripe/api_operations/singleton_save.rb +5 -2
  14. data/lib/stripe/api_requestor.rb +1131 -0
  15. data/lib/stripe/api_resource.rb +22 -14
  16. data/lib/stripe/api_version.rb +1 -2
  17. data/lib/stripe/connection_manager.rb +1 -1
  18. data/lib/stripe/errors.rb +8 -2
  19. data/lib/stripe/event_types.rb +14 -0
  20. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  21. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  22. data/lib/stripe/list_object.rb +2 -3
  23. data/lib/stripe/oauth.rb +8 -15
  24. data/lib/stripe/object_types.rb +16 -21
  25. data/lib/stripe/request_options.rb +128 -0
  26. data/lib/stripe/resources/billing/credit_balance_summary.rb +14 -0
  27. data/lib/stripe/resources/billing/credit_balance_transaction.rb +26 -0
  28. data/lib/stripe/resources/billing/credit_grant.rb +88 -0
  29. data/lib/stripe/resources/customer.rb +2 -3
  30. data/lib/stripe/resources/file.rb +7 -5
  31. data/lib/stripe/resources/financial_connections/account.rb +0 -3
  32. data/lib/stripe/resources/invoice.rb +0 -81
  33. data/lib/stripe/resources/invoice_rendering_template.rb +2 -0
  34. data/lib/stripe/resources/payment_intent.rb +0 -50
  35. data/lib/stripe/resources/quote.rb +4 -108
  36. data/lib/stripe/resources/source.rb +3 -2
  37. data/lib/stripe/resources/subscription.rb +6 -6
  38. data/lib/stripe/resources/subscription_schedule.rb +0 -20
  39. data/lib/stripe/resources/terminal/reader.rb +0 -60
  40. data/lib/stripe/resources/v2/billing/meter_event.rb +16 -0
  41. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +15 -0
  42. data/lib/stripe/resources/v2/billing/meter_event_session.rb +15 -0
  43. data/lib/stripe/resources/v2/event.rb +13 -0
  44. data/lib/stripe/resources.rb +9 -19
  45. data/lib/stripe/search_result_object.rb +1 -1
  46. data/lib/stripe/services/account_capability_service.rb +39 -0
  47. data/lib/stripe/services/account_external_account_service.rb +68 -0
  48. data/lib/stripe/services/account_link_service.rb +17 -0
  49. data/lib/stripe/services/account_login_link_service.rb +19 -0
  50. data/lib/stripe/services/account_person_service.rb +61 -0
  51. data/lib/stripe/services/account_service.rb +100 -0
  52. data/lib/stripe/services/account_session_service.rb +17 -0
  53. data/lib/stripe/services/apple_pay_domain_service.rb +50 -0
  54. data/lib/stripe/services/application_fee_refund_service.rb +60 -0
  55. data/lib/stripe/services/application_fee_service.rb +35 -0
  56. data/lib/stripe/services/apps/secret_service.rb +52 -0
  57. data/lib/stripe/services/apps_service.rb +13 -0
  58. data/lib/stripe/services/balance_service.rb +12 -0
  59. data/lib/stripe/services/balance_transaction_service.rb +32 -0
  60. data/lib/stripe/services/billing/alert_service.rb +74 -0
  61. data/lib/stripe/services/billing/credit_balance_summary_service.rb +19 -0
  62. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +30 -0
  63. data/lib/stripe/services/billing/credit_grant_service.rb +74 -0
  64. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +19 -0
  65. data/lib/stripe/services/billing/meter_event_service.rb +19 -0
  66. data/lib/stripe/services/billing/meter_event_summary_service.rb +19 -0
  67. data/lib/stripe/services/billing/meter_service.rb +81 -0
  68. data/lib/stripe/services/billing_portal/configuration_service.rb +52 -0
  69. data/lib/stripe/services/billing_portal/session_service.rb +19 -0
  70. data/lib/stripe/services/billing_portal_service.rb +14 -0
  71. data/lib/stripe/services/billing_service.rb +20 -0
  72. data/lib/stripe/services/charge_service.rb +69 -0
  73. data/lib/stripe/services/checkout/session_line_item_service.rb +19 -0
  74. data/lib/stripe/services/checkout/session_service.rb +72 -0
  75. data/lib/stripe/services/checkout_service.rb +13 -0
  76. data/lib/stripe/services/climate/order_service.rb +68 -0
  77. data/lib/stripe/services/climate/product_service.rb +30 -0
  78. data/lib/stripe/services/climate/supplier_service.rb +30 -0
  79. data/lib/stripe/services/climate_service.rb +15 -0
  80. data/lib/stripe/services/confirmation_token_service.rb +17 -0
  81. data/lib/stripe/services/country_spec_service.rb +28 -0
  82. data/lib/stripe/services/coupon_service.rb +51 -0
  83. data/lib/stripe/services/credit_note_line_item_service.rb +17 -0
  84. data/lib/stripe/services/credit_note_preview_lines_service.rb +17 -0
  85. data/lib/stripe/services/credit_note_service.rb +93 -0
  86. data/lib/stripe/services/customer_balance_transaction_service.rb +50 -0
  87. data/lib/stripe/services/customer_cash_balance_service.rb +28 -0
  88. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +28 -0
  89. data/lib/stripe/services/customer_funding_instructions_service.rb +19 -0
  90. data/lib/stripe/services/customer_payment_method_service.rb +28 -0
  91. data/lib/stripe/services/customer_payment_source_service.rb +76 -0
  92. data/lib/stripe/services/customer_service.rb +89 -0
  93. data/lib/stripe/services/customer_session_service.rb +17 -0
  94. data/lib/stripe/services/customer_tax_id_service.rb +50 -0
  95. data/lib/stripe/services/dispute_service.rb +48 -0
  96. data/lib/stripe/services/entitlements/active_entitlement_service.rb +30 -0
  97. data/lib/stripe/services/entitlements/feature_service.rb +52 -0
  98. data/lib/stripe/services/entitlements_service.rb +14 -0
  99. data/lib/stripe/services/ephemeral_key_service.rb +28 -0
  100. data/lib/stripe/services/event_service.rb +22 -0
  101. data/lib/stripe/services/exchange_rate_service.rb +28 -0
  102. data/lib/stripe/services/file_link_service.rb +38 -0
  103. data/lib/stripe/services/file_service.rb +35 -0
  104. data/lib/stripe/services/financial_connections/account_owner_service.rb +19 -0
  105. data/lib/stripe/services/financial_connections/account_service.rb +81 -0
  106. data/lib/stripe/services/financial_connections/session_service.rb +30 -0
  107. data/lib/stripe/services/financial_connections/transaction_service.rb +30 -0
  108. data/lib/stripe/services/financial_connections_service.rb +15 -0
  109. data/lib/stripe/services/forwarding/request_service.rb +41 -0
  110. data/lib/stripe/services/forwarding_service.rb +13 -0
  111. data/lib/stripe/services/identity/verification_report_service.rb +30 -0
  112. data/lib/stripe/services/identity/verification_session_service.rb +106 -0
  113. data/lib/stripe/services/identity_service.rb +14 -0
  114. data/lib/stripe/services/invoice_item_service.rb +61 -0
  115. data/lib/stripe/services/invoice_line_item_service.rb +31 -0
  116. data/lib/stripe/services/invoice_rendering_template_service.rb +50 -0
  117. data/lib/stripe/services/invoice_service.rb +202 -0
  118. data/lib/stripe/services/invoice_upcoming_lines_service.rb +17 -0
  119. data/lib/stripe/services/issuing/authorization_service.rb +65 -0
  120. data/lib/stripe/services/issuing/card_service.rb +52 -0
  121. data/lib/stripe/services/issuing/cardholder_service.rb +52 -0
  122. data/lib/stripe/services/issuing/dispute_service.rb +63 -0
  123. data/lib/stripe/services/issuing/personalization_design_service.rb +52 -0
  124. data/lib/stripe/services/issuing/physical_bundle_service.rb +30 -0
  125. data/lib/stripe/services/issuing/token_service.rb +41 -0
  126. data/lib/stripe/services/issuing/transaction_service.rb +41 -0
  127. data/lib/stripe/services/issuing_service.rb +20 -0
  128. data/lib/stripe/services/mandate_service.rb +17 -0
  129. data/lib/stripe/services/oauth_service.rb +63 -0
  130. data/lib/stripe/services/payment_intent_service.rb +204 -0
  131. data/lib/stripe/services/payment_link_line_item_service.rb +17 -0
  132. data/lib/stripe/services/payment_link_service.rb +57 -0
  133. data/lib/stripe/services/payment_method_configuration_service.rb +50 -0
  134. data/lib/stripe/services/payment_method_domain_service.rb +66 -0
  135. data/lib/stripe/services/payment_method_service.rb +86 -0
  136. data/lib/stripe/services/payout_service.rb +66 -0
  137. data/lib/stripe/services/plan_service.rb +49 -0
  138. data/lib/stripe/services/price_service.rb +52 -0
  139. data/lib/stripe/services/product_feature_service.rb +50 -0
  140. data/lib/stripe/services/product_service.rb +70 -0
  141. data/lib/stripe/services/promotion_code_service.rb +50 -0
  142. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +17 -0
  143. data/lib/stripe/services/quote_line_item_service.rb +17 -0
  144. data/lib/stripe/services/quote_service.rb +92 -0
  145. data/lib/stripe/services/radar/early_fraud_warning_service.rb +32 -0
  146. data/lib/stripe/services/radar/value_list_item_service.rb +52 -0
  147. data/lib/stripe/services/radar/value_list_service.rb +63 -0
  148. data/lib/stripe/services/radar_service.rb +15 -0
  149. data/lib/stripe/services/refund_service.rb +63 -0
  150. data/lib/stripe/services/reporting/report_run_service.rb +41 -0
  151. data/lib/stripe/services/reporting/report_type_service.rb +30 -0
  152. data/lib/stripe/services/reporting_service.rb +14 -0
  153. data/lib/stripe/services/review_service.rb +33 -0
  154. data/lib/stripe/services/setup_attempt_service.rb +17 -0
  155. data/lib/stripe/services/setup_intent_service.rb +105 -0
  156. data/lib/stripe/services/shipping_rate_service.rb +50 -0
  157. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +30 -0
  158. data/lib/stripe/services/sigma_service.rb +13 -0
  159. data/lib/stripe/services/source_service.rb +64 -0
  160. data/lib/stripe/services/source_transaction_service.rb +17 -0
  161. data/lib/stripe/services/subscription_item_service.rb +69 -0
  162. data/lib/stripe/services/subscription_item_usage_record_service.rb +23 -0
  163. data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +19 -0
  164. data/lib/stripe/services/subscription_schedule_service.rb +72 -0
  165. data/lib/stripe/services/subscription_service.rb +127 -0
  166. data/lib/stripe/services/tax/calculation_line_item_service.rb +19 -0
  167. data/lib/stripe/services/tax/calculation_service.rb +37 -0
  168. data/lib/stripe/services/tax/registration_service.rb +54 -0
  169. data/lib/stripe/services/tax/settings_service.rb +30 -0
  170. data/lib/stripe/services/tax/transaction_line_item_service.rb +19 -0
  171. data/lib/stripe/services/tax/transaction_service.rb +48 -0
  172. data/lib/stripe/services/tax_code_service.rb +22 -0
  173. data/lib/stripe/services/tax_id_service.rb +38 -0
  174. data/lib/stripe/services/tax_rate_service.rb +38 -0
  175. data/lib/stripe/services/tax_service.rb +16 -0
  176. data/lib/stripe/services/terminal/configuration_service.rb +63 -0
  177. data/lib/stripe/services/terminal/connection_token_service.rb +19 -0
  178. data/lib/stripe/services/terminal/location_service.rb +64 -0
  179. data/lib/stripe/services/terminal/reader_service.rb +118 -0
  180. data/lib/stripe/services/terminal_service.rb +16 -0
  181. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +19 -0
  182. data/lib/stripe/services/test_helpers/customer_service.rb +19 -0
  183. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +76 -0
  184. data/lib/stripe/services/test_helpers/issuing/card_service.rb +54 -0
  185. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +43 -0
  186. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +43 -0
  187. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  188. data/lib/stripe/services/test_helpers/refund_service.rb +19 -0
  189. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +21 -0
  190. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  191. data/lib/stripe/services/test_helpers/test_clock_service.rb +63 -0
  192. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +43 -0
  193. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +54 -0
  194. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +54 -0
  195. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +21 -0
  196. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +21 -0
  197. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  198. data/lib/stripe/services/test_helpers_service.rb +19 -0
  199. data/lib/stripe/services/token_service.rb +23 -0
  200. data/lib/stripe/services/topup_service.rb +49 -0
  201. data/lib/stripe/services/transfer_reversal_service.rb +56 -0
  202. data/lib/stripe/services/transfer_service.rb +47 -0
  203. data/lib/stripe/services/treasury/credit_reversal_service.rb +41 -0
  204. data/lib/stripe/services/treasury/debit_reversal_service.rb +41 -0
  205. data/lib/stripe/services/treasury/financial_account_features_service.rb +30 -0
  206. data/lib/stripe/services/treasury/financial_account_service.rb +59 -0
  207. data/lib/stripe/services/treasury/inbound_transfer_service.rb +52 -0
  208. data/lib/stripe/services/treasury/outbound_payment_service.rb +52 -0
  209. data/lib/stripe/services/treasury/outbound_transfer_service.rb +52 -0
  210. data/lib/stripe/services/treasury/received_credit_service.rb +30 -0
  211. data/lib/stripe/services/treasury/received_debit_service.rb +30 -0
  212. data/lib/stripe/services/treasury/transaction_entry_service.rb +30 -0
  213. data/lib/stripe/services/treasury/transaction_service.rb +30 -0
  214. data/lib/stripe/services/treasury_service.rb +22 -0
  215. data/lib/stripe/services/v1_services.rb +89 -0
  216. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +21 -0
  217. data/lib/stripe/services/v2/billing/meter_event_service.rb +21 -0
  218. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +21 -0
  219. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +23 -0
  220. data/lib/stripe/services/v2/billing_service.rb +18 -0
  221. data/lib/stripe/services/v2/core/event_service.rb +32 -0
  222. data/lib/stripe/services/v2/core_service.rb +15 -0
  223. data/lib/stripe/services/v2_services.rb +14 -0
  224. data/lib/stripe/services/webhook_endpoint_service.rb +61 -0
  225. data/lib/stripe/services.rb +181 -0
  226. data/lib/stripe/singleton_api_resource.rb +1 -18
  227. data/lib/stripe/stripe_client.rb +51 -1067
  228. data/lib/stripe/stripe_configuration.rb +32 -20
  229. data/lib/stripe/stripe_object.rb +37 -18
  230. data/lib/stripe/stripe_service.rb +32 -0
  231. data/lib/stripe/thin_event.rb +17 -0
  232. data/lib/stripe/util.rb +69 -46
  233. data/lib/stripe/v2_list_object.rb +84 -0
  234. data/lib/stripe/version.rb +1 -1
  235. data/lib/stripe/webhook.rb +1 -1
  236. data/lib/stripe.rb +15 -54
  237. metadata +203 -24
  238. data/lib/stripe/request_signing_authenticator.rb +0 -79
  239. data/lib/stripe/resources/account_notice.rb +0 -32
  240. data/lib/stripe/resources/capital/financing_offer.rb +0 -49
  241. data/lib/stripe/resources/capital/financing_summary.rb +0 -15
  242. data/lib/stripe/resources/capital/financing_transaction.rb +0 -27
  243. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -14
  244. data/lib/stripe/resources/financial_connections/institution.rb +0 -26
  245. data/lib/stripe/resources/gift_cards/card.rb +0 -59
  246. data/lib/stripe/resources/gift_cards/transaction.rb +0 -93
  247. data/lib/stripe/resources/invoice_payment.rb +0 -12
  248. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -88
  249. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -26
  250. data/lib/stripe/resources/margin.rb +0 -37
  251. data/lib/stripe/resources/order.rb +0 -120
  252. data/lib/stripe/resources/quote_phase.rb +0 -32
  253. data/lib/stripe/resources/quote_preview_invoice.rb +0 -43
  254. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -11
  255. data/lib/stripe/resources/tax/association.rb +0 -24
  256. data/lib/stripe/resources/tax/form.rb +0 -49
  257. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -14
data/lib/stripe.rb CHANGED
@@ -13,7 +13,6 @@ require "set"
13
13
  require "socket"
14
14
  require "uri"
15
15
  require "forwardable"
16
- require "base64"
17
16
 
18
17
  # Version
19
18
  require "stripe/api_version"
@@ -32,13 +31,18 @@ require "stripe/api_operations/search"
32
31
  # API resource support classes
33
32
  require "stripe/errors"
34
33
  require "stripe/object_types"
34
+ require "stripe/event_types"
35
+ require "stripe/request_options"
35
36
  require "stripe/util"
36
37
  require "stripe/connection_manager"
37
38
  require "stripe/multipart_encoder"
39
+ require "stripe/api_requestor"
40
+ require "stripe/stripe_service"
38
41
  require "stripe/stripe_client"
39
42
  require "stripe/stripe_object"
40
43
  require "stripe/stripe_response"
41
44
  require "stripe/list_object"
45
+ require "stripe/v2_list_object"
42
46
  require "stripe/search_result_object"
43
47
  require "stripe/error_object"
44
48
  require "stripe/api_resource"
@@ -46,13 +50,15 @@ require "stripe/api_resource_test_helpers"
46
50
  require "stripe/singleton_api_resource"
47
51
  require "stripe/webhook"
48
52
  require "stripe/stripe_configuration"
49
- require "stripe/request_signing_authenticator"
53
+ require "stripe/thin_event"
50
54
 
51
55
  # Named API resources
52
56
  require "stripe/resources"
57
+ require "stripe/services"
53
58
 
54
59
  # OAuth
55
60
  require "stripe/oauth"
61
+ require "stripe/services/oauth_service"
56
62
 
57
63
  module Stripe
58
64
  DEFAULT_CA_BUNDLE_PATH = __dir__ + "/data/ca-certificates.crt"
@@ -62,6 +68,12 @@ module Stripe
62
68
  LEVEL_ERROR = Logger::ERROR
63
69
  LEVEL_INFO = Logger::INFO
64
70
 
71
+ # API base constants
72
+ DEFAULT_API_BASE = "https://api.stripe.com"
73
+ DEFAULT_CONNECT_BASE = "https://connect.stripe.com"
74
+ DEFAULT_UPLOAD_BASE = "https://files.stripe.com"
75
+ DEFAULT_METER_EVENTS_BASE = "https://meter-events.stripe.com"
76
+
65
77
  @app_info = nil
66
78
 
67
79
  @config = Stripe::StripeConfiguration.setup
@@ -73,12 +85,12 @@ module Stripe
73
85
 
74
86
  # User configurable options
75
87
  def_delegators :@config, :api_key, :api_key=
76
- def_delegators :@config, :authenticator, :authenticator=
77
88
  def_delegators :@config, :api_version, :api_version=
78
89
  def_delegators :@config, :stripe_account, :stripe_account=
79
90
  def_delegators :@config, :api_base, :api_base=
80
91
  def_delegators :@config, :uploads_base, :uploads_base=
81
92
  def_delegators :@config, :connect_base, :connect_base=
93
+ def_delegators :@config, :meter_events_base, :meter_events_base=
82
94
  def_delegators :@config, :open_timeout, :open_timeout=
83
95
  def_delegators :@config, :read_timeout, :read_timeout=
84
96
  def_delegators :@config, :write_timeout, :write_timeout=
@@ -120,57 +132,6 @@ module Stripe
120
132
  version: version,
121
133
  }
122
134
  end
123
-
124
- def self.add_beta_version(beta_name, version)
125
- if api_version.include?("; #{beta_name}=")
126
- raise "Stripe version header #{api_version} already contains entry for beta #{beta_name}"
127
- end
128
-
129
- self.api_version = "#{api_version}; #{beta_name}=#{version}"
130
- end
131
-
132
- class Preview
133
- def self._get_default_opts(opts)
134
- { api_mode: :preview }.merge(opts)
135
- end
136
-
137
- def self.get(url, opts = {})
138
- Stripe.raw_request(:get, url, {}, _get_default_opts(opts))
139
- end
140
-
141
- def self.post(url, params = {}, opts = {})
142
- Stripe.raw_request(:post, url, params, _get_default_opts(opts))
143
- end
144
-
145
- def self.delete(url, opts = {})
146
- Stripe.raw_request(:delete, url, {}, _get_default_opts(opts))
147
- end
148
- end
149
-
150
- class RawRequest
151
- include Stripe::APIOperations::Request
152
-
153
- def initialize
154
- @opts = {}
155
- end
156
-
157
- def execute(method, url, params = {}, opts = {}, usage = [])
158
- resp, = execute_resource_request(method, url, params, opts, usage)
159
-
160
- resp
161
- end
162
- end
163
-
164
- # Sends a request to Stripe REST API
165
- def self.raw_request(method, url, params = {}, opts = {})
166
- req = RawRequest.new
167
- req.execute(method, url, params, opts, ["raw_request"])
168
- end
169
-
170
- def self.deserialize(data)
171
- data = JSON.parse(data) if data.is_a?(String)
172
- Util.convert_to_stripe_object(data, {})
173
- end
174
135
  end
175
136
 
176
137
  Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
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: 12.7.0.pre.beta.1
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2024-10-01 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.
@@ -29,6 +29,10 @@ files:
29
29
  - README.md
30
30
  - Rakefile
31
31
  - VERSION
32
+ - examples/README.md
33
+ - examples/meter_event_stream.rb
34
+ - examples/new_example.rb
35
+ - examples/stripe_webhook_handler.rb
32
36
  - exe/stripe-console
33
37
  - lib/data/ca-certificates.crt
34
38
  - lib/stripe.rb
@@ -40,22 +44,25 @@ files:
40
44
  - lib/stripe/api_operations/save.rb
41
45
  - lib/stripe/api_operations/search.rb
42
46
  - lib/stripe/api_operations/singleton_save.rb
47
+ - lib/stripe/api_requestor.rb
43
48
  - lib/stripe/api_resource.rb
44
49
  - lib/stripe/api_resource_test_helpers.rb
45
50
  - lib/stripe/api_version.rb
46
51
  - lib/stripe/connection_manager.rb
47
52
  - lib/stripe/error_object.rb
48
53
  - lib/stripe/errors.rb
54
+ - lib/stripe/event_types.rb
55
+ - lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb
56
+ - lib/stripe/events/v1_billing_meter_no_meter_found_event.rb
49
57
  - lib/stripe/instrumentation.rb
50
58
  - lib/stripe/list_object.rb
51
59
  - lib/stripe/multipart_encoder.rb
52
60
  - lib/stripe/oauth.rb
53
61
  - lib/stripe/object_types.rb
54
- - lib/stripe/request_signing_authenticator.rb
62
+ - lib/stripe/request_options.rb
55
63
  - lib/stripe/resources.rb
56
64
  - lib/stripe/resources/account.rb
57
65
  - lib/stripe/resources/account_link.rb
58
- - lib/stripe/resources/account_notice.rb
59
66
  - lib/stripe/resources/account_session.rb
60
67
  - lib/stripe/resources/alipay_account.rb
61
68
  - lib/stripe/resources/apple_pay_domain.rb
@@ -66,6 +73,9 @@ files:
66
73
  - lib/stripe/resources/balance_transaction.rb
67
74
  - lib/stripe/resources/bank_account.rb
68
75
  - lib/stripe/resources/billing/alert.rb
76
+ - lib/stripe/resources/billing/credit_balance_summary.rb
77
+ - lib/stripe/resources/billing/credit_balance_transaction.rb
78
+ - lib/stripe/resources/billing/credit_grant.rb
69
79
  - lib/stripe/resources/billing/meter.rb
70
80
  - lib/stripe/resources/billing/meter_event.rb
71
81
  - lib/stripe/resources/billing/meter_event_adjustment.rb
@@ -73,9 +83,6 @@ files:
73
83
  - lib/stripe/resources/billing_portal/configuration.rb
74
84
  - lib/stripe/resources/billing_portal/session.rb
75
85
  - lib/stripe/resources/capability.rb
76
- - lib/stripe/resources/capital/financing_offer.rb
77
- - lib/stripe/resources/capital/financing_summary.rb
78
- - lib/stripe/resources/capital/financing_transaction.rb
79
86
  - lib/stripe/resources/card.rb
80
87
  - lib/stripe/resources/cash_balance.rb
81
88
  - lib/stripe/resources/charge.rb
@@ -102,29 +109,22 @@ files:
102
109
  - lib/stripe/resources/file.rb
103
110
  - lib/stripe/resources/file_link.rb
104
111
  - lib/stripe/resources/financial_connections/account.rb
105
- - lib/stripe/resources/financial_connections/account_inferred_balance.rb
106
112
  - lib/stripe/resources/financial_connections/account_owner.rb
107
113
  - lib/stripe/resources/financial_connections/account_ownership.rb
108
- - lib/stripe/resources/financial_connections/institution.rb
109
114
  - lib/stripe/resources/financial_connections/session.rb
110
115
  - lib/stripe/resources/financial_connections/transaction.rb
111
116
  - lib/stripe/resources/forwarding/request.rb
112
117
  - lib/stripe/resources/funding_instructions.rb
113
- - lib/stripe/resources/gift_cards/card.rb
114
- - lib/stripe/resources/gift_cards/transaction.rb
115
118
  - lib/stripe/resources/identity/verification_report.rb
116
119
  - lib/stripe/resources/identity/verification_session.rb
117
120
  - lib/stripe/resources/invoice.rb
118
121
  - lib/stripe/resources/invoice_item.rb
119
122
  - lib/stripe/resources/invoice_line_item.rb
120
- - lib/stripe/resources/invoice_payment.rb
121
123
  - lib/stripe/resources/invoice_rendering_template.rb
122
124
  - lib/stripe/resources/issuing/authorization.rb
123
125
  - lib/stripe/resources/issuing/card.rb
124
126
  - lib/stripe/resources/issuing/cardholder.rb
125
- - lib/stripe/resources/issuing/credit_underwriting_record.rb
126
127
  - lib/stripe/resources/issuing/dispute.rb
127
- - lib/stripe/resources/issuing/dispute_settlement_detail.rb
128
128
  - lib/stripe/resources/issuing/personalization_design.rb
129
129
  - lib/stripe/resources/issuing/physical_bundle.rb
130
130
  - lib/stripe/resources/issuing/token.rb
@@ -132,8 +132,6 @@ files:
132
132
  - lib/stripe/resources/line_item.rb
133
133
  - lib/stripe/resources/login_link.rb
134
134
  - lib/stripe/resources/mandate.rb
135
- - lib/stripe/resources/margin.rb
136
- - lib/stripe/resources/order.rb
137
135
  - lib/stripe/resources/payment_intent.rb
138
136
  - lib/stripe/resources/payment_link.rb
139
137
  - lib/stripe/resources/payment_method.rb
@@ -147,9 +145,6 @@ files:
147
145
  - lib/stripe/resources/product_feature.rb
148
146
  - lib/stripe/resources/promotion_code.rb
149
147
  - lib/stripe/resources/quote.rb
150
- - lib/stripe/resources/quote_phase.rb
151
- - lib/stripe/resources/quote_preview_invoice.rb
152
- - lib/stripe/resources/quote_preview_subscription_schedule.rb
153
148
  - lib/stripe/resources/radar/early_fraud_warning.rb
154
149
  - lib/stripe/resources/radar/value_list.rb
155
150
  - lib/stripe/resources/radar/value_list_item.rb
@@ -168,10 +163,8 @@ files:
168
163
  - lib/stripe/resources/subscription.rb
169
164
  - lib/stripe/resources/subscription_item.rb
170
165
  - lib/stripe/resources/subscription_schedule.rb
171
- - lib/stripe/resources/tax/association.rb
172
166
  - lib/stripe/resources/tax/calculation.rb
173
167
  - lib/stripe/resources/tax/calculation_line_item.rb
174
- - lib/stripe/resources/tax/form.rb
175
168
  - lib/stripe/resources/tax/registration.rb
176
169
  - lib/stripe/resources/tax/settings.rb
177
170
  - lib/stripe/resources/tax/transaction.rb
@@ -183,7 +176,6 @@ files:
183
176
  - lib/stripe/resources/terminal/connection_token.rb
184
177
  - lib/stripe/resources/terminal/location.rb
185
178
  - lib/stripe/resources/terminal/reader.rb
186
- - lib/stripe/resources/terminal/reader_collected_data.rb
187
179
  - lib/stripe/resources/test_helpers/test_clock.rb
188
180
  - lib/stripe/resources/token.rb
189
181
  - lib/stripe/resources/topup.rb
@@ -201,14 +193,201 @@ files:
201
193
  - lib/stripe/resources/treasury/transaction_entry.rb
202
194
  - lib/stripe/resources/usage_record.rb
203
195
  - lib/stripe/resources/usage_record_summary.rb
196
+ - lib/stripe/resources/v2/billing/meter_event.rb
197
+ - lib/stripe/resources/v2/billing/meter_event_adjustment.rb
198
+ - lib/stripe/resources/v2/billing/meter_event_session.rb
199
+ - lib/stripe/resources/v2/event.rb
204
200
  - lib/stripe/resources/webhook_endpoint.rb
205
201
  - lib/stripe/search_result_object.rb
202
+ - lib/stripe/services.rb
203
+ - lib/stripe/services/account_capability_service.rb
204
+ - lib/stripe/services/account_external_account_service.rb
205
+ - lib/stripe/services/account_link_service.rb
206
+ - lib/stripe/services/account_login_link_service.rb
207
+ - lib/stripe/services/account_person_service.rb
208
+ - lib/stripe/services/account_service.rb
209
+ - lib/stripe/services/account_session_service.rb
210
+ - lib/stripe/services/apple_pay_domain_service.rb
211
+ - lib/stripe/services/application_fee_refund_service.rb
212
+ - lib/stripe/services/application_fee_service.rb
213
+ - lib/stripe/services/apps/secret_service.rb
214
+ - lib/stripe/services/apps_service.rb
215
+ - lib/stripe/services/balance_service.rb
216
+ - lib/stripe/services/balance_transaction_service.rb
217
+ - lib/stripe/services/billing/alert_service.rb
218
+ - lib/stripe/services/billing/credit_balance_summary_service.rb
219
+ - lib/stripe/services/billing/credit_balance_transaction_service.rb
220
+ - lib/stripe/services/billing/credit_grant_service.rb
221
+ - lib/stripe/services/billing/meter_event_adjustment_service.rb
222
+ - lib/stripe/services/billing/meter_event_service.rb
223
+ - lib/stripe/services/billing/meter_event_summary_service.rb
224
+ - lib/stripe/services/billing/meter_service.rb
225
+ - lib/stripe/services/billing_portal/configuration_service.rb
226
+ - lib/stripe/services/billing_portal/session_service.rb
227
+ - lib/stripe/services/billing_portal_service.rb
228
+ - lib/stripe/services/billing_service.rb
229
+ - lib/stripe/services/charge_service.rb
230
+ - lib/stripe/services/checkout/session_line_item_service.rb
231
+ - lib/stripe/services/checkout/session_service.rb
232
+ - lib/stripe/services/checkout_service.rb
233
+ - lib/stripe/services/climate/order_service.rb
234
+ - lib/stripe/services/climate/product_service.rb
235
+ - lib/stripe/services/climate/supplier_service.rb
236
+ - lib/stripe/services/climate_service.rb
237
+ - lib/stripe/services/confirmation_token_service.rb
238
+ - lib/stripe/services/country_spec_service.rb
239
+ - lib/stripe/services/coupon_service.rb
240
+ - lib/stripe/services/credit_note_line_item_service.rb
241
+ - lib/stripe/services/credit_note_preview_lines_service.rb
242
+ - lib/stripe/services/credit_note_service.rb
243
+ - lib/stripe/services/customer_balance_transaction_service.rb
244
+ - lib/stripe/services/customer_cash_balance_service.rb
245
+ - lib/stripe/services/customer_cash_balance_transaction_service.rb
246
+ - lib/stripe/services/customer_funding_instructions_service.rb
247
+ - lib/stripe/services/customer_payment_method_service.rb
248
+ - lib/stripe/services/customer_payment_source_service.rb
249
+ - lib/stripe/services/customer_service.rb
250
+ - lib/stripe/services/customer_session_service.rb
251
+ - lib/stripe/services/customer_tax_id_service.rb
252
+ - lib/stripe/services/dispute_service.rb
253
+ - lib/stripe/services/entitlements/active_entitlement_service.rb
254
+ - lib/stripe/services/entitlements/feature_service.rb
255
+ - lib/stripe/services/entitlements_service.rb
256
+ - lib/stripe/services/ephemeral_key_service.rb
257
+ - lib/stripe/services/event_service.rb
258
+ - lib/stripe/services/exchange_rate_service.rb
259
+ - lib/stripe/services/file_link_service.rb
260
+ - lib/stripe/services/file_service.rb
261
+ - lib/stripe/services/financial_connections/account_owner_service.rb
262
+ - lib/stripe/services/financial_connections/account_service.rb
263
+ - lib/stripe/services/financial_connections/session_service.rb
264
+ - lib/stripe/services/financial_connections/transaction_service.rb
265
+ - lib/stripe/services/financial_connections_service.rb
266
+ - lib/stripe/services/forwarding/request_service.rb
267
+ - lib/stripe/services/forwarding_service.rb
268
+ - lib/stripe/services/identity/verification_report_service.rb
269
+ - lib/stripe/services/identity/verification_session_service.rb
270
+ - lib/stripe/services/identity_service.rb
271
+ - lib/stripe/services/invoice_item_service.rb
272
+ - lib/stripe/services/invoice_line_item_service.rb
273
+ - lib/stripe/services/invoice_rendering_template_service.rb
274
+ - lib/stripe/services/invoice_service.rb
275
+ - lib/stripe/services/invoice_upcoming_lines_service.rb
276
+ - lib/stripe/services/issuing/authorization_service.rb
277
+ - lib/stripe/services/issuing/card_service.rb
278
+ - lib/stripe/services/issuing/cardholder_service.rb
279
+ - lib/stripe/services/issuing/dispute_service.rb
280
+ - lib/stripe/services/issuing/personalization_design_service.rb
281
+ - lib/stripe/services/issuing/physical_bundle_service.rb
282
+ - lib/stripe/services/issuing/token_service.rb
283
+ - lib/stripe/services/issuing/transaction_service.rb
284
+ - lib/stripe/services/issuing_service.rb
285
+ - lib/stripe/services/mandate_service.rb
286
+ - lib/stripe/services/oauth_service.rb
287
+ - lib/stripe/services/payment_intent_service.rb
288
+ - lib/stripe/services/payment_link_line_item_service.rb
289
+ - lib/stripe/services/payment_link_service.rb
290
+ - lib/stripe/services/payment_method_configuration_service.rb
291
+ - lib/stripe/services/payment_method_domain_service.rb
292
+ - lib/stripe/services/payment_method_service.rb
293
+ - lib/stripe/services/payout_service.rb
294
+ - lib/stripe/services/plan_service.rb
295
+ - lib/stripe/services/price_service.rb
296
+ - lib/stripe/services/product_feature_service.rb
297
+ - lib/stripe/services/product_service.rb
298
+ - lib/stripe/services/promotion_code_service.rb
299
+ - lib/stripe/services/quote_computed_upfront_line_items_service.rb
300
+ - lib/stripe/services/quote_line_item_service.rb
301
+ - lib/stripe/services/quote_service.rb
302
+ - lib/stripe/services/radar/early_fraud_warning_service.rb
303
+ - lib/stripe/services/radar/value_list_item_service.rb
304
+ - lib/stripe/services/radar/value_list_service.rb
305
+ - lib/stripe/services/radar_service.rb
306
+ - lib/stripe/services/refund_service.rb
307
+ - lib/stripe/services/reporting/report_run_service.rb
308
+ - lib/stripe/services/reporting/report_type_service.rb
309
+ - lib/stripe/services/reporting_service.rb
310
+ - lib/stripe/services/review_service.rb
311
+ - lib/stripe/services/setup_attempt_service.rb
312
+ - lib/stripe/services/setup_intent_service.rb
313
+ - lib/stripe/services/shipping_rate_service.rb
314
+ - lib/stripe/services/sigma/scheduled_query_run_service.rb
315
+ - lib/stripe/services/sigma_service.rb
316
+ - lib/stripe/services/source_service.rb
317
+ - lib/stripe/services/source_transaction_service.rb
318
+ - lib/stripe/services/subscription_item_service.rb
319
+ - lib/stripe/services/subscription_item_usage_record_service.rb
320
+ - lib/stripe/services/subscription_item_usage_record_summary_service.rb
321
+ - lib/stripe/services/subscription_schedule_service.rb
322
+ - lib/stripe/services/subscription_service.rb
323
+ - lib/stripe/services/tax/calculation_line_item_service.rb
324
+ - lib/stripe/services/tax/calculation_service.rb
325
+ - lib/stripe/services/tax/registration_service.rb
326
+ - lib/stripe/services/tax/settings_service.rb
327
+ - lib/stripe/services/tax/transaction_line_item_service.rb
328
+ - lib/stripe/services/tax/transaction_service.rb
329
+ - lib/stripe/services/tax_code_service.rb
330
+ - lib/stripe/services/tax_id_service.rb
331
+ - lib/stripe/services/tax_rate_service.rb
332
+ - lib/stripe/services/tax_service.rb
333
+ - lib/stripe/services/terminal/configuration_service.rb
334
+ - lib/stripe/services/terminal/connection_token_service.rb
335
+ - lib/stripe/services/terminal/location_service.rb
336
+ - lib/stripe/services/terminal/reader_service.rb
337
+ - lib/stripe/services/terminal_service.rb
338
+ - lib/stripe/services/test_helpers/confirmation_token_service.rb
339
+ - lib/stripe/services/test_helpers/customer_service.rb
340
+ - lib/stripe/services/test_helpers/issuing/authorization_service.rb
341
+ - lib/stripe/services/test_helpers/issuing/card_service.rb
342
+ - lib/stripe/services/test_helpers/issuing/personalization_design_service.rb
343
+ - lib/stripe/services/test_helpers/issuing/transaction_service.rb
344
+ - lib/stripe/services/test_helpers/issuing_service.rb
345
+ - lib/stripe/services/test_helpers/refund_service.rb
346
+ - lib/stripe/services/test_helpers/terminal/reader_service.rb
347
+ - lib/stripe/services/test_helpers/terminal_service.rb
348
+ - lib/stripe/services/test_helpers/test_clock_service.rb
349
+ - lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb
350
+ - lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb
351
+ - lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb
352
+ - lib/stripe/services/test_helpers/treasury/received_credit_service.rb
353
+ - lib/stripe/services/test_helpers/treasury/received_debit_service.rb
354
+ - lib/stripe/services/test_helpers/treasury_service.rb
355
+ - lib/stripe/services/test_helpers_service.rb
356
+ - lib/stripe/services/token_service.rb
357
+ - lib/stripe/services/topup_service.rb
358
+ - lib/stripe/services/transfer_reversal_service.rb
359
+ - lib/stripe/services/transfer_service.rb
360
+ - lib/stripe/services/treasury/credit_reversal_service.rb
361
+ - lib/stripe/services/treasury/debit_reversal_service.rb
362
+ - lib/stripe/services/treasury/financial_account_features_service.rb
363
+ - lib/stripe/services/treasury/financial_account_service.rb
364
+ - lib/stripe/services/treasury/inbound_transfer_service.rb
365
+ - lib/stripe/services/treasury/outbound_payment_service.rb
366
+ - lib/stripe/services/treasury/outbound_transfer_service.rb
367
+ - lib/stripe/services/treasury/received_credit_service.rb
368
+ - lib/stripe/services/treasury/received_debit_service.rb
369
+ - lib/stripe/services/treasury/transaction_entry_service.rb
370
+ - lib/stripe/services/treasury/transaction_service.rb
371
+ - lib/stripe/services/treasury_service.rb
372
+ - lib/stripe/services/v1_services.rb
373
+ - lib/stripe/services/v2/billing/meter_event_adjustment_service.rb
374
+ - lib/stripe/services/v2/billing/meter_event_service.rb
375
+ - lib/stripe/services/v2/billing/meter_event_session_service.rb
376
+ - lib/stripe/services/v2/billing/meter_event_stream_service.rb
377
+ - lib/stripe/services/v2/billing_service.rb
378
+ - lib/stripe/services/v2/core/event_service.rb
379
+ - lib/stripe/services/v2/core_service.rb
380
+ - lib/stripe/services/v2_services.rb
381
+ - lib/stripe/services/webhook_endpoint_service.rb
206
382
  - lib/stripe/singleton_api_resource.rb
207
383
  - lib/stripe/stripe_client.rb
208
384
  - lib/stripe/stripe_configuration.rb
209
385
  - lib/stripe/stripe_object.rb
210
386
  - lib/stripe/stripe_response.rb
387
+ - lib/stripe/stripe_service.rb
388
+ - lib/stripe/thin_event.rb
211
389
  - lib/stripe/util.rb
390
+ - lib/stripe/v2_list_object.rb
212
391
  - lib/stripe/version.rb
213
392
  - lib/stripe/webhook.rb
214
393
  - stripe.gemspec
@@ -234,9 +413,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
413
  version: 2.3.0
235
414
  required_rubygems_version: !ruby/object:Gem::Requirement
236
415
  requirements:
237
- - - ">"
416
+ - - ">="
238
417
  - !ruby/object:Gem::Version
239
- version: 1.3.1
418
+ version: '0'
240
419
  requirements: []
241
420
  rubygems_version: 3.3.27
242
421
  signing_key:
@@ -1,79 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stripe
4
- class RequestSigningAuthenticator
5
- AUTHORIZATION_HEADER_NAME = "Authorization"
6
- CONTENT_TYPE_HEADER_NAME = "Content-Type"
7
- STRIPE_CONTEXT_HEADER_NAME = "Stripe-Context"
8
- STRIPE_ACCOUNT_HEADER_NAME = "Stripe-Account"
9
- CONTENT_DIGEST_HEADER_NAME = "Content-Digest"
10
- SIGNATURE_INPUT_HEADER_NAME = "Signature-Input"
11
- SIGNATURE_HEADER_NAME = "Signature"
12
-
13
- attr_reader :auth_token, :sign_lambda
14
-
15
- def initialize(auth_token, sign_lambda)
16
- raise ArgumentError, "auth_token must be a string" unless auth_token.is_a?(String)
17
- raise ArgumentError, "sign_lambda must be a lambda" unless sign_lambda.is_a?(Proc)
18
-
19
- @auth_token = auth_token
20
- @sign_lambda = sign_lambda
21
- end
22
-
23
- def authenticate(method, headers, body)
24
- covered_headers = [CONTENT_TYPE_HEADER_NAME,
25
- CONTENT_DIGEST_HEADER_NAME,
26
- STRIPE_CONTEXT_HEADER_NAME,
27
- STRIPE_ACCOUNT_HEADER_NAME,
28
- AUTHORIZATION_HEADER_NAME,]
29
-
30
- headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
31
-
32
- if method == :get
33
- covered_headers -= [CONTENT_TYPE_HEADER_NAME,
34
- CONTENT_DIGEST_HEADER_NAME,]
35
- else
36
- content = body || ""
37
- headers[CONTENT_DIGEST_HEADER_NAME] =
38
- %(sha-256=:#{content_digest(content)}:)
39
- end
40
-
41
- covered_headers_formatted = covered_headers
42
- .map { |string| %("#{string.downcase}") }
43
- .join(" ")
44
-
45
- signature_input = "(#{covered_headers_formatted});created=#{created_time}"
46
-
47
- inputs = covered_headers
48
- .map { |header| %("#{header.downcase}": #{headers[header]}) }
49
- .join("\n")
50
-
51
- signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
52
- .encode(Encoding::UTF_8)
53
-
54
- headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
55
-
56
- headers[SIGNATURE_HEADER_NAME] =
57
- "sig1=:#{encoded_signature(signature_base)}:"
58
- end
59
-
60
- private def sign(signature_base)
61
- @sign_lambda.call(signature_base)
62
- end
63
-
64
- private def encoded_signature(signature_base)
65
- Base64.strict_encode64(sign(signature_base))
66
- rescue StandardError
67
- raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' " \
68
- "when calculating request signature."
69
- end
70
-
71
- private def content_digest(content)
72
- Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
73
- end
74
-
75
- private def created_time
76
- Time.now.to_i
77
- end
78
- end
79
- end
@@ -1,32 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
6
- #
7
- # See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts.
8
- class AccountNotice < APIResource
9
- extend Stripe::APIOperations::List
10
- include Stripe::APIOperations::Save
11
-
12
- OBJECT_NAME = "account_notice"
13
- def self.object_name
14
- "account_notice"
15
- end
16
-
17
- # Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
18
- def self.list(filters = {}, opts = {})
19
- request_stripe_object(method: :get, path: "/v1/account_notices", params: filters, opts: opts)
20
- end
21
-
22
- # Updates an AccountNotice object.
23
- def self.update(id, params = {}, opts = {})
24
- request_stripe_object(
25
- method: :post,
26
- path: format("/v1/account_notices/%<id>s", { id: CGI.escape(id) }),
27
- params: params,
28
- opts: opts
29
- )
30
- end
31
- end
32
- end
@@ -1,49 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # This is an object representing an offer of financing from
7
- # Stripe Capital to a Connect subaccount.
8
- class FinancingOffer < APIResource
9
- extend Stripe::APIOperations::List
10
-
11
- OBJECT_NAME = "capital.financing_offer"
12
- def self.object_name
13
- "capital.financing_offer"
14
- end
15
-
16
- # Retrieves the financing offers available for Connected accounts that belong to your platform.
17
- def self.list(filters = {}, opts = {})
18
- request_stripe_object(
19
- method: :get,
20
- path: "/v1/capital/financing_offers",
21
- params: filters,
22
- opts: opts
23
- )
24
- end
25
-
26
- # Acknowledges that platform has received and delivered the financing_offer to
27
- # the intended merchant recipient.
28
- def mark_delivered(params = {}, opts = {})
29
- request_stripe_object(
30
- method: :post,
31
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
32
- params: params,
33
- opts: opts
34
- )
35
- end
36
-
37
- # Acknowledges that platform has received and delivered the financing_offer to
38
- # the intended merchant recipient.
39
- def self.mark_delivered(financing_offer, params = {}, opts = {})
40
- request_stripe_object(
41
- method: :post,
42
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
43
- params: params,
44
- opts: opts
45
- )
46
- end
47
- end
48
- end
49
- end
@@ -1,15 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # A financing object describes an account's current financing state. Used by Connect
7
- # platforms to read the state of Capital offered to their connected accounts.
8
- class FinancingSummary < SingletonAPIResource
9
- OBJECT_NAME = "capital.financing_summary"
10
- def self.object_name
11
- "capital.financing_summary"
12
- end
13
- end
14
- end
15
- end