Class: AbacatePay::Enums::Webhooks::EventTypes

Inherits:
Object
  • Object
show all
Defined in:
lib/abacate_pay/enums/webhooks/event_types.rb

Constant Summary collapse

CHECKOUT_COMPLETED =
"checkout.completed"
CHECKOUT_REFUNDED =
"checkout.refunded"
CHECKOUT_DISPUTED =
"checkout.disputed"
TRANSPARENT_COMPLETED =
"transparent.completed"
TRANSPARENT_REFUNDED =
"transparent.refunded"
TRANSPARENT_DISPUTED =
"transparent.disputed"
SUBSCRIPTION_COMPLETED =
"subscription.completed"
SUBSCRIPTION_RENEWED =
"subscription.renewed"
SUBSCRIPTION_CANCELLED =
"subscription.cancelled"
SUBSCRIPTION_PAYMENT_FAILED =

Recurring charge failed — the dunning signal. Without handling this, a failing subscription looks identical to a healthy one.

"subscription.payment_failed"
SUBSCRIPTION_TRIAL_STARTED =
"subscription.trial_started"
TRANSFER_COMPLETED =
"transfer.completed"
TRANSFER_FAILED =
"transfer.failed"
PAYOUT_COMPLETED =
"payout.completed"
PAYOUT_FAILED =
"payout.failed"

Class Method Summary collapse

Class Method Details

.valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/abacate_pay/enums/webhooks/event_types.rb', line 38

def self.valid?(value)
  values.include?(value)
end

.validate!(value) ⇒ Object

Raises:

  • (ArgumentError)


42
43
44
45
46
# File 'lib/abacate_pay/enums/webhooks/event_types.rb', line 42

def self.validate!(value)
  raise ArgumentError, "Invalid webhook event type: #{value}" unless valid?(value)

  value
end