Class: Stripe::StripeEventNotificationHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/stripe/stripe_event_notification_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, webhook_secret, &fallback_callback) ⇒ StripeEventNotificationHandler

Returns a new instance of StripeEventNotificationHandler.

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
21
22
23
# File 'lib/stripe/stripe_event_notification_handler.rb', line 14

def initialize(client, webhook_secret, &fallback_callback)
  raise ArgumentError, "You must pass a block to act as a fallback" if fallback_callback.nil?

  @client = client
  @webhook_secret = webhook_secret
  @fallback_callback = fallback_callback

  @registered_handlers = {}
  @has_handled_events = false
end

Instance Method Details

#handle(webhook_body, sig_header) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/stripe/stripe_event_notification_handler.rb', line 25

def handle(webhook_body, sig_header)
  # we're ok with this not being a thread-safe write since registering
  # handlers should happen synchronously on startup before any multi-threaded reads happen
  @has_handled_events = true

  notif = @client.parse_event_notification(
    webhook_body,
    sig_header,
    @webhook_secret
  )

  # Create a new client with the event's context to ensure thread-safety
  event_client = new_client_with_context(notif.context)

  handler = @registered_handlers[notif.type]
  if handler
    handler.call(notif, event_client)
  else
    @fallback_callback.call(notif, event_client,
                            UnhandledNotificationDetails.new(!notif.is_a?(Stripe::Events::UnknownEventNotification)))
  end
end

#on_v1_billing_meter_error_report_triggered(&handler) ⇒ Object

event-handler-methods: The beginning of the section generated from our OpenAPI spec

Raises:

  • (ArgumentError)


77
78
79
80
81
# File 'lib/stripe/stripe_event_notification_handler.rb', line 77

def on_v1_billing_meter_error_report_triggered(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v1.billing.meter.error_report_triggered", &handler)
end

#on_v1_billing_meter_no_meter_found(&handler) ⇒ Object

Raises:

  • (ArgumentError)


83
84
85
86
87
# File 'lib/stripe/stripe_event_notification_handler.rb', line 83

def on_v1_billing_meter_no_meter_found(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v1.billing.meter.no_meter_found", &handler)
end

#on_v2_commerce_product_catalog_imports_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


89
90
91
92
93
# File 'lib/stripe/stripe_event_notification_handler.rb', line 89

def on_v2_commerce_product_catalog_imports_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.commerce.product_catalog.imports.failed", &handler)
end

#on_v2_commerce_product_catalog_imports_processing(&handler) ⇒ Object

Raises:

  • (ArgumentError)


95
96
97
98
99
# File 'lib/stripe/stripe_event_notification_handler.rb', line 95

def on_v2_commerce_product_catalog_imports_processing(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.commerce.product_catalog.imports.processing", &handler)
end

#on_v2_commerce_product_catalog_imports_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


101
102
103
104
105
# File 'lib/stripe/stripe_event_notification_handler.rb', line 101

def on_v2_commerce_product_catalog_imports_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.commerce.product_catalog.imports.succeeded", &handler)
end

#on_v2_commerce_product_catalog_imports_succeeded_with_errors(&handler) ⇒ Object

Raises:

  • (ArgumentError)


107
108
109
110
111
# File 'lib/stripe/stripe_event_notification_handler.rb', line 107

def on_v2_commerce_product_catalog_imports_succeeded_with_errors(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.commerce.product_catalog.imports.succeeded_with_errors", &handler)
end

#on_v2_core_account_closed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


113
114
115
116
117
# File 'lib/stripe/stripe_event_notification_handler.rb', line 113

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account.closed", &handler)
end

#on_v2_core_account_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


119
120
121
122
123
# File 'lib/stripe/stripe_event_notification_handler.rb', line 119

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account.created", &handler)
end

#on_v2_core_account_including_configuration_customer_capability_status_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


131
132
133
134
135
# File 'lib/stripe/stripe_event_notification_handler.rb', line 131

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.customer].capability_status_updated", &handler)
end

#on_v2_core_account_including_configuration_customer_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


137
138
139
140
141
# File 'lib/stripe/stripe_event_notification_handler.rb', line 137

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.customer].updated", &handler)
end

#on_v2_core_account_including_configuration_merchant_capability_status_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


143
144
145
146
147
# File 'lib/stripe/stripe_event_notification_handler.rb', line 143

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.merchant].capability_status_updated", &handler)
end

#on_v2_core_account_including_configuration_merchant_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


149
150
151
152
153
# File 'lib/stripe/stripe_event_notification_handler.rb', line 149

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.merchant].updated", &handler)
end

