kaui 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/README.rdoc +27 -1
  2. data/app/controllers/kaui/account_tags_controller.rb +24 -9
  3. data/app/controllers/kaui/account_timelines_controller.rb +1 -1
  4. data/app/controllers/kaui/accounts_controller.rb +7 -5
  5. data/app/controllers/kaui/bundles_controller.rb +2 -2
  6. data/app/controllers/kaui/chargebacks_controller.rb +3 -2
  7. data/app/controllers/kaui/charges_controller.rb +32 -0
  8. data/app/controllers/kaui/credits_controller.rb +3 -4
  9. data/app/controllers/kaui/external_payments_controller.rb +0 -2
  10. data/app/controllers/kaui/invoice_items_controller.rb +44 -0
  11. data/app/controllers/kaui/invoices_controller.rb +4 -3
  12. data/app/controllers/kaui/payments_controller.rb +10 -13
  13. data/app/controllers/kaui/refunds_controller.rb +19 -8
  14. data/app/controllers/kaui/subscriptions_controller.rb +5 -1
  15. data/app/controllers/kaui/tag_definitions_controller.rb +85 -0
  16. data/app/helpers/kaui/date_helper.rb +1 -1
  17. data/app/helpers/kaui/killbill_helper.rb +160 -59
  18. data/app/models/kaui/account.rb +7 -1
  19. data/app/models/kaui/account_timeline.rb +0 -4
  20. data/app/models/kaui/audit_log.rb +9 -7
  21. data/app/models/kaui/base.rb +80 -1
  22. data/app/models/kaui/charge.rb +14 -0
  23. data/app/models/kaui/chargeback.rb +2 -10
  24. data/app/models/kaui/event.rb +2 -13
  25. data/app/models/kaui/invoice.rb +6 -7
  26. data/app/models/kaui/invoice_item.rb +9 -17
  27. data/app/models/kaui/payment.rb +6 -21
  28. data/app/models/kaui/payment_method.rb +1 -8
  29. data/app/models/kaui/plugin_info.rb +1 -5
  30. data/app/models/kaui/plugin_info_property.rb +0 -6
  31. data/app/models/kaui/refund.rb +5 -13
  32. data/app/models/kaui/tag.rb +10 -3
  33. data/app/models/kaui/tag_definition.rb +46 -0
  34. data/app/views/kaui/account_tags/edit.html.erb +17 -17
  35. data/app/views/kaui/account_timelines/show.html.erb +61 -39
  36. data/app/views/kaui/accounts/index.html.erb +1 -1
  37. data/app/views/kaui/accounts/show.html.erb +16 -2
  38. data/app/views/kaui/bundles/show.html.erb +2 -1
  39. data/app/views/kaui/chargebacks/new.html.erb +18 -2
  40. data/app/views/kaui/charges/new.html.erb +87 -0
  41. data/app/views/kaui/credits/new.html.erb +1 -1
  42. data/app/views/kaui/invoice_items/edit.html.erb +92 -0
  43. data/app/views/kaui/invoice_items/index.html.erb +20 -0
  44. data/app/views/kaui/invoice_items/show.html.erb +31 -0
  45. data/app/views/kaui/invoices/index.html.erb +1 -1
  46. data/app/views/kaui/invoices/show.html.erb +42 -24
  47. data/app/views/kaui/payments/_payments_table.html.erb +7 -5
  48. data/app/views/kaui/payments/new.html.erb +32 -12
  49. data/app/views/kaui/refunds/index.html.erb +3 -3
  50. data/app/views/kaui/refunds/new.html.erb +3 -3
  51. data/app/views/kaui/refunds/show.html.erb +27 -13
  52. data/app/views/kaui/subscriptions/edit.html.erb +8 -0
  53. data/app/views/kaui/tag_definitions/_form.html.erb +45 -0
  54. data/app/views/kaui/tag_definitions/edit.html.erb +3 -0
  55. data/app/views/kaui/tag_definitions/index.html.erb +34 -0
  56. data/app/views/kaui/tag_definitions/new.html.erb +3 -0
  57. data/app/views/kaui/tag_definitions/show.html.erb +12 -0
  58. data/app/views/kaui/tags/_tags_table.html.erb +3 -3
  59. data/config/locales/en.yml +3 -0
  60. data/config/locales/fr.yml +3 -0
  61. data/config/routes.rb +11 -1
  62. data/lib/kaui/version.rb +1 -1
  63. data/test/dummy/app/controllers/application_controller.rb +10 -0
  64. data/test/dummy/app/views/layouts/application.html.erb +44 -11
  65. data/test/dummy/config/application.rb +1 -0
  66. data/test/dummy/config/database.yml +5 -4
  67. data/test/dummy/config/environments/development.rb +2 -0
  68. data/test/dummy/config/routes.rb +1 -2
  69. data/test/dummy/log/development.log +2419 -0
  70. data/test/dummy/log/test.log +3265 -131
  71. data/test/dummy/test/fixtures/accounts.yml +32 -0
  72. data/test/dummy/test/fixtures/bundles.yml +4 -0
  73. data/test/dummy/test/fixtures/invoice_items.yml +13 -0
  74. data/test/dummy/test/fixtures/invoices.yml +11 -0
  75. data/test/dummy/test/fixtures/payment_methods.yml +5 -0
  76. data/test/dummy/test/fixtures/plugin_info_properties.yml +59 -0
  77. data/test/dummy/test/fixtures/plugin_infos.yml +2 -0
  78. data/test/dummy/test/fixtures/refunds.yml +8 -0
  79. data/test/dummy/test/fixtures/tag_definitions.yml +9 -0
  80. data/test/dummy/tmp/cache/assets/C8D/6D0/sprockets%2F0ce756f49d61795508c543a702955fc2 +0 -0
  81. data/test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a +0 -0
  82. data/test/dummy/tmp/cache/assets/CD0/9D0/sprockets%2F5c9508c21501c73fbe00473a09b1f5f4 +0 -0
  83. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  84. data/test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652 +0 -0
  85. data/test/dummy/tmp/cache/assets/D0E/370/sprockets%2F27630db2080819f67c8a0ed5e491b7cb +0 -0
  86. data/test/dummy/tmp/cache/assets/D32/200/sprockets%2Ffa467106e01bda5d6246baea72159d64 +0 -0
  87. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  88. data/test/dummy/tmp/cache/assets/D39/5E0/sprockets%2F59fd338be48a81a17a2a785cbd1612b4 +0 -0
  89. data/test/dummy/tmp/cache/assets/D44/170/sprockets%2Fac15571bce3f926a498da7cd09322d97 +0 -0
  90. data/test/dummy/tmp/cache/assets/D4A/DD0/sprockets%2F0f813582283b7f56fd83fe3d52be7e2c +0 -0
  91. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  92. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  93. data/test/dummy/tmp/cache/assets/D6C/710/sprockets%2F1765773caead06c0a6a19ea9de2453f7 +0 -0
  94. data/test/dummy/tmp/cache/assets/D76/910/sprockets%2Ff99b4bdc434e11e8634e6af62fe805e0 +0 -0
  95. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  96. data/test/dummy/tmp/cache/assets/DF1/1A0/sprockets%2F7f6b7bfea83401d3106b7fadac81ea4b +0 -0
  97. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  98. data/test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af +0 -0
  99. data/test/dummy/vendor/assets/images/img/glyphicons-halflings-white.png +0 -0
  100. data/test/dummy/vendor/assets/images/img/glyphicons-halflings.png +0 -0
  101. data/test/dummy/vendor/assets/javascripts/bootstrap.v2.0.4.min.js +6 -0
  102. data/test/dummy/vendor/assets/javascripts/jquery.dataTables.v1.9.3.min.js +156 -0
  103. data/test/dummy/vendor/assets/stylesheets/bootstrap.v2.0.4.min.css +9 -0
  104. data/test/functional/kaui/accounts_controller_test.rb +63 -0
  105. data/test/functional/kaui/bundles_controller_test.rb +18 -6
  106. data/test/functional/kaui/invoice_items_controller_test.rb +18 -0
  107. data/test/functional/kaui/invoices_controller_test.rb +18 -6
  108. data/test/functional/kaui/tag_definitions_controller_test.rb +60 -0
  109. data/test/test_helper.rb +143 -0
  110. data/test/unit/helpers/kaui/plugin_infos_helper_test.rb +20 -0
  111. data/test/unit/kaui/account_test.rb +42 -0
  112. data/test/unit/kaui/base_test.rb +39 -0
  113. data/test/unit/kaui/date_helper_test.rb +13 -0
  114. data/test/unit/kaui/invoice_item_test.rb +23 -0
  115. data/test/unit/kaui/invoice_test.rb +20 -0
  116. data/test/unit/kaui/payment_method_test.rb +26 -0
  117. data/test/unit/kaui/plugin_info_property_test.rb +20 -0
  118. data/test/unit/kaui/plugin_info_test.rb +19 -0
  119. data/test/unit/kaui/refund_test.rb +19 -0
  120. data/test/unit/kaui/tag_definition_test.rb +23 -0
  121. data/test/unit/model_test.rb +23 -23
  122. metadata +330 -226
