Class: Killbill::HelloWorld::UserListener
- Inherits:
-
Object
- Object
- Killbill::HelloWorld::UserListener
- Defined in:
- lib/helloworld/user_listener.rb
Instance Method Summary collapse
-
#initialize(kb_apis, logger) ⇒ UserListener
constructor
A new instance of UserListener.
- #update(account_id, tenant_id) ⇒ Object
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(account_id, tenant_id) user = User.where(:kb_account_id => account_id).first_or_create! # Find the Kill Bill account associated with that account id kb_account = @kb_apis.account_user_api.get_account_by_id(account_id, @kb_apis.create_context(tenant_id)) @logger.info "Successfully saved #{kb_account.name} (#{kb_account.email})" end |