kaui 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +5 -29
  3. data/app/assets/javascripts/kaui/kaui.js +1 -1
  4. data/app/assets/stylesheets/kaui/account.less +9 -1
  5. data/app/assets/stylesheets/kaui/common.less +46 -3
  6. data/app/controllers/kaui/accounts_controller.rb +11 -15
  7. data/app/controllers/kaui/admin_tenants_controller.rb +77 -106
  8. data/app/controllers/kaui/audit_logs_controller.rb +3 -3
  9. data/app/controllers/kaui/bundles_controller.rb +4 -0
  10. data/app/controllers/kaui/engine_controller_util.rb +25 -17
  11. data/app/controllers/kaui/invoice_tags_controller.rb +28 -0
  12. data/app/controllers/kaui/invoices_controller.rb +65 -14
  13. data/app/controllers/kaui/payment_methods_controller.rb +14 -3
  14. data/app/controllers/kaui/sessions_controller.rb +6 -0
  15. data/app/controllers/kaui/subscriptions_controller.rb +13 -4
  16. data/app/helpers/kaui/account_helper.rb +10 -2
  17. data/app/helpers/kaui/payment_method_helper.rb +5 -3
  18. data/app/helpers/kaui/plugin_helper.rb +10 -49
  19. data/app/helpers/kaui/subscription_helper.rb +26 -9
  20. data/app/helpers/kaui/uuid_helper.rb +1 -0
  21. data/app/models/kaui/admin_tenant.rb +8 -84
  22. data/app/models/kaui/catalog.rb +28 -2
  23. data/app/models/kaui/tag.rb +1 -1
  24. data/app/views/kaui/account_emails/_form.html.erb +1 -1
  25. data/app/views/kaui/accounts/_billing_info.html.erb +4 -0
  26. data/app/views/kaui/accounts/_form.html.erb +1 -1
  27. data/app/views/kaui/accounts/_payment_methods.html.erb +3 -0
  28. data/app/views/kaui/accounts/index.html.erb +7 -4
  29. data/app/views/kaui/admin_tenants/_form_plugin_config.erb +59 -241
  30. data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +2 -2
  31. data/app/views/kaui/admin_tenants/new_catalog.html.erb +16 -15
  32. data/app/views/kaui/bundles/_bundle_details.html.erb +12 -0
  33. data/app/views/kaui/bundles/index.html.erb +3 -14
  34. data/app/views/kaui/chargebacks/_form.html.erb +1 -1
  35. data/app/views/kaui/charges/_form.html.erb +1 -1
  36. data/app/views/kaui/invoice_tags/_form.html.erb +33 -0
  37. data/app/views/kaui/invoice_tags/_form_bar.html.erb +21 -0
  38. data/app/views/kaui/invoice_tags/edit.html.erb +10 -0
  39. data/app/views/kaui/invoices/_invoice_table.html.erb +30 -9
  40. data/app/views/kaui/invoices/index.html.erb +6 -4
  41. data/app/views/kaui/invoices/show.html.erb +11 -2
  42. data/app/views/kaui/layouts/kaui_flash.html.erb +8 -1
  43. data/app/views/kaui/payments/_form.html.erb +1 -1
  44. data/app/views/kaui/payments/_payment_table.html.erb +2 -2
  45. data/app/views/kaui/payments/index.html.erb +3 -1
  46. data/app/views/kaui/subscriptions/_edit_form.html.erb +1 -1
  47. data/app/views/kaui/subscriptions/_form.html.erb +1 -1
  48. data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +3 -3
  49. data/config/routes.rb +6 -1
  50. data/lib/kaui.rb +55 -0
  51. data/lib/kaui/version.rb +1 -1
  52. data/test/dummy/config/database.yml +2 -2
  53. data/test/dummy/config/initializers/cookies_serializer.rb +1 -1
  54. data/test/dummy/config/initializers/money.rb +2 -0
  55. data/test/functional/kaui/account_emails_controller_test.rb +2 -2
  56. data/test/functional/kaui/account_tags_controller_test.rb +1 -1
  57. data/test/functional/kaui/accounts_controller_test.rb +4 -4
  58. data/test/functional/kaui/admin_tenants_controller_test.rb +3 -23
  59. data/test/functional/kaui/bundle_tags_controller_test.rb +1 -1
  60. data/test/functional/kaui/bundles_controller_test.rb +3 -3
  61. data/test/functional/kaui/chargebacks_controller_test.rb +2 -2
  62. data/test/functional/kaui/charges_controller_test.rb +2 -2
  63. data/test/functional/kaui/credits_controller_test.rb +5 -5
  64. data/test/functional/kaui/home_controller_test.rb +5 -5
  65. data/test/functional/kaui/invoice_items_controller_test.rb +3 -3
  66. data/test/functional/kaui/invoices_controller_test.rb +2 -2
  67. data/test/functional/kaui/refunds_controller_test.rb +2 -2
  68. data/test/functional/kaui/subscriptions_controller_test.rb +6 -6
  69. data/test/killbill_test_helper.rb +8 -6
  70. data/test/unit/helpers/kaui/payment_method_helper_test.rb +17 -0
  71. data/test/unit/kaui/account_test.rb +2 -2
  72. data/test/unit/kaui/admin_tenant_test.rb +10 -47
  73. data/test/unit/kaui/invoice_item_test.rb +1 -1
  74. data/test/unit/kaui/invoice_payment_test.rb +7 -7
  75. data/test/unit/kaui/invoice_test.rb +4 -4
  76. data/test/unit/kaui/payment_test.rb +7 -7
  77. metadata +110 -86