@@ -9,6 +9,7 @@
9
9
  <th>Total amount</th>
10
10
  <th>Paid amount</th>
11
11
  <th>Payment method</th>
12
+ <th>External payment id / Secondary payment id</th>
12
13
  <th>Retry count</th>
13
14
  <th>Status</th>
14
15
  </tr>
@@ -17,13 +18,14 @@
17
18
  <% if @payments.present? %>
18
19
  <% @payments.each do |payment| %>
19
20
  <tr>
20
- <td><%= format_date(payment.requested_dt).html_safe if payment.requested_dt.present? %></td>
21
- <td><%= format_date(payment.effective_dt).html_safe if payment.effective_dt.present? %></td>
22
- <td><%= payment.amount %> <%= @account.currency if payment.amount.present? %></td>
23
- <td><%= payment.paid_amount %> <%= @account.currency if payment.paid_amount.present? %></td>
21
+ <td><%= format_date(payment.requested_date).html_safe if payment.requested_date.present? %></td>
22
+ <td><%= format_date(payment.effective_date).html_safe if payment.effective_date.present? %></td>
23
+ <td><%= payment.amount %> <%= payment.currency if payment.amount.present? %></td>
24
+ <td><%= payment.paid_amount %> <%= payment.currency if payment.paid_amount.present? %></td>
24
25
  <td></td>
