kaui 0.15.5 → 0.16.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 +25 -37
- data/app/assets/javascripts/application.js +1 -2
- data/app/assets/javascripts/kaui/kaui.js +87 -0
- data/app/assets/stylesheets/{bootstrap_and_overrides.less → bootstrap_and_overrides.css.less} +6 -6
- data/app/assets/stylesheets/kaui/account.less +20 -0
- data/app/assets/stylesheets/kaui/kaui.less +3 -0
- data/app/assets/stylesheets/kaui/overdue.less +9 -0
- data/app/assets/stylesheets/kaui/payment.less +10 -0
- data/app/controllers/kaui/account_children_controller.rb +50 -0
- data/app/controllers/kaui/account_tags_controller.rb +4 -3
- data/app/controllers/kaui/account_timelines_controller.rb +1 -3
- data/app/controllers/kaui/accounts_controller.rb +160 -17
- data/app/controllers/kaui/admin_allowed_users_controller.rb +11 -5
- data/app/controllers/kaui/admin_controller.rb +16 -3
- data/app/controllers/kaui/admin_tenants_controller.rb +56 -8
- data/app/controllers/kaui/bundle_tags_controller.rb +4 -3
- data/app/controllers/kaui/bundles_controller.rb +12 -6
- data/app/controllers/kaui/charges_controller.rb +4 -1
- data/app/controllers/kaui/credits_controller.rb +1 -0
- data/app/controllers/kaui/engine_controller.rb +8 -11
- data/app/controllers/kaui/engine_controller_util.rb +30 -18
- data/app/controllers/kaui/invoices_controller.rb +19 -8
- data/app/controllers/kaui/payment_methods_controller.rb +20 -1
- data/app/controllers/kaui/payments_controller.rb +15 -9
- data/app/controllers/kaui/queues_controller.rb +8 -1
- data/app/controllers/kaui/refunds_controller.rb +7 -4
- data/app/controllers/kaui/registrations_controller.rb +15 -1
- data/app/controllers/kaui/sessions_controller.rb +2 -1
- data/app/controllers/kaui/subscriptions_controller.rb +27 -5
- data/app/controllers/kaui/tenants_controller.rb +1 -1
- data/app/controllers/kaui/transactions_controller.rb +11 -1
- data/app/helpers/kaui/account_helper.rb +7 -0
- data/app/helpers/kaui/date_helper.rb +30 -2
- data/app/helpers/kaui/locale_helper.rb +20 -0
- data/app/helpers/kaui/locale_helper.yml +581 -0
- data/app/helpers/kaui/payment_helper.rb +12 -0
- data/app/helpers/kaui/subscription_helper.rb +3 -3
- data/app/helpers/kaui/us_states_helper.rb +11 -0
- data/app/helpers/kaui/us_states_helper.yml +103 -0
- data/app/models/kaui/ability.rb +1 -1
- data/app/models/kaui/account.rb +1 -1
- data/app/models/kaui/admin.rb +11 -9
- data/app/models/kaui/allowed_user.rb +3 -4
- data/app/models/kaui/allowed_user_tenant.rb +2 -2
- data/app/models/kaui/application_record.rb +5 -0
- data/app/models/kaui/base.rb +1 -1
- data/app/models/kaui/bundle.rb +2 -2
- data/app/models/kaui/catalog.rb +4 -24
- data/app/models/kaui/chargeback.rb +0 -23
- data/app/models/kaui/credit.rb +0 -4
- data/app/models/kaui/invoice_item.rb +0 -4
- data/app/models/kaui/invoice_payment.rb +16 -21
- data/app/models/kaui/killbill_authenticatable.rb +2 -2
- data/app/models/kaui/overdue.rb +4 -0
- data/app/models/kaui/payment.rb +0 -3
- data/app/models/kaui/refund.rb +0 -5
- data/app/models/kaui/tenant.rb +1 -2
- data/app/models/kaui/user.rb +1 -3
- data/app/views/kaui/account_children/index.html.erb +47 -0
- data/app/views/kaui/accounts/_account_info.html.erb +16 -1
- data/app/views/kaui/accounts/_billing_info.html.erb +18 -9
- data/app/views/kaui/accounts/_form.html.erb +26 -18
- data/app/views/kaui/accounts/_link_parent_modal.html.erb +34 -0
- data/app/views/kaui/accounts/_parent.html.erb +16 -0
- data/app/views/kaui/accounts/_payment_methods.html.erb +3 -1
- data/app/views/kaui/accounts/index.html.erb +17 -2
- data/app/views/kaui/accounts/show.html.erb +6 -0
- data/app/views/kaui/admin/index.html.erb +1 -1
- data/app/views/kaui/admin_allowed_users/_form.html.erb +22 -0
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +12 -9
- data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +1 -1
- data/app/views/kaui/admin_tenants/_show_overdue.erb +10 -0
- data/app/views/kaui/admin_tenants/new.html.erb +8 -4
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +16 -4
- data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +25 -5
- data/app/views/kaui/bundles/index.html.erb +3 -0
- data/app/views/kaui/chargebacks/_form.html.erb +1 -1
- data/app/views/kaui/charges/_form.html.erb +11 -0
- data/app/views/kaui/credits/_form.html.erb +2 -2
- data/app/views/kaui/custom_fields/_list_bar.html.erb +12 -0
- data/app/views/kaui/invoice_items/_edit_form.html.erb +1 -1
- data/app/views/kaui/invoices/_invoice_table.html.erb +23 -18
- data/app/views/kaui/invoices/show.html.erb +9 -1
- data/app/views/kaui/layouts/kaui_navbar.html.erb +4 -1
- data/app/views/kaui/payment_methods/_form.html.erb +6 -0
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +3 -1
- data/app/views/kaui/payment_methods/_plugin_properties.html.erb +77 -0
- data/app/views/kaui/payments/_form.html.erb +1 -1
- data/app/views/kaui/payments/_payment_table.html.erb +24 -15
- data/app/views/kaui/payments/show.html.erb +4 -1
- data/app/views/kaui/queues/index.html.erb +4 -4
- data/app/views/kaui/refunds/_form.html.erb +3 -2
- data/app/views/kaui/subscriptions/_edit_form.html.erb +3 -3
- data/app/views/kaui/subscriptions/_form.html.erb +3 -0
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +1 -1
- data/app/views/kaui/transactions/_control_plugin_names.html.erb +66 -0
- data/app/views/kaui/transactions/_form.html.erb +7 -1
- data/config/initializers/asset.rb +1 -0
- data/config/initializers/devise.rb +13 -7
- data/config/initializers/killbill_authenticatable.rb +1 -1
- data/config/locales/devise.en.yml +1 -1
- data/config/routes.rb +19 -1
- data/config/symmetric-encryption.yml +1 -1
- data/db/ddl.sql +40 -40
- data/db/migrate/20130812155313_devise_create_kaui_users.rb +12 -0
- data/db/migrate/20150109214021_create_kaui_tenants.rb +12 -0
- data/db/migrate/20150112232813_create_kaui_allowed_users.rb +19 -0
- data/lib/core_ext.rb +191 -0
- data/lib/kaui.rb +68 -5
- data/lib/kaui/engine.rb +11 -4
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/app/controllers/application_controller.rb +1 -1
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +38 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +6 -53
- data/test/dummy/config/boot.rb +2 -9
- data/test/dummy/config/database.yml +15 -17
- data/test/dummy/config/environment.rb +4 -4
- data/test/dummy/config/environments/development.rb +42 -16
- data/test/dummy/config/environments/production.rb +62 -40
- data/test/dummy/config/environments/test.rb +26 -15
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +14 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/killbill_client.rb +1 -1
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/new_framework_defaults_5_1.rb +14 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/test/dummy/config/locales/en.yml +30 -2
- data/test/dummy/config/secrets.yml +32 -0
- data/test/dummy/config/symmetric-encryption.yml +1 -1
- data/test/dummy/db/schema.rb +1 -1
- data/{app/assets/images/kaui/.gitkeep → test/dummy/log/test.log} +0 -0
- data/test/functional/kaui/account_children_controller_test.rb +32 -0
- data/test/functional/kaui/account_tags_controller_test.rb +3 -3
- data/test/functional/kaui/accounts_controller_test.rb +127 -12
- data/test/functional/kaui/admin_allowed_users_controller_test.rb +151 -1
- data/test/functional/kaui/admin_controller_test.rb +45 -0
- data/test/functional/kaui/admin_tenants_controller_test.rb +127 -0
- data/test/functional/kaui/bundle_tags_controller_test.rb +3 -3
- data/test/functional/kaui/bundles_controller_test.rb +27 -0
- data/test/functional/kaui/chargebacks_controller_test.rb +1 -1
- data/test/functional/kaui/custom_fields_controller_test.rb +10 -3
- data/test/functional/kaui/functional_test_helper.rb +1 -1
- data/test/functional/kaui/functional_test_helper_nosetup.rb +66 -1
- data/test/functional/kaui/home_controller_test.rb +9 -0
- data/test/functional/kaui/invoices_controller_test.rb +8 -0
- data/test/functional/kaui/login_proxy_controller_test.rb +12 -0
- data/test/functional/kaui/payment_methods_controller_test.rb +23 -0
- data/test/functional/kaui/payments_controller_test.rb +15 -1
- data/test/functional/kaui/queues_controller_test.rb +17 -0
- data/test/functional/kaui/registrations_controller_test.rb +49 -0
- data/test/functional/kaui/role_definitions_controller_test.rb +47 -0
- data/test/functional/kaui/subscriptions_controller_test.rb +39 -0
- data/test/functional/kaui/tenants_controller_test.rb +6 -0
- data/test/functional/kaui/transactions_controller_test.rb +36 -3
- data/test/integration/kaui/date_helper_integration_test.rb +16 -0
- data/test/integration/kaui/navigation_test.rb +11 -5
- data/test/killbill_test_helper.rb +24 -3
- data/test/test_helper.rb +3 -0
- data/test/unit/kaui/account_email_test.rb +3 -3
- data/test/unit/kaui/date_helper_test.rb +14 -2
- data/test/unit/kaui/money_helper_test.rb +1 -1
- metadata +327 -147
- data/.gitignore +0 -18
- data/.travis.yml +0 -37
- data/Gemfile +0 -6
- data/bin/kaui +0 -4
- data/kaui.gemspec +0 -65
- data/script/rails +0 -8
- data/script/sandbox +0 -30
- data/test/dummy/.gitignore +0 -1
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
@@ -30,7 +30,7 @@
|
|
30
30
|
<div class="form-group">
|
31
31
|
<%= label_tag :reason, 'Reason', :class => 'col-sm-3 control-label' %>
|
32
32
|
<div class="col-sm-9">
|
33
|
-
<%= select_tag :reason, options_for_select(Kaui
|
33
|
+
<%= select_tag :reason, options_for_select(Kaui.payment_reason_codes), :class => 'form-control' %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
<div class="form-group">
|
@@ -1,19 +1,22 @@
|
|
1
1
|
<div class="info-wrapper" >
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<!--</div>-->
|
3
|
+
<div class="tag-bar">
|
4
|
+
<!--<div class="tag-select">-->
|
5
|
+
<!--<span><i class="fa fa-tag"></i><i class="fa fa-caret-down"></i></span>-->
|
6
|
+
<!--<div class="tag-select-box">-->
|
7
|
+
<!--<strong>Tag As:</strong>-->
|
8
|
+
<!--</div>-->
|
9
|
+
<!--</div>-->
|
11
10
|
|
12
|
-
|
13
|
-
|
11
|
+
<%= render :partial => 'kaui/custom_fields/list_bar',
|
12
|
+
:locals => {:custom_fields => custom_fields} %>
|
14
13
|
|
15
|
-
|
14
|
+
<div class="tag-select" onclick="void(0)">
|
15
|
+
<span><i class="fa fa-credit-card"></i><i class="fa fa-caret-down"></i></span>
|
16
16
|
|
17
|
+
<div class="tag-select-box">
|
18
|
+
|
19
|
+
<% if payment.capturable? || payment.voidable? || (payment.refundable? && (can?(:refund, Kaui::Payment) || can?(:chargeback, Kaui::Payment))) %>
|
17
20
|
<% if payment.refundable? %>
|
18
21
|
<% if can? :refund, Kaui::Payment %>
|
19
22
|
<% if payment.target_invoice_id.present? %>
|
@@ -57,12 +60,18 @@
|
|
57
60
|
:payment_method_id => payment.payment_method_id,
|
58
61
|
:transaction_type => 'VOID') %>
|
59
62
|
<% end %>
|
60
|
-
|
63
|
+
<% end %>
|
64
|
+
</div>
|
61
65
|
|
62
|
-
|
66
|
+
</div>
|
63
67
|
|
64
|
-
|
65
|
-
|
68
|
+
<% gateway_url = gateway_url(payment_method, payment) %>
|
69
|
+
<% unless gateway_url.nil? %>
|
70
|
+
<div class="gateway-link">
|
71
|
+
<span><%= link_to 'See in gateway', gateway_url, :target => '_blank' %></span>
|
72
|
+
</div>
|
73
|
+
<% end %>
|
74
|
+
</div>
|
66
75
|
|
67
76
|
<div style="overflow-x: auto;">
|
68
77
|
<table id="payment_<%= payment.payment_id %>" class="table table-condensed mobile-data">
|
@@ -24,7 +24,10 @@
|
|
24
24
|
<% end %>
|
25
25
|
|
26
26
|
<%= render :partial => 'kaui/payments/payment_table',
|
27
|
-
:locals => {:
|
27
|
+
:locals => {:payment_method => @payment_method,
|
28
|
+
:payment => @payment,
|
29
|
+
:account => @account,
|
30
|
+
:custom_fields => @custom_fields} %>
|
28
31
|
|
29
32
|
</div>
|
30
33
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<p class="text-center">
|
2
|
-
<%= link_to 'Current or future entries', kaui_engine.queues_path(params.merge(:with_history => false, :max_date => @now + 1.week)) %> /
|
2
|
+
<%= link_to 'Current or future entries', kaui_engine.queues_path(params.to_h.merge(:with_history => false, :max_date => @now + 1.week)) %> /
|
3
3
|
<% unless params[:account_id].present? -%>
|
4
|
-
<%= link_to 'Historical entries (last week)', kaui_engine.queues_path(params.merge(:with_history => true, :min_date => @now - 1.week, :max_date => @now + 1.week)) %> /
|
5
|
-
<%= link_to 'Historical entries (last month)', kaui_engine.queues_path(params.merge(:with_history => true, :min_date => @now - 1.month, :max_date => @now + 1.week)) %> /
|
4
|
+
<%= link_to 'Historical entries (last week)', kaui_engine.queues_path(params.to_h.merge(:with_history => true, :min_date => @now - 1.week, :max_date => @now + 1.week)) %> /
|
5
|
+
<%= link_to 'Historical entries (last month)', kaui_engine.queues_path(params.to_h.merge(:with_history => true, :min_date => @now - 1.month, :max_date => @now + 1.week)) %> /
|
6
6
|
<% end -%>
|
7
|
-
<%= link_to 'All historical entries', kaui_engine.queues_path(params.merge(:with_history => true)) %>
|
7
|
+
<%= link_to 'All historical entries', kaui_engine.queues_path(params.to_h.merge(:with_history => true)) %>
|
8
8
|
</p>
|
9
9
|
|
10
10
|
<div class="search">
|
@@ -28,9 +28,10 @@
|
|
28
28
|
<div id=<%= "div_#{ii.invoice_item_id}" %> class="form-group">
|
29
29
|
<label class="col-sm-2 control-label"></label>
|
30
30
|
|
31
|
+
<% bundle = @bundles.find { |bundle| bundle.bundle_id == ii.bundle_id } %>
|
31
32
|
<div class="col-sm-10">
|
32
33
|
<input type="checkbox" id=<%= "cb_adj_#{ii.invoice_item_id}" %>>
|
33
|
-
<%= "Item #{index + 1} : #{ii.description} " %>
|
34
|
+
<%= "Item #{index + 1} : #{ii.description} #{"(bundle #{bundle.external_key})" unless bundle.nil?}" %>
|
34
35
|
<%= text_field_tag "adjustments[#{ii.invoice_item_id}]", index, :id => "tf_adj_#{ii.invoice_item_id}", :value => ii.amount, :class => 'form-control' %>
|
35
36
|
</div>
|
36
37
|
</div>
|
@@ -48,7 +49,7 @@
|
|
48
49
|
<div class="form-group">
|
49
50
|
<%= label_tag :reason, 'Reason', :class => 'col-sm-2 control-label' %>
|
50
51
|
<div class="col-sm-10">
|
51
|
-
<%= select_tag :reason, options_for_select(Kaui
|
52
|
+
<%= select_tag :reason, options_for_select(Kaui.refund_reason_codes), :class => 'form-control' %>
|
52
53
|
</div>
|
53
54
|
</div>
|
54
55
|
<div class="form-group">
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<div class="col-sm-offset-2 col-sm-10">
|
11
11
|
<div class="radio">
|
12
12
|
<%= label_tag :type_change do %>
|
13
|
-
<%= radio_button_tag :type_change, '
|
14
|
-
|
13
|
+
<%= radio_button_tag :type_change, 'DEFAULT', :checked => true %>
|
14
|
+
Default policy
|
15
15
|
<% end %>
|
16
16
|
</div>
|
17
17
|
<div class="radio">
|
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
function onTypeChange() {
|
54
54
|
var value = $("input[type=radio]:checked").val();
|
55
|
-
if (value == "
|
55
|
+
if (value == "DEFAULT") {
|
56
56
|
$("#form_requested_date").hide();
|
57
57
|
$("#form_policy").hide();
|
58
58
|
} else if (value == "POLICY") {
|
@@ -16,6 +16,9 @@
|
|
16
16
|
<%= f.label :external_key, 'Key', :class => 'col-sm-2 control-label' %>
|
17
17
|
<div class="col-sm-10">
|
18
18
|
<%= f.text_field :external_key, :class => 'form-control', :id => 'external_key' %>
|
19
|
+
<div class="subscription_external_key_invalid_msg text-danger">
|
20
|
+
Warning! External key already in use.
|
21
|
+
</div>
|
19
22
|
</div>
|
20
23
|
</div>
|
21
24
|
<div class="form-group">
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<td><%= humanized_subscription_charged_through_date(sub, account) %></td>
|
21
21
|
<td><%= humanized_subscription_cancelled_date(sub, account) %></td>
|
22
22
|
<td class="text-center">
|
23
|
-
<% if is_subscription_future_cancelled?(sub) %>
|
23
|
+
<% if is_subscription_future_cancelled?(sub, account) %>
|
24
24
|
<%= link_to 'Reinstate', kaui_engine.reinstate_path(:id => sub.subscription_id), :method => :put, :class => 'btn btn-xs' %>
|
25
25
|
<% elsif !is_subscription_cancelled?(sub) %>
|
26
26
|
<% if can? :change_plan, Kaui::Subscription %>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<div id="control_plugin_names" class="row">
|
2
|
+
<a class='btn btn-xs' href="javascript:void(0);" onclick="new_control_plugin_name();" id="new_control_plugin_names"><%= '<i class="fa fa-plus-square"></i>'.html_safe + " add control plugin names" %></a>
|
3
|
+
<table id="control_plugin_names_table" class="table table-condensed">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>Control plugin name</th>
|
7
|
+
<th></th>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
<tbody>
|
11
|
+
<% (@control_plugin_names || ['']).each_with_index do |control_plugin_name, index| %>
|
12
|
+
<tr id="control_plugin_name_<%= index %>" >
|
13
|
+
<td><%= text_field_tag 'control_plugin_names[]', control_plugin_name, class: 'form-control' %></td>
|
14
|
+
<td>
|
15
|
+
<a class='btn btn-xs' href="javascript:void(0);" onclick="delete_control_plugin_name(this);" id="delete_control_plugin_name_<%= index %>"><%= '<i class="fa fa-times"></i>'.html_safe %></a>
|
16
|
+
</td>
|
17
|
+
</tr>
|
18
|
+
<% end %>
|
19
|
+
</tbody>
|
20
|
+
</table>
|
21
|
+
<hr/>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<%= javascript_tag do %>
|
25
|
+
|
26
|
+
function new_control_plugin_name() {
|
27
|
+
/* Compute max index value to assign new rows with unsued index */
|
28
|
+
var max_idx = $.map($('[id^=delete_control_plugin_name_]'), function(e, i) {
|
29
|
+
return e.id.split("delete_control_plugin_name_")[1] }
|
30
|
+
).sort(function(a, b) {
|
31
|
+
return b - a
|
32
|
+
})[0];
|
33
|
+
|
34
|
+
/* Clone existing row and reset id based on max_idx */
|
35
|
+
var row = $('#control_plugin_names_table tbody>tr:last').clone(true);
|
36
|
+
var row_idx = (parseInt(max_idx) + 1).toString();
|
37
|
+
row.attr('id', "control_plugin_name_" + row_idx);
|
38
|
+
row.children("td:last").children('a').attr('id', "delete_control_plugin_name_" + row_idx);
|
39
|
+
|
40
|
+
/* reset value on content */
|
41
|
+
row.find('td').each(function(){
|
42
|
+
$(this).contents().each(function(){
|
43
|
+
$(this).val('');
|
44
|
+
});
|
45
|
+
});
|
46
|
+
|
47
|
+
/* Attach row into dom */
|
48
|
+
row.insertAfter('#control_plugin_names_table tbody>tr:last');
|
49
|
+
}
|
50
|
+
|
51
|
+
function delete_control_plugin_name(obj) {
|
52
|
+
var idx = obj.id.split("delete_control_plugin_name_")[1];
|
53
|
+
var rowCount = $('#control_plugin_names_table tr').size();
|
54
|
+
|
55
|
+
if ( rowCount > 2 ){
|
56
|
+
$("#control_plugin_name_" + idx).remove();
|
57
|
+
} else {
|
58
|
+
$("#control_plugin_name_" + idx).find('td').each(function(){
|
59
|
+
$(this).contents().each(function(){
|
60
|
+
$(this).val('');
|
61
|
+
});
|
62
|
+
});
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
<% end %>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<div class="form-group">
|
51
51
|
<%= label_tag :reason, 'Reason', :class => 'col-sm-3 control-label' %>
|
52
52
|
<div class="col-sm-9">
|
53
|
-
<%= select_tag :reason, options_for_select(Kaui
|
53
|
+
<%= select_tag :reason, options_for_select(Kaui.payment_reason_codes), :class => 'form-control' %>
|
54
54
|
</div>
|
55
55
|
</div>
|
56
56
|
<div class="form-group">
|
@@ -59,6 +59,12 @@
|
|
59
59
|
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
60
60
|
</div>
|
61
61
|
</div>
|
62
|
+
<div id="control_plugins" class="col-sm-offset-3 col-sm-9">
|
63
|
+
<%= render :partial => 'control_plugin_names' %>
|
64
|
+
</div>
|
65
|
+
<div id="properties" class="col-sm-offset-3 col-sm-9">
|
66
|
+
<%= render :partial => 'kaui/payment_methods/plugin_properties' %>
|
67
|
+
</div>
|
62
68
|
<div class="form-group">
|
63
69
|
<div class="col-sm-offset-3 col-sm-9">
|
64
70
|
<%= submit_tag 'Save', :class => 'btn btn-default' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w( kaui/*.png )
|
@@ -21,16 +21,22 @@ module Devise
|
|
21
21
|
class FailureApp < ActionController::Metal
|
22
22
|
def scope_url
|
23
23
|
opts = {}
|
24
|
-
route = :"new_#{scope}_session_url"
|
25
|
-
opts[:format] = request_format unless skip_format?
|
26
24
|
|
27
|
-
|
25
|
+
# Initialize script_name with nil to prevent infinite loops in
|
26
|
+
# authenticated mounted engines in rails 4.2 and 5.0
|
27
|
+
opts[:script_name] = nil
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
route = route(scope)
|
30
|
+
|
31
|
+
opts[:format] = request_format unless skip_format?
|
32
|
+
|
33
|
+
# Fix for Rails 5.1
|
34
|
+
# See https://github.com/rails/rails/pull/29898/files (merge_script_names)
|
35
|
+
#opts[:script_name] = relative_url_root if relative_url_root?
|
36
|
+
opts[:script_name] = relative_url_root + '/' if relative_url_root?
|
32
37
|
|
33
|
-
|
38
|
+
router_name = Devise.mappings[scope].router_name || Devise.available_router_name
|
39
|
+
context = send(router_name)
|
34
40
|
|
35
41
|
if context.respond_to?(route)
|
36
42
|
context.send(route, opts)
|
@@ -15,7 +15,7 @@ en:
|
|
15
15
|
not_found_in_database: "Invalid username or password."
|
16
16
|
killbill_not_available: "Kill Bill is unavailable"
|
17
17
|
timeout: "Your session expired, please sign in again to continue."
|
18
|
-
unauthenticated: "You need to sign in
|
18
|
+
unauthenticated: "You need to sign in before continuing."
|
19
19
|
unconfirmed: "You have to confirm your account before continuing."
|
20
20
|
mailer:
|
21
21
|
confirmation_instructions:
|
data/config/routes.rb
CHANGED
@@ -24,10 +24,18 @@ Kaui::Engine.routes.draw do
|
|
24
24
|
|
25
25
|
scope '/accounts' do
|
26
26
|
match '/pagination' => 'accounts#pagination', :via => :get, :as => 'accounts_pagination'
|
27
|
+
match '/validate_external_key' => 'accounts#validate_external_key', :via => :get, :as => 'accounts_validate_external_key'
|
28
|
+
|
29
|
+
scope '/email_notifications' do
|
30
|
+
match '/' => 'accounts#set_email_notifications_configuration', :via => :post, :as => 'email_notifications_configuration'
|
31
|
+
match '/events_to_consider' => 'accounts#events_to_consider', :via => :get, :as => 'email_notification_events_to_consider'
|
32
|
+
end
|
27
33
|
|
28
34
|
scope '/:account_id' do
|
29
35
|
match '/next_invoice_date' => 'accounts#next_invoice_date', :via => :get, :as => 'next_invoice_date'
|
30
36
|
match '/trigger_invoice' => 'accounts#trigger_invoice', :via => :post, :as => 'trigger_invoice'
|
37
|
+
match '/link_to_parent' => 'accounts#link_to_parent', :via => :put, :as => 'link_to_parent'
|
38
|
+
match '/unlink_to_parent' => 'accounts#unlink_to_parent', :via => :delete, :as => 'unlink_to_parent'
|
31
39
|
|
32
40
|
scope '/account_tags' do
|
33
41
|
match '/edit' => 'account_tags#edit', :via => :get, :as => 'edit_account_tags'
|
@@ -40,6 +48,10 @@ Kaui::Engine.routes.draw do
|
|
40
48
|
scope '/timeline' do
|
41
49
|
match '/' => 'account_timelines#show', :via => :get, :as => 'account_timeline'
|
42
50
|
end
|
51
|
+
scope '/account_children' do
|
52
|
+
match '/' => 'account_children#index', :via => :get, :as => 'account_children'
|
53
|
+
match '/pagination' => 'account_children#pagination', :via => :get, :as => 'account_children_pagination'
|
54
|
+
end
|
43
55
|
end
|
44
56
|
end
|
45
57
|
resources :accounts, :only => [ :index, :new, :create, :edit, :update, :show ], :param => :account_id do
|
@@ -64,12 +76,16 @@ Kaui::Engine.routes.draw do
|
|
64
76
|
resources :queues, :only => [:index]
|
65
77
|
end
|
66
78
|
|
79
|
+
scope '/payment_methods' do
|
80
|
+
match '/validate_external_key' => 'payment_methods#validate_external_key', :via => :get, :as => 'payment_methods_validate_external_key'
|
81
|
+
end
|
67
82
|
resources :payment_methods, :only => [:new, :create, :show, :destroy]
|
68
83
|
|
69
84
|
scope '/invoices' do
|
70
85
|
match '/pagination' => 'invoices#pagination', :via => :get, :as => 'invoices_pagination'
|
71
86
|
match '/:id/show_html' => 'invoices#show_html', :via => :get, :as => 'show_html_invoice'
|
72
87
|
match '/:id' => 'invoices#restful_show', :via => :get, :as => 'invoice'
|
88
|
+
match '/commit' => 'invoices#commit_invoice', :via => :post, :as => 'commit_invoice'
|
73
89
|
end
|
74
90
|
resources :invoices, :only => [ :index ]
|
75
91
|
|
@@ -95,12 +111,13 @@ Kaui::Engine.routes.draw do
|
|
95
111
|
match '/:id' => 'bundles#restful_show', :via => :get, :as => 'bundle'
|
96
112
|
end
|
97
113
|
|
98
|
-
resources :subscriptions, :only => [:new, :create, :show, :edit, :update, :destroy]
|
99
114
|
scope '/subscriptions' do
|
100
115
|
match '/:id/edit_bcd' => 'subscriptions#edit_bcd', :via => :get, :as => 'edit_bcd'
|
101
116
|
match '/:id/update_bcd' => 'subscriptions#update_bcd', :via => :put, :as => 'update_bcd'
|
102
117
|
match '/:id/reinstate' => 'subscriptions#reinstate', :via => :put, :as => 'reinstate'
|
118
|
+
match '/validate_external_key' => 'subscriptions#validate_external_key', :via => :get, :as => 'subscriptions_validate_external_key'
|
103
119
|
end
|
120
|
+
resources :subscriptions, :only => [:new, :create, :show, :edit, :update, :destroy]
|
104
121
|
|
105
122
|
scope '/tags' do
|
106
123
|
match '/pagination' => 'tags#pagination', :via => :get, :as => 'tags_pagination'
|
@@ -140,6 +157,7 @@ Kaui::Engine.routes.draw do
|
|
140
157
|
resources :admin_tenants, :only => [ :index, :new, :create, :show ]
|
141
158
|
scope '/admin_tenants' do
|
142
159
|
match '/:id/new_catalog' => 'admin_tenants#new_catalog', :via => :get, :as => 'admin_tenant_new_catalog'
|
160
|
+
match '/:id/delete_catalog' => 'admin_tenants#delete_catalog', :via => :delete, :as => 'admin_tenant_delete_catalog'
|
143
161
|
match '/:id/new_plan_currency' => 'admin_tenants#new_plan_currency', :via => :get, :as => 'admin_tenant_new_plan_currency'
|
144
162
|
match '/:id/new_overdue_config' => 'admin_tenants#new_overdue_config', :via => :get, :as => 'admin_tenant_new_overdue_config'
|
145
163
|
match '/upload_catalog' => 'admin_tenants#upload_catalog', :via => :post, :as => 'admin_tenant_upload_catalog'
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# can be placed directly in the source code.
|
7
7
|
# And therefore no RSA private key is required
|
8
8
|
development: &development_defaults
|
9
|
-
key:
|
9
|
+
key: 1234567890ABCDEF
|
10
10
|
iv: 1234567890ABCDEF
|
11
11
|
cipher_name: aes-128-cbc
|
12
12
|
encoding: :base64strict
|
data/db/ddl.sql
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
CREATE TABLE
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
PRIMARY KEY (
|
8
|
-
|
9
|
-
|
1
|
+
CREATE TABLE kaui_users (
|
2
|
+
id serial unique,
|
3
|
+
kb_username varchar(255) NOT NULL,
|
4
|
+
kb_session_id varchar(255) DEFAULT NULL,
|
5
|
+
created_at datetime NOT NULL,
|
6
|
+
updated_at datetime NOT NULL,
|
7
|
+
PRIMARY KEY (id)
|
8
|
+
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
|
9
|
+
CREATE UNIQUE INDEX index_kaui_users_on_kb_username ON kaui_users(kb_username);
|
10
10
|
|
11
|
-
CREATE TABLE
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
PRIMARY KEY (
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
CREATE TABLE kaui_tenants (
|
12
|
+
id serial unique,
|
13
|
+
name varchar(255) NOT NULL,
|
14
|
+
kb_tenant_id varchar(255) DEFAULT NULL,
|
15
|
+
api_key varchar(255) DEFAULT NULL,
|
16
|
+
encrypted_api_secret varchar(255) DEFAULT NULL,
|
17
|
+
created_at datetime NOT NULL,
|
18
|
+
updated_at datetime NOT NULL,
|
19
|
+
PRIMARY KEY (id)
|
20
|
+
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
|
21
|
+
CREATE UNIQUE INDEX kaui_tenants_kb_name ON kaui_tenants(name);
|
22
|
+
CREATE UNIQUE INDEX kaui_tenants_kb_tenant_id ON kaui_tenants(kb_tenant_id);
|
23
|
+
CREATE UNIQUE INDEX kaui_tenants_kb_api_key ON kaui_tenants(api_key);
|
24
24
|
|
25
|
-
CREATE TABLE
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
PRIMARY KEY (
|
32
|
-
|
33
|
-
|
25
|
+
CREATE TABLE kaui_allowed_users (
|
26
|
+
id serial unique,
|
27
|
+
kb_username varchar(255) DEFAULT NULL,
|
28
|
+
description varchar(255) DEFAULT NULL,
|
29
|
+
created_at datetime NOT NULL,
|
30
|
+
updated_at datetime NOT NULL,
|
31
|
+
PRIMARY KEY (id)
|
32
|
+
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
|
33
|
+
CREATE UNIQUE INDEX kaui_allowed_users_idx ON kaui_allowed_users(kb_username);
|
34
34
|
|
35
|
-
CREATE TABLE
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
PRIMARY KEY (
|
42
|
-
|
43
|
-
|
35
|
+
CREATE TABLE kaui_allowed_user_tenants (
|
36
|
+
id serial unique,
|
37
|
+
kaui_allowed_user_id bigint /*! unsigned */ DEFAULT NULL,
|
38
|
+
kaui_tenant_id bigint /*! unsigned */ DEFAULT NULL,
|
39
|
+
created_at datetime NOT NULL,
|
40
|
+
updated_at datetime NOT NULL,
|
41
|
+
PRIMARY KEY (id)
|
42
|
+
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
|
43
|
+
CREATE UNIQUE INDEX kaui_allowed_users_tenants_uniq ON kaui_allowed_user_tenants(kaui_allowed_user_id,kaui_tenant_id);
|
44
44
|
|