@@ -6,12 +6,12 @@ class Kaui::RefundsControllerTest < Kaui::FunctionalTestHelper
6
6
  invoice_id = SecureRandom.uuid.to_s
7
7
  get :new, :account_id => @account.account_id, :invoice_id => invoice_id, :payment_id => @payment.payment_id
8
8
  assert_redirected_to account_path(@account.account_id)
9
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
9
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
10
10
 
11
11
  payment_id = SecureRandom.uuid.to_s
12
12
  get :new, :account_id => @account.account_id, :invoice_id => @paid_invoice_item.invoice_id, :payment_id => payment_id
13
13
  assert_redirected_to account_path(@account.account_id)
14
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error]
14
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error]
15
15
  end
16
16
 
17
17
  test 'should get new' do
@@ -6,7 +6,7 @@ class Kaui::SubscriptionsControllerTest < Kaui::FunctionalTestHelper
6
6
  bundle_id = SecureRandom.uuid.to_s
7
7
  get :new, :bundle_id => bundle_id, :account_id => @account.account_id, :product_category => 'ADD_ON'
8
8
  assert_redirected_to account_path(@account.account_id)
9
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{bundle_id} type=BUNDLE doesn't exist!", flash[:error]
9
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{bundle_id} type=BUNDLE doesn't exist!", flash[:error]
10
10
  end
11
11
 
12
12
  test 'should get new page for base plan' do
@@ -74,7 +74,7 @@ class Kaui::SubscriptionsControllerTest < Kaui::FunctionalTestHelper
74
74
  subscription_id = SecureRandom.uuid.to_s
75
75
  get :edit, :id => subscription_id
76
76
  assert_redirected_to home_path
77
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
77
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
78
78
  end
79
79
 
80
80
  test 'should get edit page' do
@@ -92,11 +92,11 @@ class Kaui::SubscriptionsControllerTest < Kaui::FunctionalTestHelper
92
92
  subscription_id = SecureRandom.uuid.to_s
93
93
  post :update, :id => subscription_id, :plan_name => 'super-monthly'
94
94
  assert_redirected_to edit_subscription_path(subscription_id)
95
- assert_equal "Error while changing subscription: Error 404: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
95
+ assert_equal "Error while changing subscription: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
96
96
 
97
97
  post :update, :id => @bundle.subscriptions.first.subscription_id, :plan_name => 'not-exists'
98
98
  assert_redirected_to edit_subscription_path(@bundle.subscriptions.first.subscription_id)
99
- assert_equal "Error while changing subscription: Error 400: Could not find a plan matching spec: (plan: 'not-exists', product: 'undefined', billing period: 'undefined', pricelist 'undefined')", flash[:error]
99
+ assert_equal "Error while changing subscription: Could not find any plans named 'not-exists'", flash[:error]
100
100
  end
101
101
 
102
102
  test 'should update' do
@@ -110,14 +110,14 @@ class Kaui::SubscriptionsControllerTest < Kaui::FunctionalTestHelper
110
110
  subscription_id = SecureRandom.uuid.to_s
111
111
  delete :destroy, :id => subscription_id, :plan_name => 'super-monthly'
112
112
  assert_redirected_to home_path
113
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
113
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
114
114
  end
115
115
 
116
116
  test 'should handle errors during reinstate' do
117
117
  subscription_id = SecureRandom.uuid.to_s
118
118
  put :reinstate, :id => subscription_id
119
119
  assert_redirected_to home_path
120
- assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
120
+ assert_equal "Error while communicating with the Kill Bill server: Object id=#{subscription_id} type=SUBSCRIPTION doesn't exist!", flash[:error]
121
121
  end
122
122
 
123
123
  test 'should cancel and reinstate subscription' do
@@ -28,7 +28,7 @@ module Kaui
28
28
  @bundle = create_bundle(@account, @tenant)
29
29
  @invoice_item = create_charge(@account, @tenant)
30
30
  @paid_invoice_item = create_charge(@account, @tenant, true)
31
- @bundle_invoice = @account.invoices(true, build_options(@tenant)).first
31
+ @bundle_invoice = @account.invoices(build_options(@tenant)).first
32
32
  @payment_method = create_payment_method(true, @account, @tenant)
