Class: NotificationTest::NotificationPlugin

Inherits:
Killbill::Plugin::Notification
  • Object
show all
Defined in:
lib/notification_test/api.rb

Instance Method Summary collapse

Instance Method Details

#on_event(event) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/notification_test/api.rb', line 4

def on_event(event)
  if event.event_type == :ACCOUNT_CREATION
    write_event :TAG_CREATION, :ACCOUNT, event.object_id, event., event.tenant_id
  elsif event.event_type == :ACCOUNT_CHANGE
    write_event :TAG_DELETION, :ACCOUNT, event.object_id, event., event.tenant_id
  else
    @logger.warn "Unexpected event type #{event.event_type} for object #{event.object_type}"
    # Error: unexpected event. Notify the test by sending a bogus event
    write_event :SUBSCRIPTION_UNCANCEL, :SUBSCRIPTION, 'f2e50cd0-faec-11e3-a3ac-0800200c9a66', 'f2e50cd0-faec-11e3-a3ac-0800200c9a66', 'f2e50cd0-faec-11e3-a3ac-0800200c9a66'
  end
end