26
+ <td><%= payment.ext_first_payment_id_ref %> <%= " / " if payment.ext_second_payment_id_ref.present? %> <%= payment.ext_second_payment_id_ref %></td>
25
27
  <td><%= payment.retry_count %></td>
26
- <td><%= payment.status %></td>
28
+ <td><%= payment.status %> <%= payment.gateway_error_code unless payment.status == 'SUCCESS' %> <%= payment.gateway_error_msg %></td>
27
29
  </tr>
28
30
  <% end %>
29
31
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <div class="page-header">
2
- <h1>Apply External Payment</h1>
2
+ <h1>Process Payment</h1>
3
3
  </div>
4
4
  <%= form_for(@payment, :url => { :action => :create }, :html => { :class => "form-horizontal" }) do |f| %>
5
- <%= hidden_field_tag :account_id, @account_id %>
6
- <%= hidden_field_tag :invoice_id, @invoice_id %>
5
+ <%= f.hidden_field :account_id %>
6
+ <%= hidden_field_tag :external, params[:external] %>
7
7
  <fieldset>
8
8
  <div class="control-group">
9
9
  <label class="control-label">Date</label>
@@ -13,14 +13,6 @@
13
13
  </label>
14
14
  </div>
15
15
  </div>
16
- <div class="control-group">
17
- <label class="control-label">Invoice number</label>
18
- <div class="controls">
19
- <label class="checkbox">
20
- <%= @invoice.invoice_number %><br/>
21
- </label>
22
- </div>
23
- </div>
24
16
  <div class="control-group">