33
33
  @payment = create_payment(@paid_invoice_item, @account, @tenant)
34
34
 
@@ -159,15 +159,15 @@ module Kaui
159
159
  tenant = create_tenant(user, reason, comment) if tenant.nil?
160
160
  account = create_account(tenant, username, password, user, reason, comment) if account.nil?
161
161
 
162
- credit = KillBillClient::Model::Credit.new(:invoice_id => invoice_id, :account_id => account.account_id, :credit_amount => 23.22)
163
- credit = credit.create(true, user, reason, comment, build_options(tenant, username, password))
162
+ credit = KillBillClient::Model::Credit.new(:invoice_id => invoice_id, :account_id => account.account_id, :amount => 23.22)
163
+ credit = credit.create(true, user, reason, comment, build_options(tenant, username, password)).first
164
164
 
165
- invoice = KillBillClient::Model::Invoice.find_by_id(credit.invoice_id, true, 'NONE', build_options(tenant, username, password))
166
- invoice.items.find { |ii| ii.amount == -credit.credit_amount }
165
+ invoice = KillBillClient::Model::Invoice.find_by_id(credit.invoice_id, 'NONE', build_options(tenant, username, password))
166
+ invoice.items.find { |ii| ii.amount == -credit.amount }
167
167
  end
168
168
 
169
169
  def commit_invoice(invoice_id, tenant, username = USERNAME, password = PASSWORD, user = 'Kaui test', reason = nil, comment = nil)
170
- invoice = KillBillClient::Model::Invoice.find_by_id(invoice_id, false, 'NONE', build_options(tenant, username, password))
170
+ invoice = KillBillClient::Model::Invoice.find_by_id(invoice_id, 'NONE', build_options(tenant, username, password))
171
171
  invoice.commit(user, reason, comment, build_options(tenant, username, password))
172
172
  end
173
173
 
@@ -176,6 +176,8 @@ module Kaui
176
176
  account = create_account(tenant, username, password, user, reason, comment) if account.nil?
177
177
  invoice_item = create_charge(account, tenant, true, username, password, user, reason, comment) if invoice_item.nil?
178
178
 
179
+ assert_not_nil invoice_item
180
+
179
181
  payment = Kaui::InvoicePayment.new({:account_id => account.account_id, :target_invoice_id => invoice_item.invoice_id, :purchased_amount => invoice_item.amount})
180
182
  payment.create(true, user, reason, comment, build_options(tenant, username, password))
181
183
  end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ class PaymentMethodHelperTest < ActionView::TestCase
4
+
5
+ include Kaui::PaymentMethodHelper
6
+
7
+ test 'is_json?' do
8
+ assert !is_json?(5)
9
+ assert !is_json?('true')
10
+ assert !is_json?(false)
11
+ assert !is_json?("")
12
+ assert !is_json?(nil)
13
+ assert is_json?('[1, 2, 3]')
14
+ assert is_json?('{"value": "New", "onclick": "CreateNewDoc()"}')
15
+ assert !is_json?('{"value" => "New", "onclick": "CreateNewDoc()"}')
16
+ end
17
+ end
@@ -6,9 +6,9 @@ class Kaui::AccountTest < ActiveSupport::TestCase
6
6
  account = Kaui::Account.new(:account_balance => 12.42, :account_cba => 54.32, :currency => 'USD')
7
7
 
8
8
  assert_equal 1242, account.balance_to_money.cents
9
- assert_equal 'USD', account.balance_to_money.currency_as_string
9
+ assert_equal 'USD', account.balance_to_money.currency.to_s
10
10
 
11
11
  assert_equal 5432, account.cba_to_money.cents
12
- assert_equal 'USD', account.cba_to_money.currency_as_string
12
+ assert_equal 'USD', account.cba_to_money.currency.to_s
13
13
  end
14
14
  end
@@ -62,40 +62,6 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
62
62
  assert_split(splitted)
63
63
  end
64
64
 
65
- test 'can do a fuzzy match of a plugin to suggest a plugin' do
66
- plugins_info = plugins_repo
67
- adminTenantController = Kaui::AdminTenantsController.new
68
-
69
- %w(killbill-paypal express paypal pay).each do |plugin_name|
70
- found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
71
- assert_nil(found_plugin)
72
- assert_equal weights[0][:plugin_name], 'killbill-paypal-express'
73
- end
74
-
75
- plugin_name = 'email'
76
- found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
77
- assert_nil(found_plugin)
78
- assert_equal weights[0][:plugin_name], 'killbill-email-notifications'
79
-
80
- %w(first firstdata firstdata_e4).each do |plugin_name|
81
- found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
82
- assert_nil(found_plugin)
83
- assert_equal weights[0][:plugin_name], 'killbill-firstdata-e4'
84
- end
85
-
86
- %w(braintree brain).each do |plugin_name|
87
- found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
88
- assert_nil(found_plugin)
89
- assert_equal weights[0][:plugin_name], 'killbill-braintree_blue'
90
- end
91
-
92
- # if found weights should be empty
93
- plugin_name = 'avatax'
94
- found_plugin, weights = adminTenantController.send(:fuzzy_match, plugin_name, plugins_info)
95
- assert_equal weights.size, 0
96
- assert_equal found_plugin[:plugin_name], 'killbill-avatax'
97
- end
98
-
99
65
  test 'should fetch proprietary plugin config' do
