kaui 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -16
- data/app/assets/stylesheets/kaui/account.less +9 -1
- data/app/assets/stylesheets/kaui/common.less +2 -2
- data/app/controllers/kaui/accounts_controller.rb +11 -15
- data/app/controllers/kaui/audit_logs_controller.rb +2 -2
- data/app/controllers/kaui/engine_controller_util.rb +24 -17
- data/app/controllers/kaui/invoice_tags_controller.rb +28 -0
- data/app/controllers/kaui/invoices_controller.rb +45 -14
- data/app/controllers/kaui/payment_methods_controller.rb +5 -0
- data/app/helpers/kaui/account_helper.rb +10 -2
- data/app/helpers/kaui/plugin_helper.rb +1 -1
- data/app/helpers/kaui/uuid_helper.rb +1 -0
- data/app/models/kaui/tag.rb +1 -1
- data/app/views/kaui/accounts/_billing_info.html.erb +4 -0
- data/app/views/kaui/accounts/_payment_methods.html.erb +3 -0
- data/app/views/kaui/accounts/index.html.erb +7 -4
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +13 -3
- data/app/views/kaui/bundles/_bundle_details.html.erb +12 -0
- data/app/views/kaui/bundles/index.html.erb +2 -13
- data/app/views/kaui/invoice_tags/_form.html.erb +33 -0
- data/app/views/kaui/invoice_tags/_form_bar.html.erb +21 -0
- data/app/views/kaui/invoice_tags/edit.html.erb +10 -0
- data/app/views/kaui/invoices/_invoice_table.html.erb +28 -7
- data/app/views/kaui/invoices/index.html.erb +6 -4
- data/app/views/kaui/invoices/show.html.erb +10 -1
- data/app/views/kaui/layouts/kaui_flash.html.erb +8 -1
- data/app/views/kaui/payments/index.html.erb +3 -1
- data/config/routes.rb +6 -0
- data/lib/kaui.rb +55 -0
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/config/initializers/money.rb +2 -0
- data/test/functional/kaui/account_emails_controller_test.rb +2 -2
- data/test/functional/kaui/account_tags_controller_test.rb +1 -1
- data/test/functional/kaui/accounts_controller_test.rb +4 -4
- data/test/functional/kaui/admin_tenants_controller_test.rb +1 -1
- data/test/functional/kaui/bundle_tags_controller_test.rb +1 -1
- data/test/functional/kaui/bundles_controller_test.rb +3 -3
- data/test/functional/kaui/chargebacks_controller_test.rb +2 -2
- data/test/functional/kaui/charges_controller_test.rb +2 -2
- data/test/functional/kaui/credits_controller_test.rb +2 -2
- data/test/functional/kaui/invoice_items_controller_test.rb +3 -3
- data/test/functional/kaui/invoices_controller_test.rb +2 -2
- data/test/functional/kaui/refunds_controller_test.rb +2 -2
- data/test/functional/kaui/subscriptions_controller_test.rb +6 -6
- data/test/killbill_test_helper.rb +2 -0
- data/test/unit/kaui/account_test.rb +2 -2
- data/test/unit/kaui/invoice_item_test.rb +1 -1
- data/test/unit/kaui/invoice_payment_test.rb +7 -7
- data/test/unit/kaui/invoice_test.rb +4 -4
- data/test/unit/kaui/payment_test.rb +7 -7
- metadata +83 -76
@@ -138,7 +138,7 @@ class Kaui::AdminTenantsControllerTest < Kaui::FunctionalTestHelper
|
|
138
138
|
:id => tenant.id,
|
139
139
|
:simple_plan => {
|
140
140
|
:product_category => 'STANDALONE',
|
141
|
-
:product_name => '
|
141
|
+
:product_name => 'Boat_Rental',
|
142
142
|
:plan_id => 'boat12345678910',
|
143
143
|
:amount => 10,
|
144
144
|
:currency => 'USD',
|
@@ -10,7 +10,7 @@ class Kaui::BundleTagsControllerTest < Kaui::FunctionalTestHelper
|
|
10
10
|
bundle_id = SecureRandom.uuid.to_s
|
11
11
|
get :edit, :account_id => @account.account_id, :bundle_id => bundle_id
|
12
12
|
assert_redirected_to account_path(@account.account_id)
|
13
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
13
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{bundle_id} type=BUNDLE doesn't exist!", flash[:error]
|
14
14
|
end
|
15
15
|
|
16
16
|
test 'should get edit' do
|
@@ -6,7 +6,7 @@ class Kaui::BundlesControllerTest < Kaui::FunctionalTestHelper
|
|
6
6
|
account_id = SecureRandom.uuid.to_s
|
7
7
|
get :index, :account_id => account_id
|
8
8
|
assert_redirected_to account_path(account_id)
|
9
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
9
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{account_id} type=ACCOUNT doesn't exist!", flash[:error]
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'should get index with existing tags' do
|
@@ -35,12 +35,12 @@ class Kaui::BundlesControllerTest < Kaui::FunctionalTestHelper
|
|
35
35
|
new_account_key = SecureRandom.uuid.to_s
|
36
36
|
post :do_transfer, :id => @bundle.bundle_id, :new_account_key => new_account_key
|
37
37
|
assert_redirected_to home_path
|
38
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
38
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{new_account_key} type=ACCOUNT doesn't exist!", flash[:error]
|
39
39
|
|
40
40
|
bundle_id = SecureRandom.uuid.to_s
|
41
41
|
post :do_transfer, :id => bundle_id, :new_account_key => @account2.external_key
|
42
42
|
assert_redirected_to home_path
|
43
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
43
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{bundle_id} type=BUNDLE doesn't exist!", flash[:error]
|
44
44
|
end
|
45
45
|
|
46
46
|
test 'should get transfer' do
|
@@ -6,7 +6,7 @@ class Kaui::ChargebacksControllerTest < Kaui::FunctionalTestHelper
|
|
6
6
|
payment_id = SecureRandom.uuid.to_s
|
7
7
|
get :new, :account_id => @account.account_id, :payment_id => payment_id
|
8
8
|
assert_redirected_to account_path(@account.account_id)
|
9
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
9
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error]
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'should get new' do
|
@@ -24,7 +24,7 @@ class Kaui::ChargebacksControllerTest < Kaui::FunctionalTestHelper
|
|
24
24
|
:currency => @payment.currency
|
25
25
|
}
|
26
26
|
assert_template :new
|
27
|
-
assert_equal "Error while creating a new chargeback:
|
27
|
+
assert_equal "Error while creating a new chargeback: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error]
|
28
28
|
end
|
29
29
|
|
30
30
|
test 'should create chargeback' do
|
@@ -6,7 +6,7 @@ class Kaui::ChargesControllerTest < Kaui::FunctionalTestHelper
|
|
6
6
|
invoice_id = SecureRandom.uuid.to_s
|
7
7
|
get :new, :account_id => @account.account_id, :invoice_id => invoice_id
|
8
8
|
assert_redirected_to account_path(@account.account_id)
|
9
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
9
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'should get new for new invoice' do
|
@@ -30,7 +30,7 @@ class Kaui::ChargesControllerTest < Kaui::FunctionalTestHelper
|
|
30
30
|
:description => SecureRandom.uuid
|
31
31
|
}
|
32
32
|
assert_redirected_to account_path(@account.account_id)
|
33
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
33
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
34
34
|
end
|
35
35
|
|
36
36
|
test 'should create charge' do
|
@@ -6,7 +6,7 @@ class Kaui::CreditsControllerTest < Kaui::FunctionalTestHelper
|
|
6
6
|
invoice_id = SecureRandom.uuid.to_s
|
7
7
|
get :new, :account_id => @account.account_id, :invoice_id => invoice_id
|
8
8
|
assert_redirected_to account_path(@account.account_id)
|
9
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
9
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'should get new for new invoice' do
|
@@ -28,7 +28,7 @@ class Kaui::CreditsControllerTest < Kaui::FunctionalTestHelper
|
|
28
28
|
:amount => 5.34
|
29
29
|
}
|
30
30
|
assert_redirected_to account_path(@account.account_id)
|
31
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
31
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
32
32
|
end
|
33
33
|
|
34
34
|
test 'should create credit' do
|
@@ -10,7 +10,7 @@ class Kaui::InvoiceItemsControllerTest < Kaui::FunctionalTestHelper
|
|
10
10
|
invoice_id = SecureRandom.uuid.to_s
|
11
11
|
get :edit, :account_id => @account.account_id, :id => @invoice_item.invoice_item_id, :invoice_id => invoice_id
|
12
12
|
assert_redirected_to account_path(@account.account_id)
|
13
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
13
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
14
14
|
|
15
15
|
invoice_item_id = SecureRandom.uuid.to_s
|
16
16
|
get :edit, :account_id => @account.account_id, :id => invoice_item_id, :invoice_id => @invoice_item.invoice_id
|
@@ -36,7 +36,7 @@ class Kaui::InvoiceItemsControllerTest < Kaui::FunctionalTestHelper
|
|
36
36
|
:currency => :USD
|
37
37
|
}
|
38
38
|
assert_template :edit
|
39
|
-
assert_equal "Error while adjusting invoice item:
|
39
|
+
assert_equal "Error while adjusting invoice item: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
40
40
|
end
|
41
41
|
|
42
42
|
test 'should adjust invoice item' do
|
@@ -68,7 +68,7 @@ class Kaui::InvoiceItemsControllerTest < Kaui::FunctionalTestHelper
|
|
68
68
|
:invoice_id => invoice_id,
|
69
69
|
:account_id => @account.account_id
|
70
70
|
assert_redirected_to account_path(@account.account_id)
|
71
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
71
|
+
assert_equal "Error while communicating with the Kill Bill server: No invoice could be found for id #{invoice_id}.", flash[:error]
|
72
72
|
end
|
73
73
|
|
74
74
|
test 'should delete CBA' do
|
@@ -23,7 +23,7 @@ class Kaui::InvoicesControllerTest < Kaui::FunctionalTestHelper
|
|
23
23
|
invoice_id = SecureRandom.uuid.to_s
|
24
24
|
get :show, :account_id => @invoice_item.account_id, :id => invoice_id
|
25
25
|
assert_redirected_to account_path(@invoice_item.account_id)
|
26
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
26
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
27
27
|
end
|
28
28
|
|
29
29
|
test 'should find unpaid invoice by id' do
|
@@ -65,7 +65,7 @@ class Kaui::InvoicesControllerTest < Kaui::FunctionalTestHelper
|
|
65
65
|
invoice_id = SecureRandom.uuid.to_s
|
66
66
|
get :show_html, :id => invoice_id
|
67
67
|
assert_redirected_to home_path
|
68
|
-
assert_equal "Error while communicating with the Kill Bill server:
|
68
|
+
assert_equal "Error while communicating with the Kill Bill server: Object id=#{invoice_id} type=INVOICE doesn't exist!", flash[:error]
|
69
69
|
end
|
70
70
|
|
71
71
|
test 'should expose restful endpoint' do
|
@@ -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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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
|
@@ -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
|
@@ -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.
|
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.
|
12
|
+
assert_equal 'USD', account.cba_to_money.currency.to_s
|
13
13
|
end
|
14
14
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
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: 2021-
|
11
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -565,6 +565,7 @@ files:
|
|
565
565
|
- app/controllers/kaui/engine_controller_util.rb
|
566
566
|
- app/controllers/kaui/home_controller.rb
|
567
567
|
- app/controllers/kaui/invoice_items_controller.rb
|
568
|
+
- app/controllers/kaui/invoice_tags_controller.rb
|
568
569
|
- app/controllers/kaui/invoices_controller.rb
|
569
570
|
- app/controllers/kaui/login_proxy_controller.rb
|
570
571
|
- app/controllers/kaui/payment_methods_controller.rb
|
@@ -684,6 +685,7 @@ files:
|
|
684
685
|
- app/views/kaui/bundle_tags/_form.html.erb
|
685
686
|
- app/views/kaui/bundle_tags/_form_bar.html.erb
|
686
687
|
- app/views/kaui/bundle_tags/edit.html.erb
|
688
|
+
- app/views/kaui/bundles/_bundle_details.html.erb
|
687
689
|
- app/views/kaui/bundles/index.html.erb
|
688
690
|
- app/views/kaui/bundles/pause_resume.html.erb
|
689
691
|
- app/views/kaui/bundles/transfer.html.erb
|
@@ -701,6 +703,9 @@ files:
|
|
701
703
|
- app/views/kaui/home/index.html.erb
|
702
704
|
- app/views/kaui/invoice_items/_edit_form.html.erb
|
703
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
|
704
709
|
- app/views/kaui/invoices/_invoice_table.html.erb
|
705
710
|
- app/views/kaui/invoices/index.html.erb
|
706
711
|
- app/views/kaui/invoices/show.html.erb
|
@@ -797,6 +802,7 @@ files:
|
|
797
802
|
- test/dummy/config/initializers/inflections.rb
|
798
803
|
- test/dummy/config/initializers/killbill_client.rb
|
799
804
|
- test/dummy/config/initializers/mime_types.rb
|
805
|
+
- test/dummy/config/initializers/money.rb
|
800
806
|
- test/dummy/config/initializers/new_framework_defaults_5_1.rb
|
801
807
|
- test/dummy/config/initializers/secret_token.rb
|
802
808
|
- test/dummy/config/initializers/session_store.rb
|
@@ -899,106 +905,107 @@ signing_key:
|
|
899
905
|
specification_version: 4
|
900
906
|
summary: Killbill Admin UI mountable engine
|
901
907
|
test_files:
|
902
|
-
- test/integration/kaui/integration_test_helper.rb
|
903
|
-
- test/integration/kaui/navigation_test.rb
|
904
|
-
- test/integration/kaui/date_helper_integration_test.rb
|
905
908
|
- test/test_helper.rb
|
906
909
|
- test/killbill_test_helper.rb
|
907
|
-
- test/
|
908
|
-
- test/
|
909
|
-
- test/
|
910
|
-
- test/
|
911
|
-
- test/
|
912
|
-
- test/
|
913
|
-
- test/
|
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
|
914
|
+
- test/fixtures/catalog_translation_fr-v1.properties
|
915
|
+
- test/fixtures/invoice_template-v1.html
|
916
|
+
- test/fixtures/invoice_translation_fr-v1.properties
|
917
|
+
- test/fixtures/catalog-v1.xml
|
918
|
+
- test/fixtures/overdue-v1.xml
|
919
|
+
- test/fixtures/SpyCarAdvanced.xml
|
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
|
929
|
+
- test/dummy/config/symmetric-encryption.yml
|
914
930
|
- test/dummy/config/routes.rb
|
915
|
-
- test/dummy/config/
|
916
|
-
- test/dummy/config/initializers/
|
931
|
+
- test/dummy/config/boot.rb
|
932
|
+
- test/dummy/config/initializers/mime_types.rb
|
933
|
+
- test/dummy/config/initializers/application_controller_renderer.rb
|
917
934
|
- test/dummy/config/initializers/killbill_client.rb
|
918
|
-
- test/dummy/config/initializers/session_store.rb
|
919
935
|
- test/dummy/config/initializers/assets.rb
|
936
|
+
- test/dummy/config/initializers/session_store.rb
|
920
937
|
- test/dummy/config/initializers/wrap_parameters.rb
|
938
|
+
- test/dummy/config/initializers/secret_token.rb
|
921
939
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
922
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
923
|
-
- test/dummy/config/initializers/new_framework_defaults_5_1.rb
|
924
|
-
- test/dummy/config/initializers/mime_types.rb
|
925
|
-
- test/dummy/config/initializers/application_controller_renderer.rb
|
926
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
|
927
947
|
- test/dummy/config/environment.rb
|
928
|
-
- test/dummy/config/environments/test.rb
|
929
|
-
- test/dummy/config/environments/development.rb
|
930
948
|
- test/dummy/config/environments/production.rb
|
931
|
-
- test/dummy/config/
|
932
|
-
- test/dummy/config/
|
933
|
-
- test/dummy/config/locales/en.yml
|
949
|
+
- test/dummy/config/environments/development.rb
|
950
|
+
- test/dummy/config/environments/test.rb
|
934
951
|
- test/dummy/config/database.yml
|
935
|
-
- test/dummy/
|
936
|
-
- test/dummy/
|
952
|
+
- test/dummy/config/application.rb
|
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
|
937
959
|
- test/dummy/app/controllers/application_controller.rb
|
938
960
|
- test/dummy/app/helpers/application_helper.rb
|
939
|
-
- test/
|
940
|
-
- test/
|
941
|
-
- test/dummy/bin/rake
|
942
|
-
- test/dummy/bin/bundle
|
943
|
-
- test/dummy/bin/update
|
944
|
-
- test/dummy/bin/rails
|
945
|
-
- test/dummy/config.ru
|
946
|
-
- test/dummy/Rakefile
|
947
|
-
- test/functional/kaui/refunds_controller_test.rb
|
948
|
-
- test/functional/kaui/registrations_controller_test.rb
|
949
|
-
- test/functional/kaui/bundles_controller_test.rb
|
950
|
-
- test/functional/kaui/account_tags_controller_test.rb
|
961
|
+
- test/functional/kaui/custom_fields_controller_test.rb
|
962
|
+
- test/functional/kaui/payments_controller_test.rb
|
951
963
|
- test/functional/kaui/admin_controller_test.rb
|
952
|
-
- test/functional/kaui/functional_test_helper_nosetup.rb
|
953
|
-
- test/functional/kaui/role_definitions_controller_test.rb
|
954
|
-
- test/functional/kaui/tags_controller_test.rb
|
955
|
-
- test/functional/kaui/queues_controller_test.rb
|
956
|
-
- test/functional/kaui/home_controller_test.rb
|
957
964
|
- test/functional/kaui/accounts_controller_test.rb
|
958
|
-
- test/functional/kaui/
|
959
|
-
- test/functional/kaui/
|
960
|
-
- test/functional/kaui/
|
961
|
-
- test/functional/kaui/login_proxy_controller_test.rb
|
962
|
-
- test/functional/kaui/tenants_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
|
963
968
|
- test/functional/kaui/tag_definitions_controller_test.rb
|
964
|
-
- test/functional/kaui/admin_allowed_users_controller_test.rb
|
965
969
|
- test/functional/kaui/functional_test_helper.rb
|
966
|
-
- test/functional/kaui/
|
970
|
+
- test/functional/kaui/admin_allowed_users_controller_test.rb
|
971
|
+
- test/functional/kaui/account_tags_controller_test.rb
|
967
972
|
- test/functional/kaui/account_custom_fields_controller_test.rb
|
968
|
-
- test/functional/kaui/
|
969
|
-
- test/functional/kaui/
|
970
|
-
- test/functional/kaui/
|
971
|
-
- test/functional/kaui/
|
972
|
-
- test/functional/kaui/
|
973
|
-
- test/functional/kaui/
|
974
|
-
- test/functional/kaui/
|
975
|
-
- test/functional/kaui/
|
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
|
976
|
+
- test/functional/kaui/audit_logs_controller_test.rb
|
977
|
+
- test/functional/kaui/registrations_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
|
+
- test/functional/kaui/role_definitions_controller_test.rb
|
976
983
|
- test/functional/kaui/invoices_controller_test.rb
|
977
|
-
- test/functional/kaui/admin_tenants_controller_test.rb
|
978
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
|
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
|
992
|
+
- test/functional/kaui/bundle_tags_controller_test.rb
|
979
993
|
- test/functional/kaui/account_emails_controller_test.rb
|
980
|
-
- test/fixtures/overdue-v1.xml
|
981
|
-
- test/fixtures/SpyCarAdvanced.xml
|
982
|
-
- test/fixtures/catalog-v1.xml
|
983
|
-
- test/fixtures/invoice_template-v1.html
|
984
|
-
- test/fixtures/catalog_translation_fr-v1.properties
|
985
|
-
- test/fixtures/stripe.yml
|
986
|
-
- test/fixtures/invoice_translation_fr-v1.properties
|
987
|
-
- test/unit/kaui/invoice_item_test.rb
|
988
994
|
- test/unit/kaui/admin_tenant_test.rb
|
989
|
-
- test/unit/kaui/base_test.rb
|
990
995
|
- test/unit/kaui/money_helper_test.rb
|
991
|
-
- test/unit/kaui/payment_test.rb
|
992
996
|
- test/unit/kaui/invoice_test.rb
|
993
|
-
- test/unit/kaui/tag_definition_test.rb
|
994
|
-
- test/unit/kaui/date_helper_test.rb
|
995
|
-
- test/unit/kaui/invoice_payment_test.rb
|
996
997
|
- test/unit/kaui/allowed_user_test.rb
|
997
|
-
- test/unit/kaui/
|
998
|
+
- test/unit/kaui/base_test.rb
|
999
|
+
- test/unit/kaui/payment_test.rb
|
998
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
|
999
1006
|
- test/unit/kaui/tenant_test.rb
|
1000
|
-
- test/unit/helpers/kaui/tenants_helper_test.rb
|
1001
|
-
- test/unit/helpers/kaui/admin_tenants_helper_test.rb
|
1002
|
-
- test/unit/helpers/kaui/admin_allowed_users_helper_test.rb
|
1003
1007
|
- test/unit/helpers/kaui/payment_method_helper_test.rb
|
1004
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
|