Sha256: 718d54fc6897e25b7feb5a739d03dd5066bacbf6f8ecc7d08aa60032608d2118

Contents?: true

Size: 530 Bytes

Versions: 5

Compression:

Stored size: 530 Bytes

Contents

module Killbill::HelloWorld
  class UserListener
    def initialize(kb_apis, logger)
      @kb_apis = kb_apis
      @logger = logger
    end

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
killbill-helloworld-4.0.0 lib/helloworld/user_listener.rb
killbill-helloworld-3.0.1 lib/helloworld/user_listener.rb
killbill-helloworld-3.0.0 lib/helloworld/user_listener.rb
killbill-helloworld-2.0.0 lib/helloworld/user_listener.rb
killbill-helloworld-1.0.0 lib/helloworld/user_listener.rb