100
66
  tenant = create_tenant()
101
67
  assert_not_nil(tenant)
@@ -106,12 +72,11 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
106
72
  plugin_config = 'key=value'
107
73
  Kaui::AdminTenant.upload_tenant_plugin_config(plugin_name, plugin_config, options[:username], nil, nil, options)
108
74
 
109
- plugins_config = Kaui::AdminTenant.get_tenant_plugin_config({}, options)
75
+ plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(options)
110
76
  assert_not_nil(plugins_config)
111
77
 
112
- plugin_info = plugins_config.split('::')
113
- assert_equal plugin_name, plugin_info[0]
114
- assert_equal 'key=value|_raw=key=value', plugin_info[1].gsub('raw_config=','')
78
+ assert_equal plugin_name, plugins_config.keys.first
79
+ assert_equal 'key=value', plugins_config[plugin_name]
115
80
  end
116
81
 
117
82
  test 'should fetch plugin config' do
@@ -130,15 +95,13 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
130
95
  plugin_config = Kaui::AdminTenant.format_plugin_config(plugin_key, 'ruby', plugin_properties)
131
96
  Kaui::AdminTenant.upload_tenant_plugin_config(plugin_name, plugin_config, options[:username], nil, nil, options)
132
97
 
133
- plugins_config = Kaui::AdminTenant.get_tenant_plugin_config({ :paypal_express => { 'type' => 'ruby',
134
- 'artifact_id' => 'paypal-express-plugin'} }, options)
98
+ plugins_config = Kaui::AdminTenant.get_tenant_plugin_config(options)
135
99
  assert_not_nil(plugins_config)
136
- plugin_info = plugins_config.split('::')
137
- assert_equal plugin_key, plugin_info[0]
138
- response_plugin_properties = plugin_info[1].split('|')
139
- assert_equal plugin_properties[:signature], response_plugin_properties[0].split('=')[1]
140
- assert_equal plugin_properties[:login], response_plugin_properties[1].split('=')[1]
141
- assert_equal plugin_properties[:password], response_plugin_properties[2].split('=')[1]
100
+ assert_equal plugin_name, plugins_config.keys.first
101
+ response_plugin_properties = plugins_config[plugin_name].split
102
+ assert_equal plugin_properties[:signature], response_plugin_properties[3]
103
+ assert_equal plugin_properties[:login], response_plugin_properties[5]
104
+ assert_equal plugin_properties[:password], response_plugin_properties[7]
142
105
  end
143
106
 
144
107
  private
@@ -166,4 +129,4 @@ class Kaui::AdminTenantTest < ActiveSupport::TestCase
166
129
  assert_equal 'to', splitted[4]
167
130
  assert_equal 'split', splitted[5]
168
131
  end
169
- end
132
+ end
@@ -6,6 +6,6 @@ class Kaui::InvoiceItemTest < ActiveSupport::TestCase
6
6
  invoice_item = Kaui::InvoiceItem.new(:amount => 12.42, :currency => 'USD')
7
7
 
8
8
  assert_equal 1242, invoice_item.amount_to_money.cents
9
- assert_equal 'USD', invoice_item.amount_to_money.currency_as_string
9
+ assert_equal 'USD', invoice_item.amount_to_money.currency.to_s
10
10
  end
11
11
  end
@@ -11,25 +11,25 @@ class Kaui::InvoicePaymentTest < ActiveSupport::TestCase
11
11
  :currency => 'USD')
12
12
 
13
13
  assert_equal 1242, payment.auth_amount_to_money.cents
14
- assert_equal 'USD', payment.auth_amount_to_money.currency_as_string
14
+ assert_equal 'USD', payment.auth_amount_to_money.currency.to_s
15
15
 
16
16
  assert_equal 1020, payment.captured_amount_to_money.cents
17
- assert_equal 'USD', payment.captured_amount_to_money.currency_as_string
17
+ assert_equal 'USD', payment.captured_amount_to_money.currency.to_s
18
18
 
19
19
  assert_equal 1200, payment.purchased_amount_to_money.cents
20
- assert_equal 'USD', payment.purchased_amount_to_money.currency_as_string
20
+ assert_equal 'USD', payment.purchased_amount_to_money.currency.to_s
21
21
 
22
22
  assert_equal 900, payment.refunded_amount_to_money.cents
