Kill Bill ruby library.
The following script will tag a list of accounts with OVERDUE_ENFORCEMENT_OFF and AUTO_PAY_OFF:
require 'killbill_client'
KillBillClient.url = 'http://127.0.0.1:8080'
AUDIT_USER = 'pierre (via ruby script)'
File.open(File.dirname(__FILE__) + '/accounts.txt').readlines.map(&:chomp).each do |kb_account_id|
account = KillBillClient::Model::Account.find_by_id kb_account_id
puts "Current tags for #{account.name} (#{account.account_id}): #{account.tags.map(&:tag_definition_name).join(', ')}"
account.add_tag 'OVERDUE_ENFORCEMENT_OFF', AUDIT_USER
account.add_tag 'AUTO_PAY_OFF', AUDIT_USER
puts "New tags for #{account.name} (#{account.account_id}): #{account.tags.map(&:tag_definition_name).join(', ')}"
end
To run the integration tests:
rake test:remote:spec
You need to set in spec/spec_helper.rb the url of your instance, e.g. KillBillClient.url = 'http://127.0.0.1:8080'
and the username and password to authenticate the API, e.g. KillBillClient.username = 'admin'
and KillBillClient.password = 'password'