Class: Killbill::HelloWorld::UserListener

Inherits:
Object
  • Object
show all
Defined in:
lib/helloworld/user_listener.rb

Instance Method Summary collapse

Constructor Details

#initialize(kb_apis, logger) ⇒ UserListener

Returns a new instance of UserListener.



3
4
5
6
# File 'lib/helloworld/user_listener.rb', line 3

def initialize(kb_apis, logger)
  @kb_apis = kb_apis
  @logger = logger
end

Instance Method Details

#update(account_id, tenant_id) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/helloworld/user_listener.rb', line 8

def update(, tenant_id)
  user = User.where(:kb_account_id => ).first_or_create!

  # Find the Kill Bill account associated with that account id
   = @kb_apis..(, @kb_apis.create_context(tenant_id))

  @logger.info "Successfully saved #{.name} (#{.email})"
end