23
- assert_equal 'USD', payment.refunded_amount_to_money.currency_as_string
23
+ assert_equal 'USD', payment.refunded_amount_to_money.currency.to_s
24
24
 
25
25
  assert_equal 500, payment.credited_amount_to_money.cents
26
- assert_equal 'USD', payment.credited_amount_to_money.currency_as_string
26
+ assert_equal 'USD', payment.credited_amount_to_money.currency.to_s
27
27
 
28
28
  assert_equal 2220, payment.paid_amount_to_money.cents
29
- assert_equal 'USD', payment.paid_amount_to_money.currency_as_string
29
+ assert_equal 'USD', payment.paid_amount_to_money.currency.to_s
30
30
 
31
31
  assert_equal 1400, payment.returned_amount_to_money.cents
32
- assert_equal 'USD', payment.returned_amount_to_money.currency_as_string
32
+ assert_equal 'USD', payment.returned_amount_to_money.currency.to_s
33
33
  end
34
34
 
35
35
  test 'can check for full refunds' do
@@ -6,15 +6,15 @@ class Kaui::InvoiceTest < ActiveSupport::TestCase
6
6
  invoice = Kaui::Invoice.new(:amount => 12.42, :balance => 54.32, :refund_adj => 48, :credit_adj => 1.2, :currency => 'USD')
7
7
 
8
8
  assert_equal 1242, invoice.amount_to_money.cents
9
- assert_equal 'USD', invoice.amount_to_money.currency_as_string
9
+ assert_equal 'USD', invoice.amount_to_money.currency.to_s
10
10
 
11
11
  assert_equal 5432, invoice.balance_to_money.cents
12
- assert_equal 'USD', invoice.balance_to_money.currency_as_string
12
+ assert_equal 'USD', invoice.balance_to_money.currency.to_s
13
13
 
14
14
  assert_equal 4800, invoice.refund_adjustment_to_money.cents
15
- assert_equal 'USD', invoice.refund_adjustment_to_money.currency_as_string
15
+ assert_equal 'USD', invoice.refund_adjustment_to_money.currency.to_s
16
16
 
17
17
  assert_equal 120, invoice.credit_adjustment_to_money.cents
18
- assert_equal 'USD', invoice.credit_adjustment_to_money.currency_as_string
18
+ assert_equal 'USD', invoice.credit_adjustment_to_money.currency.to_s
19
19
  end
20
20
  end
@@ -11,25 +11,25 @@ class Kaui::PaymentTest < ActiveSupport::TestCase
11
11
  :currency => 'USD')
12
12
 
13
13
  assert_equal 1242, payment.auth_amount_to_money.cents
14
- assert_equal 'USD', payment.auth_amount_to_money.currency_as_string
14
+ assert_equal 'USD', payment.auth_amount_to_money.currency.to_s
15
15
 
16
16
  assert_equal 1020, payment.captured_amount_to_money.cents
17
- assert_equal 'USD', payment.captured_amount_to_money.currency_as_string
17
+ assert_equal 'USD', payment.captured_amount_to_money.currency.to_s
18
18
 
19
19
  assert_equal 1200, payment.purchased_amount_to_money.cents
20
- assert_equal 'USD', payment.purchased_amount_to_money.currency_as_string
20
+ assert_equal 'USD', payment.purchased_amount_to_money.currency.to_s
21
21
 
22
22
  assert_equal 900, payment.refunded_amount_to_money.cents
23
- assert_equal 'USD', payment.refunded_amount_to_money.currency_as_string
23
+ assert_equal 'USD', payment.refunded_amount_to_money.currency.to_s
24
24
 
25
25
  assert_equal 500, payment.credited_amount_to_money.cents
26
- assert_equal 'USD', payment.credited_amount_to_money.currency_as_string
26
+ assert_equal 'USD', payment.credited_amount_to_money.currency.to_s
27
27
 
28
28
  assert_equal 2220, payment.paid_amount_to_money.cents
29
- assert_equal 'USD', payment.paid_amount_to_money.currency_as_string
29
+ assert_equal 'USD', payment.paid_amount_to_money.currency.to_s
30
30
 
31
31
  assert_equal 1400, payment.returned_amount_to_money.cents
32
- assert_equal 'USD', payment.returned_amount_to_money.currency_as_string
32
+ assert_equal 'USD', payment.returned_amount_to_money.currency.to_s
33
33
  end
34
34
 
35
35
  test 'can check for full refunds' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-21 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.0'
131
+ version: '3.2'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '3.0'
138
+ version: '3.2'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: devise
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '1.0'
201
+ version: '2.0'
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '1.0'
208
+ version: '2.0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: jquery-ui-rails
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -402,6 +402,20 @@ dependencies:
402
402
  - - ">="
403
403
  - !ruby/object:Gem::Version
404
404
  version: '0'