25
17
  <label class="control-label">Account name</label>
26
18
  <div class="controls">
@@ -29,6 +21,34 @@
29
21
  <%= @account.email %>
30
22
  </label>
31
23
  </div>
24
+ </div>
25
+ <% if @invoice.present? %>
26
+ <%= f.hidden_field :invoice_id %>
27
+ <div class="control-group">
28
+ <label class="control-label">Invoice number</label>
29
+ <div class="controls">
30
+ <label class="checkbox">
31
+ <%= @invoice.invoice_number %><br/>
32
+ </label>
33
+ </div>
34
+ </div>
35
+ <div class="control-group">
36
+ <label class="control-label">Invoice amount</label>
37
+ <div class="controls">
38
+ <label class="checkbox">
39
+ <%= @invoice.amount %> <%= @account.currency %>
40
+ </label>
41
+ </div>
42
+ </div>
43
+ <div class="control-group">
44
+ <label class="control-label">Balance</label>
45
+ <div class="controls">
46
+ <label class="checkbox">
47
+ <%= @invoice.balance.nil? ? "0.00" : @invoice.balance %> <%= @account.currency %>
48
+ </label>
49
+ </div>
50
+ </div>
51
+ <% end %>
32
52
  <div class="control-group">
33
53
  <%= f.label :amount, "Amount", :class => "control-label" %>
34
54
  <div class="controls">
@@ -49,7 +69,7 @@
49
69
  </div>
50
70
  </div>
51
71
  <div class="form-actions">
52
- <%= button_tag "Create refund", :class =>"btn btn-primary" %>
72
+ <%= button_tag "Process Payment", :class =>"btn btn-primary" %>
53
73
  <%= link_to 'Back', :back, :class => 'btn' %>
54
74
  </div>
55
75
  </fieldset>
@@ -1,10 +1,10 @@
1
1
  <%= form_tag refunds_path, :class => "form-horizontal", :method => :get do %>
2
2
  <fieldset>
3
- <legend>Please enter payment id</legend>
3
+ <legend>Please enter either a refund or payment id</legend>
4
4
  <div class="control-group">
5
- <label class="control-label" for="payment_id">Refund</label>
5
+ <label class="control-label" for="refund_id">Refund or payment</label>
6
6
  <div class="controls">
7
- <%= text_field_tag 'payment_id', nil, :class => "input-xlarge", :id => "payment_id" %>
7
+ <%= text_field_tag "refund_id", nil, :class => "input-xlarge", :id => "refund_id" %>
8
8
  </div>
9
9
  </div>
10
10
  <div class="form-actions">
@@ -42,7 +42,7 @@
42
42
  <label class="control-label">Payment method</label>
43
43
  <div class="controls">
44
44
  <label class="checkbox">
45
- <%= @payment.payment_method_id %>
45
+ <%= @payment_method.type %> <%= @payment_method.card_type %> <%= @payment_method.mask_number %>
46
46
  </label>
47
47
  </div>
48
48
  </div>
@@ -63,9 +63,9 @@
63
63
  </div>
64
64
  </div>
65
65
  <div class="control-group">
66
- <%= f.label :refund_amount, "Refund amount", :class => "control-label" %>
66
+ <%= f.label :amount, "Refund amount", :class => "control-label" %>
67
67
  <div class="controls">
68
- <%= f.text_field :refund_amount, :value => @payment.amount, :class => 'input-small' %>
68
+ <%= f.text_field :amount, :value => @payment.amount, :class => 'input-small' %>
69
69
  <p class="help-inline"><%= @account.currency %></p>
70
70
  </div>
71
71
  </div>
@@ -1,19 +1,33 @@
1
- <% if @refund_info.present? %>
2
- <table class="table table-striped table-bordered table-condensed">
3
- <thead>
1
+ <% if @refunds.present? and @refunds.size > 0 %>
2
+ <div class="page-header">
3
+ <h2>Refunds</h2>
4
+ </div>
5
+ <table class="table table-condensed table-striped">
6
+ <thead>
7
+ <tr>
8
+ <th>Refund id</th>
9
+ <th>Payment id</th>
10
+ <th>Amount</th>
11
+ <th>Adjusted?</th>
12
+ <th>Requested date</th>
13
+ <th>Effective date</th>
14
+ <th>Adjustments</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ <% @refunds.each do |refund| %>
4
19
  <tr>
