Skip to Content Skip to Search
Methods
C
E
N

Attributes

[R] event

Class Public methods

events()

# File app/lib/stripe/event_handlers/customer_deleted.rb, line 7
def events
  ["customer.deleted"]
end

new(event)

# File app/lib/stripe/event_handlers/customer_deleted.rb, line 12
def initialize(event)
  @event = event
end

Instance Public methods

call()

# File app/lib/stripe/event_handlers/customer_deleted.rb, line 16
def call
  return unless self.class.events.include?(event.type)

  if member
    member.update(payment_gateway_id: nil)
    Dispatch.track(
      model: member,
      action: :customer_deleted,
      title: "Customer deleted from stripe dashboard",
      details: {deleted_payment_gateway_id: customer.id}
    )
  end
end