405
+ - !ruby/object:Gem::Dependency
406
+ name: gem-release
407
+ requirement: !ruby/object:Gem::Requirement
408
+ requirements:
409
+ - - "~>"
410
+ - !ruby/object:Gem::Version
411
+ version: '2.2'
412
+ type: :development
413
+ prerelease: false
414
+ version_requirements: !ruby/object:Gem::Requirement
415
+ requirements:
416
+ - - "~>"
417
+ - !ruby/object:Gem::Version
418
+ version: '2.2'
405
419
  - !ruby/object:Gem::Dependency
406
420
  name: byebug
407
421
  requirement: !ruby/object:Gem::Requirement
@@ -551,6 +565,7 @@ files:
551
565
  - app/controllers/kaui/engine_controller_util.rb
552
566
  - app/controllers/kaui/home_controller.rb
553
567
  - app/controllers/kaui/invoice_items_controller.rb
568
+ - app/controllers/kaui/invoice_tags_controller.rb
554
569
  - app/controllers/kaui/invoices_controller.rb
555
570
  - app/controllers/kaui/login_proxy_controller.rb
556
571
  - app/controllers/kaui/payment_methods_controller.rb
@@ -670,6 +685,7 @@ files:
670
685
  - app/views/kaui/bundle_tags/_form.html.erb
671
686
  - app/views/kaui/bundle_tags/_form_bar.html.erb
672
687
  - app/views/kaui/bundle_tags/edit.html.erb
688
+ - app/views/kaui/bundles/_bundle_details.html.erb
673
689
  - app/views/kaui/bundles/index.html.erb
674
690
  - app/views/kaui/bundles/pause_resume.html.erb
675
691
  - app/views/kaui/bundles/transfer.html.erb
@@ -687,6 +703,9 @@ files:
687
703
  - app/views/kaui/home/index.html.erb
688
704
  - app/views/kaui/invoice_items/_edit_form.html.erb
689
705
  - app/views/kaui/invoice_items/edit.html.erb
706
+ - app/views/kaui/invoice_tags/_form.html.erb
707
+ - app/views/kaui/invoice_tags/_form_bar.html.erb
708
+ - app/views/kaui/invoice_tags/edit.html.erb
690
709
  - app/views/kaui/invoices/_invoice_table.html.erb
691
710
  - app/views/kaui/invoices/index.html.erb
692
711
  - app/views/kaui/invoices/show.html.erb
@@ -783,6 +802,7 @@ files:
783
802
  - test/dummy/config/initializers/inflections.rb
784
803
  - test/dummy/config/initializers/killbill_client.rb
785
804
  - test/dummy/config/initializers/mime_types.rb
805
+ - test/dummy/config/initializers/money.rb
786
806
  - test/dummy/config/initializers/new_framework_defaults_5_1.rb
787
807
  - test/dummy/config/initializers/secret_token.rb
788
808
  - test/dummy/config/initializers/session_store.rb
@@ -844,6 +864,7 @@ files:
844
864
  - test/test_helper.rb
845
865
  - test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
846
866
  - test/unit/helpers/kaui/admin_tenants_helper_test.rb
867
+ - test/unit/helpers/kaui/payment_method_helper_test.rb
847
868
  - test/unit/helpers/kaui/tenants_helper_test.rb
848
869
  - test/unit/helpers/kaui/uuid_helper_test.rb
849
870
  - test/unit/kaui/account_email_test.rb
@@ -878,110 +899,113 @@ required_rubygems_version: !ruby/object:Gem::Requirement
878
899
  - !ruby/object:Gem::Version
879
900
  version: '0'
880
901
  requirements: []
881
- rubygems_version: 3.0.6
902
+ rubyforge_project:
903
+ rubygems_version: 2.6.13
882
904
  signing_key:
883
905
  specification_version: 4
884
906
  summary: Killbill Admin UI mountable engine
885
907
  test_files:
886
- - test/fixtures/catalog-v1.xml
887
- - test/fixtures/invoice_translation_fr-v1.properties
908
+ - test/test_helper.rb
909
+ - test/killbill_test_helper.rb
910
+ - test/integration/kaui/date_helper_integration_test.rb
911
+ - test/integration/kaui/integration_test_helper.rb
912
+ - test/integration/kaui/navigation_test.rb
913
+ - test/fixtures/stripe.yml
888
914
  - test/fixtures/catalog_translation_fr-v1.properties
889
915
  - test/fixtures/invoice_template-v1.html
916
+ - test/fixtures/invoice_translation_fr-v1.properties
917
+ - test/fixtures/catalog-v1.xml
890
918
  - test/fixtures/overdue-v1.xml
891
- - test/fixtures/stripe.yml
892
919
  - test/fixtures/SpyCarAdvanced.xml