5
- <th>Attribute</th>
6
- <th>Value</th>
7
- </tr>
8
- </thead>
9
- <tbody>
10
- <% @refund_info.keys.sort.each do |key| %>
11
- <tr>
12
- <td><%= key %></td>
13
- <td><%= @refund_info[key] %></td>
20
+ <td><%= refund.refund_id %></td>
21
+ <td><%= link_to refund.payment_id, payment_path(refund.payment_id) %></td>
22
+ <td><%= refund.amount %>&nbsp;<%= refund.currency %></td>
23
+ <td><%= refund.adjusted %></td>
24
+ <td><%= format_date(refund.requested_date).html_safe %></td>
25
+ <td><%= format_date(refund.effective_date).html_safe %></td>
26
+ <td><%= refund.adjustments %></td>
14
27
  </tr>
15
28
  <% end %>
16
- </table>
29
+ </tbody>
30
+ </table>
17
31
  <% else %>
18
32
  <p>Refund info not found</p>
19
33
  <% end %>
@@ -2,6 +2,14 @@
2
2
  <%= form_for(@subscription, :url => subscription_path(@subscription.subscription_id), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
3
3
  <%= f.hidden_field :subscription_id %>
4
4
  <%= f.hidden_field :price_list %>
5
+ <div class="control-group">
6
+ <label class="control-label">Account timezone</label>
7
+ <div class="controls">
8
+ <label class="checkbox">
9
+ <%= @account.timezone %>
10
+ </label>
11
+ </div>
12
+ </div>
5
13
  <div class="control-group">
6
14
  <%= label_tag :current_plan, 'Current plan:', :class => "control-label" %>
7
15
  <div class="controls">
@@ -0,0 +1,45 @@
1
+ <%= form_for(@tag_definition) do |f| %>
2
+ <% if @tag_definition.errors.any? %>
3
+ <div class='alert alert-error'>
4
+ <h2><%= pluralize(@tag_definition.errors.count, 'error') %> prohibited this tag definition from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @tag_definition.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <% unless @tag_definition.new_record? %>
15
+ <div class='control-group'>
16
+ <%= f.label :id, 'Id:', :class => 'control-label' %>
17
+ <div class='controls'>
18
+ <%= f.text_field :id, :class => 'input-xlarge disabled', :readonly => true %>
19
+ </div>
20
+ </div>
21
+ <% end %>
22
+ <div class='control-group'>
23
+ <%= f.label :name, 'Name:', :class => 'control-label' %>
24
+ <div class='controls'>
25
+ <% unless @tag_definition.new_record? %>
26
+ <%= f.text_field :name, :class => 'input-large disabled', :readonly => true %>
27
+ <% else %>
28
+ <%= f.text_field :name %>
29
+ <% end %>
30
+ </div>
31
+ </div>
32
+ <div class='control-group'>
33
+ <%= f.label :description, 'Description:', :class => 'control-label' %>
34
+ <div class='controls'>
35
+ <%= f.text_field :description, :class => 'input-xxlarge' %>
36
+ </div>
37
+ </div>
38
+ <div class='form-actions'>
39
+ <%= f.submit @tag_definition.new_record? ? 'Create' : 'Update', :class => 'btn btn-primary' %>
40
+ <% unless @tag_definition.new_record? %>
41
+ <%= link_to 'Show', @tag_definition, :class => 'btn' %>
42
+ <% end %>
43
+ <%= link_to 'Back', :back, :class => 'btn' %>
44
+ </div>
45
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h2>Update tag definition</h2>
2
+
3
+ <%= render 'form' %>
@@ -0,0 +1,34 @@
1
+ <h2>Tag definitions</h2>
2
+
3
+ <table id='invoice_table' class='table table-condensed data-table'>
4
+ <thead>
5
+ <tr>
6
+ <th style='width: 30%'>Id</th>
7
+ <th style='width: 20%'>Name</th>
8
+ <th style='width: 35%'>Description</th>
9
+ <th style='width: 5%'></th>
10
+ <!-- <th style='width: 5%'></th> -->
11
+ <th style='width: 5%'></th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <% @tag_definitions.each do |tag_definition| %>
16
+ <tr>
17
+ <td><%= tag_definition.id %></td>
18
+ <td><%= tag_definition.name %></td>
19
+ <td><%= tag_definition.description %></td>
20
+ <td><%= link_to 'Show', tag_definition %></td>
21
+ <!-- ><td><%= link_to 'Edit', edit_tag_definition_path(tag_definition) %></td> -->
22
+ <td>
23
+ <% unless tag_definition.is_system_tag? %>
24
+ <%= link_to 'Destroy', tag_definition, confirm: 'Are you sure?', method: :delete %>
25
+ <% end %>
26
+ </td>
27
+ </tr>
28
+ <% end %>
29
+ </tbody>
30
+ </table>
31
+
32
+ <br />
33
+
34
+ <%= link_to 'New Tag definition', new_tag_definition_path, :class => 'btn btn-primary' %>
@@ -0,0 +1,3 @@
1
+ <h1>New tag definition</h1>
2
+
3
+ <%= render 'form' %>
@@ -0,0 +1,12 @@
1
+ <h2>Tag definition</h2>
2
+ <dl class='dl-horizontal'>
3
+ <dt>Id:</dt>
4
+ <dd><%= @tag_definition.id %>&nbsp;</dd>
5
+ <dt>Name:</dt>
6
+ <dd><%= @tag_definition.name %>&nbsp;</dd>
7
+ <dt>Description:</dt>
8
+ <dd><%= @tag_definition.description %>&nbsp;</dd>
9
+ </dl>
10
+
11
+ <!-- <%= link_to 'Edit', edit_tag_definition_path(@tag_definition), :class => 'btn btn-primary' %> -->
12
+ <%= link_to 'Back', tag_definitions_path, :class => 'btn' %>
@@ -1,10 +1,10 @@
1
1
  <dt>Tags:</dt>
2
2
  <dd>
3
3
  <% if tags.present? %>
4
- <% tags.sort.each_with_index do |tag, idx| %>
5
- <span><%= tag %><% if idx < tags.length - 1 %>, <% end %></span>
4
+ <% tags.each_with_index do |tag, idx| %>
5
+ <span><%= tag.tag_definition_name %><% if idx < tags.length - 1 %>, <% end %></span>
6
6
  <% end %>
7
7
  <br/>
8
8
  <% end %>
9
- <%= link_to 'Add/Remove', tags_url_or_path, :class => "btn btn-mini" %>
9
+ <%= link_to 'Add/Remove', tags_url_or_path, :class => 'btn btn-mini' %>
10
10
  </dd>
@@ -0,0 +1,3 @@
1
+ en:
2
+ account: "Account"
3
+ unknown_bcd: "Unknown bill cycle day"
@@ -0,0 +1,3 @@
1
+ fr:
2
+ account: "Compte"
3
+ unknown_timezone: "Journée de facturation inconnue"
data/config/routes.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  Kaui::Engine.routes.draw do
2
+ resources :tag_definitions
3
+
2
4
  root :to => "home#index"
3
5
 
4
6
  resources :accounts, :only => [ :index, :show ] do
@@ -16,6 +18,8 @@ Kaui::Engine.routes.draw do
16
18
  post :refunds, :as => "refunds"
17
19
  post :chargebacks, :as => "chargebacks"
18
20
  post :credits, :as => "credits"
21
+ post :payments, :as => "payments"
22
+ post :charges, :as => "charges"
19
23
  end
20
24
  end
21
25
 
@@ -23,11 +27,15 @@ Kaui::Engine.routes.draw do
23
27
 
24
28
  resources :credits, :only => [ :create, :new ]
25
29
 
30
+ resources :charges, :only => [ :create, :new ]
31
+
26
32
  resources :external_payments, :only => [ :create, :new ]
27
33
 
34
+ resources :payments, :only => [ :create, :new, :index, :show ]
35
+
28
36
  resources :payment_methods, :only => [ :show, :destroy ]
29
37
 
30
- resources :refunds, :only => [ :show, :create, :new ]
38
+ resources :refunds, :only => [ :index, :show, :create, :new ]
31
39
 
32
40
  resources :invoices, :only => [ :index, :show ] do
33
41
  member do
@@ -35,6 +43,8 @@ Kaui::Engine.routes.draw do
35
43
  end
36
44
  end
37
45
 
46
+ resources :invoice_items, :only => [ :index, :show, :edit, :update ]
47
+
38
48
  resources :bundles, :only => [ :index, :show ] do
39
49
  member do
40
50
  put :do_transfer
data/lib/kaui/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,3 +1,13 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
+
4
+ before_filter :set_locale
5
+
6
+ def set_locale
7
+ I18n.locale = params[:locale] || I18n.default_locale
8
+ end
9
+
10
+ def current_user
11
+ "dummy"
12
+ end
3
13
  end
@@ -1,14 +1,47 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
3
+ <head>
4
+ <title>Kaui Dummy app</title>
5
+ <%= stylesheet_link_tag "application", "bootstrap.v2.0.4.min.css", :media => "all" %>
6
+ <%= javascript_include_tag "application", "bootstrap.v2.0.4.min.js", "jquery.dataTables.v1.9.3.min.js" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+ <div class="navbar">
11
+ <div class="navbar-inner">
12
+ <div class="container">
13
+ <ul class="nav">
14
+ <li <%= "class='active'" if params[:controller] == 'accounts' %>><%= link_to "Accounts", kaui_engine.accounts_path %></li>
15
+ <li <%= "class='active'" if params[:controller] == 'account_timelines' %>><%= link_to "Account timelines", kaui_engine.account_timelines_path %></li>
16
+ <li <%= "class='active'" if params[:controller] == 'bundles' %>><%= link_to "Bundles", kaui_engine.bundles_path %></li>
17
+ <li <%= "class='active'" if params[:controller] == 'subscriptions' %>><%= link_to "Subscriptions", kaui_engine.subscriptions_path %></li>
18
+ <li <%= "class='active'" if params[:controller] == 'chargebacks' %>><%= link_to "Chargebacks", kaui_engine.chargebacks_path %></li>
19
+ <li <%= "class='active'" if params[:controller] == 'credits' %>><%= link_to "Credits", kaui_engine.credits_path %></li>
20
+ <li <%= "class='active'" if params[:controller] == 'external_payments' %>><%= link_to "External payments", kaui_engine.external_payments_path %></li>
21
+ <li <%= "class='active'" if params[:controller] == 'refunds' %>><%= link_to "Refunds", kaui_engine.refunds_path %></li>
22
+ <li <%= "class='active'" if params[:controller] == 'invoices' %>><%= link_to "Invoices", kaui_engine.invoices_path %></li>
23
+ <li <%= "class='active'" if params[:controller] == 'invoice_items' %>><%= link_to "Invoice items", kaui_engine.invoice_items_path %></li>
24
+ <li <%= "class='active'" if params[:controller] == 'tag_definitions' %>><%= link_to "Tag definitions", kaui_engine.tag_definitions_path %></li>
25
+ </ul>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ <div class="container">
30
+ <% if flash[:error] %>
31
+ <div class="row-fluid">
32
+ <div class="span12">
33
+ <div class="alert alert-error"><%= flash[:error] %></div>
34
+ </div>
35
+ </div>
36
+ <% end %>
37
+ <% if flash[:notice] %>
38
+ <div class="row-fluid">
39
+ <div class="span12">
40
+ <div class="alert alert-info"><%= flash[:notice] %></div>
41
+ </div>
42
+ </div>
43
+ <% end %>
44
+ <%= yield %>
45
+ </div>
46
+ </body>
14
47
  </html>