#on_v2_core_account_including_configuration_recipient_capability_status_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


155
156
157
158
159
# File 'lib/stripe/stripe_event_notification_handler.rb', line 155

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.recipient].capability_status_updated", &handler)
end

#on_v2_core_account_including_configuration_recipient_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


161
162
163
164
165
# File 'lib/stripe/stripe_event_notification_handler.rb', line 161

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.recipient].updated", &handler)
end

#on_v2_core_account_including_configuration_storer_capability_status_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


167
168
169
170
171
# File 'lib/stripe/stripe_event_notification_handler.rb', line 167

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.storer].capability_status_updated", &handler)
end

#on_v2_core_account_including_configuration_storer_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


173
174
175
176
177
# File 'lib/stripe/stripe_event_notification_handler.rb', line 173

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[configuration.storer].updated", &handler)
end

#on_v2_core_account_including_defaults_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


179
180
181
182
183
# File 'lib/stripe/stripe_event_notification_handler.rb', line 179

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[defaults].updated", &handler)
end

#on_v2_core_account_including_future_requirements_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


185
186
187
188
189
# File 'lib/stripe/stripe_event_notification_handler.rb', line 185

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[future_requirements].updated", &handler)
end

#on_v2_core_account_including_identity_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


191
192
193
194
195
# File 'lib/stripe/stripe_event_notification_handler.rb', line 191

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[identity].updated", &handler)
end

#on_v2_core_account_including_requirements_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


197
198
199
200
201
# File 'lib/stripe/stripe_event_notification_handler.rb', line 197

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account[requirements].updated", &handler)
end

Raises:

  • (ArgumentError)


203
204
205
206
207
# File 'lib/stripe/stripe_event_notification_handler.rb', line 203

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account_link.returned", &handler)
end

#on_v2_core_account_person_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


209
210
211
212
213
# File 'lib/stripe/stripe_event_notification_handler.rb', line 209

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account_person.created", &handler)
end

#on_v2_core_account_person_deleted(&handler) ⇒ Object

Raises:

  • (ArgumentError)


215
216
217
218
219
# File 'lib/stripe/stripe_event_notification_handler.rb', line 215

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account_person.deleted", &handler)
end

#on_v2_core_account_person_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


221
222
223
224
225
# File 'lib/stripe/stripe_event_notification_handler.rb', line 221

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account_person.updated", &handler)
end

#on_v2_core_account_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


125
126
127
128
129
# File 'lib/stripe/stripe_event_notification_handler.rb', line 125

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.account.updated", &handler)
end

#on_v2_core_batch_job_batch_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


227
228
229
230
231
# File 'lib/stripe/stripe_event_notification_handler.rb', line 227

def on_v2_core_batch_job_batch_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.batch_failed", &handler)
end

#on_v2_core_batch_job_canceled(&handler) ⇒ Object

Raises:

  • (ArgumentError)


233
234
235
236
237
# File 'lib/stripe/stripe_event_notification_handler.rb', line 233