893
- - test/unit/kaui/admin_tenant_test.rb
894
- - test/unit/kaui/payment_test.rb
895
- - test/unit/kaui/base_test.rb
896
- - test/unit/kaui/invoice_test.rb
897
- - test/unit/kaui/allowed_user_test.rb
898
- - test/unit/kaui/invoice_payment_test.rb
899
- - test/unit/kaui/account_test.rb
900
- - test/unit/kaui/invoice_item_test.rb
901
- - test/unit/kaui/tag_definition_test.rb
902
- - test/unit/kaui/account_email_test.rb
903
- - test/unit/kaui/date_helper_test.rb
904
- - test/unit/kaui/tenant_test.rb
905
- - test/unit/kaui/money_helper_test.rb
906
- - test/unit/helpers/kaui/tenants_helper_test.rb
907
- - test/unit/helpers/kaui/admin_tenants_helper_test.rb
908
- - test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
909
- - test/unit/helpers/kaui/uuid_helper_test.rb
910
- - test/test_helper.rb
911
- - test/integration/kaui/integration_test_helper.rb
912
- - test/integration/kaui/navigation_test.rb
913
- - test/integration/kaui/date_helper_integration_test.rb
914
- - test/dummy/public/404.html
915
- - test/dummy/public/422.html
916
- - test/dummy/public/500.html
917
- - test/dummy/public/favicon.ico
918
- - test/dummy/config/secrets.yml
919
- - test/dummy/config/locales/en.yml
920
- - test/dummy/config/environment.rb
921
- - test/dummy/config/routes.rb
920
+ - test/dummy/db/schema.rb
921
+ - test/dummy/script/rails
922
+ - test/dummy/config.ru
923
+ - test/dummy/bin/yarn
924
+ - test/dummy/bin/update
925
+ - test/dummy/bin/rake
926
+ - test/dummy/bin/setup
927
+ - test/dummy/bin/bundle
928
+ - test/dummy/bin/rails
922
929
  - test/dummy/config/symmetric-encryption.yml
923
- - test/dummy/config/environments/test.rb
924
- - test/dummy/config/environments/production.rb
925
- - test/dummy/config/environments/development.rb
926
- - test/dummy/config/database.yml
927
- - test/dummy/config/initializers/new_framework_defaults_5_1.rb
928
- - test/dummy/config/initializers/inflections.rb
929
- - test/dummy/config/initializers/assets.rb
930
- - test/dummy/config/initializers/backtrace_silencers.rb
931
- - test/dummy/config/initializers/killbill_client.rb
932
- - test/dummy/config/initializers/filter_parameter_logging.rb
930
+ - test/dummy/config/routes.rb
931
+ - test/dummy/config/boot.rb
933
932
  - test/dummy/config/initializers/mime_types.rb
934
933
  - test/dummy/config/initializers/application_controller_renderer.rb
935
- - test/dummy/config/initializers/secret_token.rb
936
- - test/dummy/config/initializers/cookies_serializer.rb
934
+ - test/dummy/config/initializers/killbill_client.rb
935
+ - test/dummy/config/initializers/assets.rb
937
936
  - test/dummy/config/initializers/session_store.rb
938
937
  - test/dummy/config/initializers/wrap_parameters.rb
939
- - test/dummy/config/boot.rb
938
+ - test/dummy/config/initializers/secret_token.rb
939
+ - test/dummy/config/initializers/filter_parameter_logging.rb
940
+ - test/dummy/config/initializers/cookies_serializer.rb
941
+ - test/dummy/config/initializers/new_framework_defaults_5_1.rb
942
+ - test/dummy/config/initializers/money.rb
943
+ - test/dummy/config/initializers/backtrace_silencers.rb
944
+ - test/dummy/config/initializers/inflections.rb
945
+ - test/dummy/config/locales/en.yml
946
+ - test/dummy/config/secrets.yml
947
+ - test/dummy/config/environment.rb
948
+ - test/dummy/config/environments/production.rb
949
+ - test/dummy/config/environments/development.rb
950
+ - test/dummy/config/environments/test.rb
951
+ - test/dummy/config/database.yml
940
952
  - test/dummy/config/application.rb
941
- - test/dummy/Rakefile
942
- - test/dummy/script/rails
943
953
  - test/dummy/README.rdoc
954
+ - test/dummy/Rakefile
955
+ - test/dummy/public/favicon.ico
956
+ - test/dummy/public/404.html
957
+ - test/dummy/public/422.html
958
+ - test/dummy/public/500.html
944
959
  - test/dummy/app/controllers/application_controller.rb
945
960
  - test/dummy/app/helpers/application_helper.rb
946
- - test/dummy/config.ru
947
- - test/dummy/bin/rake
948
- - test/dummy/bin/bundle
949
- - test/dummy/bin/update
950
- - test/dummy/bin/setup
951
- - test/dummy/bin/yarn
952
- - test/dummy/bin/rails
953
- - test/dummy/db/schema.rb
954
- - test/killbill_test_helper.rb
955
- - test/functional/kaui/transactions_controller_test.rb
956
- - test/functional/kaui/admin_tenants_controller_test.rb
957
- - test/functional/kaui/credits_controller_test.rb
958
- - test/functional/kaui/home_controller_test.rb
959
- - test/functional/kaui/tag_definitions_controller_test.rb
960
- - test/functional/kaui/account_children_controller_test.rb
961
- - test/functional/kaui/account_timelines_controller_test.rb
962
961
  - test/functional/kaui/custom_fields_controller_test.rb
963
- - test/functional/kaui/charges_controller_test.rb
964
- - test/functional/kaui/account_emails_controller_test.rb
965
- - test/functional/kaui/queues_controller_test.rb
962
+ - test/functional/kaui/payments_controller_test.rb
966
963
  - test/functional/kaui/admin_controller_test.rb
967
964
  - test/functional/kaui/accounts_controller_test.rb
968
- - test/functional/kaui/subscriptions_controller_test.rb
969
- - test/functional/kaui/chargebacks_controller_test.rb
970
- - test/functional/kaui/payments_controller_test.rb
971
- - test/functional/kaui/bundles_controller_test.rb
972
- - test/functional/kaui/tags_controller_test.rb
965
+ - test/functional/kaui/admin_tenants_controller_test.rb
966
+ - test/functional/kaui/account_children_controller_test.rb
967
+ - test/functional/kaui/transactions_controller_test.rb
968
+ - test/functional/kaui/tag_definitions_controller_test.rb
969
+ - test/functional/kaui/functional_test_helper.rb
970
+ - test/functional/kaui/admin_allowed_users_controller_test.rb
973
971
  - test/functional/kaui/account_tags_controller_test.rb
974
- - test/functional/kaui/functional_test_helper_nosetup.rb
975
972
  - test/functional/kaui/account_custom_fields_controller_test.rb
976
- - test/functional/kaui/invoice_items_controller_test.rb
977
- - test/functional/kaui/admin_allowed_users_controller_test.rb
978
- - test/functional/kaui/refunds_controller_test.rb
973
+ - test/functional/kaui/account_timelines_controller_test.rb
974
+ - test/functional/kaui/bundles_controller_test.rb
975
+ - test/functional/kaui/functional_test_helper_nosetup.rb
979
976
  - test/functional/kaui/audit_logs_controller_test.rb
980
977
  - test/functional/kaui/registrations_controller_test.rb
981
- - test/functional/kaui/invoices_controller_test.rb
978
+ - test/functional/kaui/credits_controller_test.rb
979
+ - test/functional/kaui/tags_controller_test.rb
980
+ - test/functional/kaui/tenants_controller_test.rb
981
+ - test/functional/kaui/refunds_controller_test.rb
982
982
  - test/functional/kaui/role_definitions_controller_test.rb
983
+ - test/functional/kaui/invoices_controller_test.rb
984
+ - test/functional/kaui/invoice_items_controller_test.rb
985
+ - test/functional/kaui/login_proxy_controller_test.rb
986
+ - test/functional/kaui/subscriptions_controller_test.rb
983
987
  - test/functional/kaui/payment_methods_controller_test.rb
988
+ - test/functional/kaui/home_controller_test.rb
989
+ - test/functional/kaui/queues_controller_test.rb
990
+ - test/functional/kaui/chargebacks_controller_test.rb
991
+ - test/functional/kaui/charges_controller_test.rb
984
992
  - test/functional/kaui/bundle_tags_controller_test.rb
985
- - test/functional/kaui/login_proxy_controller_test.rb
986
- - test/functional/kaui/tenants_controller_test.rb
987
- - test/functional/kaui/functional_test_helper.rb
993
+ - test/functional/kaui/account_emails_controller_test.rb
994
+ - test/unit/kaui/admin_tenant_test.rb
995
+ - test/unit/kaui/money_helper_test.rb
996
+ - test/unit/kaui/invoice_test.rb
997
+ - test/unit/kaui/allowed_user_test.rb
998
+ - test/unit/kaui/base_test.rb
999
+ - test/unit/kaui/payment_test.rb
1000
+ - test/unit/kaui/account_email_test.rb
1001
+ - test/unit/kaui/account_test.rb
1002
+ - test/unit/kaui/date_helper_test.rb
1003
+ - test/unit/kaui/tag_definition_test.rb
1004
+ - test/unit/kaui/invoice_payment_test.rb
1005
+ - test/unit/kaui/invoice_item_test.rb
1006
+ - test/unit/kaui/tenant_test.rb
1007
+ - test/unit/helpers/kaui/payment_method_helper_test.rb
1008
+ - test/unit/helpers/kaui/uuid_helper_test.rb
1009
+ - test/unit/helpers/kaui/tenants_helper_test.rb
1010
+ - test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
1011
+ - test/unit/helpers/kaui/admin_tenants_helper_test.rb