def on_v2_core_batch_job_canceled(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.canceled", &handler)
end

#on_v2_core_batch_job_completed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


239
240
241
242
243
# File 'lib/stripe/stripe_event_notification_handler.rb', line 239

def on_v2_core_batch_job_completed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.completed", &handler)
end

#on_v2_core_batch_job_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


245
246
247
248
249
# File 'lib/stripe/stripe_event_notification_handler.rb', line 245

def on_v2_core_batch_job_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.created", &handler)
end

#on_v2_core_batch_job_ready_for_upload(&handler) ⇒ Object

Raises:

  • (ArgumentError)


251
252
253
254
255
# File 'lib/stripe/stripe_event_notification_handler.rb', line 251

def on_v2_core_batch_job_ready_for_upload(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.ready_for_upload", &handler)
end

#on_v2_core_batch_job_timeout(&handler) ⇒ Object

Raises:

  • (ArgumentError)


257
258
259
260
261
# File 'lib/stripe/stripe_event_notification_handler.rb', line 257

def on_v2_core_batch_job_timeout(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.timeout", &handler)
end

#on_v2_core_batch_job_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


263
264
265
266
267
# File 'lib/stripe/stripe_event_notification_handler.rb', line 263

def on_v2_core_batch_job_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.updated", &handler)
end

#on_v2_core_batch_job_upload_timeout(&handler) ⇒ Object

Raises:

  • (ArgumentError)


269
270
271
272
273
# File 'lib/stripe/stripe_event_notification_handler.rb', line 269

def on_v2_core_batch_job_upload_timeout(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.upload_timeout", &handler)
end

#on_v2_core_batch_job_validating(&handler) ⇒ Object

Raises:

  • (ArgumentError)


275
276
277
278
279
# File 'lib/stripe/stripe_event_notification_handler.rb', line 275

def on_v2_core_batch_job_validating(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.validating", &handler)
end

#on_v2_core_batch_job_validation_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


281
282
283
284
285
# File 'lib/stripe/stripe_event_notification_handler.rb', line 281

def on_v2_core_batch_job_validation_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.batch_job.validation_failed", &handler)
end

#on_v2_core_event_destination_ping(&handler) ⇒ Object

Raises:

  • (ArgumentError)


287
288
289
290
291
# File 'lib/stripe/stripe_event_notification_handler.rb', line 287

def on_v2_core_event_destination_ping(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.event_destination.ping", &handler)
end

#on_v2_core_health_event_generation_failure_resolved(&handler) ⇒ Object

Raises:

  • (ArgumentError)


293
294
295
296
297
# File 'lib/stripe/stripe_event_notification_handler.rb', line 293

def on_v2_core_health_event_generation_failure_resolved(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.core.health.event_generation_failure.resolved", &handler)
end

#on_v2_data_reporting_query_run_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


299
300
301
302
303
# File 'lib/stripe/stripe_event_notification_handler.rb', line 299

def on_v2_data_reporting_query_run_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.data.reporting.query_run.created", &handler)
end

#on_v2_data_reporting_query_run_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


305
306
307
308
309
# File 'lib/stripe/stripe_event_notification_handler.rb', line 305

def on_v2_data_reporting_query_run_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.data.reporting.query_run.failed", &handler)
end

#on_v2_data_reporting_query_run_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


311
312
313
314
315
# File 'lib/stripe/stripe_event_notification_handler.rb', line 311

def on_v2_data_reporting_query_run_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.data.reporting.query_run.succeeded", &handler)
end

#on_v2_data_reporting_query_run_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


317
318
319
320
321
# File 'lib/stripe/stripe_event_notification_handler.rb', line 317

def on_v2_data_reporting_query_run_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.data.reporting.query_run.updated", &handler)
end

#on_v2_extend_workflow_run_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


323
324
325
326
327
# File 'lib/stripe/stripe_event_notification_handler.rb', line 323

def on_v2_extend_workflow_run_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.extend.workflow_run.failed", &handler)
end

#on_v2_extend_workflow_run_started(&handler) ⇒ Object

Raises:

  • (ArgumentError)


329
330
331
332
333
# File 'lib/stripe/stripe_event_notification_handler.rb', line 329

def on_v2_extend_workflow_run_started(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.extend.workflow_run.started", &handler)
end

#on_v2_extend_workflow_run_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


335
336
337
338
339
# File 'lib/stripe/stripe_event_notification_handler.rb', line 335

def on_v2_extend_workflow_run_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.extend.workflow_run.succeeded", &handler)
end

#on_v2_money_management_adjustment_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


341
342
343
344
345
# File 'lib/stripe/stripe_event_notification_handler.rb', line 341

def on_v2_money_management_adjustment_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.adjustment.created", &handler)
end

#on_v2_money_management_financial_account_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


347
348
349
350
351
# File 'lib/stripe/stripe_event_notification_handler.rb', line 347

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.financial_account.created", &handler)
end

#on_v2_money_management_financial_account_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


353
354
355
356
357
# File 'lib/stripe/stripe_event_notification_handler.rb', line 353

def (&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.financial_account.updated", &handler)
end

#on_v2_money_management_financial_address_activated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


359
360
361
362
363
# File 'lib/stripe/stripe_event_notification_handler.rb', line 359

def on_v2_money_management_financial_address_activated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.financial_address.activated", &handler)
end

#on_v2_money_management_financial_address_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


365
366
367
368
369
# File 'lib/stripe/stripe_event_notification_handler.rb', line 365

def on_v2_money_management_financial_address_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.financial_address.failed", &handler)
end

#on_v2_money_management_inbound_transfer_available(&handler) ⇒ Object

Raises:

  • (ArgumentError)


371
372
373
374
375
# File 'lib/stripe/stripe_event_notification_handler.rb', line 371

def on_v2_money_management_inbound_transfer_available(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.available", &handler)
end

#on_v2_money_management_inbound_transfer_bank_debit_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


377
378
379
380
381
# File 'lib/stripe/stripe_event_notification_handler.rb', line 377

def on_v2_money_management_inbound_transfer_bank_debit_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.bank_debit_failed", &handler)
end

#on_v2_money_management_inbound_transfer_bank_debit_processing(&handler) ⇒ Object

Raises:

  • (ArgumentError)


383
384
385
386
387
# File 'lib/stripe/stripe_event_notification_handler.rb', line 383

def on_v2_money_management_inbound_transfer_bank_debit_processing(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.bank_debit_processing", &handler)
end

#on_v2_money_management_inbound_transfer_bank_debit_queued(&handler) ⇒ Object

Raises:

  • (ArgumentError)


389
390
391
392
393
# File 'lib/stripe/stripe_event_notification_handler.rb', line 389

def on_v2_money_management_inbound_transfer_bank_debit_queued(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.bank_debit_queued", &handler)
end

#on_v2_money_management_inbound_transfer_bank_debit_returned(&handler) ⇒ Object

Raises:

  • (ArgumentError)


395
396
397
398
399
# File 'lib/stripe/stripe_event_notification_handler.rb', line 395

def on_v2_money_management_inbound_transfer_bank_debit_returned(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.bank_debit_returned", &handler)
end

#on_v2_money_management_inbound_transfer_bank_debit_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


401
402
403
404
405
# File 'lib/stripe/stripe_event_notification_handler.rb', line 401

def on_v2_money_management_inbound_transfer_bank_debit_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.inbound_transfer.bank_debit_succeeded", &handler)
end

#on_v2_money_management_outbound_payment_canceled(&handler) ⇒ Object

Raises:

  • (ArgumentError)


407
408
409
410
411
# File 'lib/stripe/stripe_event_notification_handler.rb', line 407

def on_v2_money_management_outbound_payment_canceled(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.canceled", &handler)
end

#on_v2_money_management_outbound_payment_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


413
414
415
416
417
# File 'lib/stripe/stripe_event_notification_handler.rb', line 413

def on_v2_money_management_outbound_payment_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.created", &handler)
end

#on_v2_money_management_outbound_payment_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


419
420
421
422
423
# File 'lib/stripe/stripe_event_notification_handler.rb', line 419

def on_v2_money_management_outbound_payment_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.failed", &handler)
end

#on_v2_money_management_outbound_payment_posted(&handler) ⇒ Object

Raises:

  • (ArgumentError)


425
426
427
428
429
# File 'lib/stripe/stripe_event_notification_handler.rb', line 425

def on_v2_money_management_outbound_payment_posted(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.posted", &handler)
end

#on_v2_money_management_outbound_payment_returned(&handler) ⇒ Object

Raises:

  • (ArgumentError)


431
432
433
434
435
# File 'lib/stripe/stripe_event_notification_handler.rb', line 431

def on_v2_money_management_outbound_payment_returned(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.returned", &handler)
end

#on_v2_money_management_outbound_payment_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


437
438
439
440
441
# File 'lib/stripe/stripe_event_notification_handler.rb', line 437

def on_v2_money_management_outbound_payment_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_payment.updated", &handler)
end

#on_v2_money_management_outbound_transfer_canceled(&handler) ⇒ Object

Raises:

  • (ArgumentError)


443
444
445
446
447
# File 'lib/stripe/stripe_event_notification_handler.rb', line 443

def on_v2_money_management_outbound_transfer_canceled(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.canceled", &handler)
end

#on_v2_money_management_outbound_transfer_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


449
450
451
452
453
# File 'lib/stripe/stripe_event_notification_handler.rb', line 449

def on_v2_money_management_outbound_transfer_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.created", &handler)
end

#on_v2_money_management_outbound_transfer_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


455
456
457
458
459
# File 'lib/stripe/stripe_event_notification_handler.rb', line 455

def on_v2_money_management_outbound_transfer_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.failed", &handler)
end

#on_v2_money_management_outbound_transfer_posted(&handler) ⇒ Object

Raises:

  • (ArgumentError)


461
462
463
464
465
# File 'lib/stripe/stripe_event_notification_handler.rb', line 461

def on_v2_money_management_outbound_transfer_posted(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.posted", &handler)
end

#on_v2_money_management_outbound_transfer_returned(&handler) ⇒ Object

Raises:

  • (ArgumentError)


467
468
469
470
471
# File 'lib/stripe/stripe_event_notification_handler.rb', line 467

def on_v2_money_management_outbound_transfer_returned(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.returned", &handler)
end

#on_v2_money_management_outbound_transfer_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


473
474
475
476
477
# File 'lib/stripe/stripe_event_notification_handler.rb', line 473

def on_v2_money_management_outbound_transfer_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.outbound_transfer.updated", &handler)
end

#on_v2_money_management_payout_method_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


479
480
481
482
483
# File 'lib/stripe/stripe_event_notification_handler.rb', line 479

def on_v2_money_management_payout_method_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.payout_method.created", &handler)
end

#on_v2_money_management_payout_method_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


485
486
487
488
489
# File 'lib/stripe/stripe_event_notification_handler.rb', line 485

def on_v2_money_management_payout_method_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.payout_method.updated", &handler)
end

#on_v2_money_management_received_credit_available(&handler) ⇒ Object

Raises:

  • (ArgumentError)


491
492
493
494
495
# File 'lib/stripe/stripe_event_notification_handler.rb', line 491

def on_v2_money_management_received_credit_available(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_credit.available", &handler)
end

#on_v2_money_management_received_credit_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


497
498
499
500
501
# File 'lib/stripe/stripe_event_notification_handler.rb', line 497

def on_v2_money_management_received_credit_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_credit.failed", &handler)
end

#on_v2_money_management_received_credit_returned(&handler) ⇒ Object

Raises:

  • (ArgumentError)


503
504
505
506
507
# File 'lib/stripe/stripe_event_notification_handler.rb', line 503

def on_v2_money_management_received_credit_returned(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_credit.returned", &handler)
end

#on_v2_money_management_received_credit_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


509
510
511
512
513
# File 'lib/stripe/stripe_event_notification_handler.rb', line 509

def on_v2_money_management_received_credit_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_credit.succeeded", &handler)
end

#on_v2_money_management_received_debit_canceled(&handler) ⇒ Object

Raises:

  • (ArgumentError)


515
516
517
518
519
# File 'lib/stripe/stripe_event_notification_handler.rb', line 515

def on_v2_money_management_received_debit_canceled(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_debit.canceled", &handler)
end

#on_v2_money_management_received_debit_failed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


521
522
523
524
525
# File 'lib/stripe/stripe_event_notification_handler.rb', line 521

def on_v2_money_management_received_debit_failed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_debit.failed", &handler)
end

#on_v2_money_management_received_debit_pending(&handler) ⇒ Object

Raises:

  • (ArgumentError)


527
528
529
530
531
# File 'lib/stripe/stripe_event_notification_handler.rb', line 527

def on_v2_money_management_received_debit_pending(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_debit.pending", &handler)
end

#on_v2_money_management_received_debit_succeeded(&handler) ⇒ Object

Raises:

  • (ArgumentError)


533
534
535
536
537
# File 'lib/stripe/stripe_event_notification_handler.rb', line 533

def on_v2_money_management_received_debit_succeeded(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_debit.succeeded", &handler)
end

#on_v2_money_management_received_debit_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


539
540
541
542
543
# File 'lib/stripe/stripe_event_notification_handler.rb', line 539

def on_v2_money_management_received_debit_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.received_debit.updated", &handler)
end

#on_v2_money_management_transaction_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


545
546
547
548
549
# File 'lib/stripe/stripe_event_notification_handler.rb', line 545

def on_v2_money_management_transaction_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.transaction.created", &handler)
end

#on_v2_money_management_transaction_updated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


551
552
553
554
555
# File 'lib/stripe/stripe_event_notification_handler.rb', line 551

def on_v2_money_management_transaction_updated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.money_management.transaction.updated", &handler)
end

#on_v2_orchestrated_commerce_agreement_confirmed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


557
558
559
560
561
# File 'lib/stripe/stripe_event_notification_handler.rb', line 557

def on_v2_orchestrated_commerce_agreement_confirmed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.orchestrated_commerce.agreement.confirmed", &handler)
end

#on_v2_orchestrated_commerce_agreement_created(&handler) ⇒ Object

Raises:

  • (ArgumentError)


563
564
565
566
567
# File 'lib/stripe/stripe_event_notification_handler.rb', line 563

def on_v2_orchestrated_commerce_agreement_created(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.orchestrated_commerce.agreement.created", &handler)
end

#on_v2_orchestrated_commerce_agreement_partially_confirmed(&handler) ⇒ Object

Raises:

  • (ArgumentError)


569
570
571
572
573
# File 'lib/stripe/stripe_event_notification_handler.rb', line 569

def on_v2_orchestrated_commerce_agreement_partially_confirmed(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.orchestrated_commerce.agreement.partially_confirmed", &handler)
end

#on_v2_orchestrated_commerce_agreement_terminated(&handler) ⇒ Object

Raises:

  • (ArgumentError)


575
576
577
578
579
# File 'lib/stripe/stripe_event_notification_handler.rb', line 575

def on_v2_orchestrated_commerce_agreement_terminated(&handler)
  raise ArgumentError, "Block required to register event handler" if handler.nil?

  register("v2.orchestrated_commerce.agreement.terminated", &handler)
end

#registered_event_typesObject



48
49
50
# File 'lib/stripe/stripe_event_notification_handler.rb', line 48

def registered_event_types
  @registered_handlers.keys.sort
end