kaui 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/kaui/account_timelines_controller.rb +4 -4
- data/app/controllers/kaui/accounts_controller.rb +2 -2
- data/app/controllers/kaui/engine_controller.rb +1 -0
- data/app/helpers/kaui/account_helper.rb +6 -0
- data/app/models/kaui/account.rb +2 -2
- data/app/models/kaui/rails_methods.rb +2 -0
- data/app/views/kaui/layouts/kaui_account_navbar.html.erb +3 -0
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf7ea372356e996b5fc77a5626f3f3842afcc2b2dce9327f9bca8f0ffaad8b78
|
4
|
+
data.tar.gz: 398c7541e8545b5a38516e3a1ddf5601335a305d55f5e952879aee05eaa6d113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea1290c241b5eff5135e0336c8d0102bb683179b035b3bdea84488547d8ba277b5cfbc556721697c566153d1fa513dc493291da606e9b0b2c380e1bb53ec491d
|
7
|
+
data.tar.gz: feb7fce03adcc134ba0990b183d5f17967de1a0057329ffba850a616115ae424fc81519f7356d999da3c460d0555431b24b4490c36ae2a51fc3e798ee472d710
|
@@ -85,7 +85,7 @@ module Kaui
|
|
85
85
|
invoice_details << "Refund adjustment: #{invoice.refund_adjustment_to_money} (#{@account.currency})" if invoice.refund_adj.present? && invoice.refund_adj.negative?
|
86
86
|
invoice_details << "Invoice #: #{invoice.invoice_number}"
|
87
87
|
audit_logs = invoice_stub.audit_logs.present? ? invoice_stub.audit_logs.map { |entry| Kaui::AuditLog.description(entry) }.join(', ') : ''
|
88
|
-
csv << [target_date, bundle_keys, 'INVOICE', invoice_details.join('; '), audit_logs] if filter_date(target_date, start_date, end_date)
|
88
|
+
csv << [target_date, bundle_keys, 'INVOICE', invoice_details.join('; '), audit_logs] if filter_date?(target_date, start_date, end_date)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
if %w[PAYMENT ALL].include?(event_type)
|
@@ -108,7 +108,7 @@ module Kaui
|
|
108
108
|
|
109
109
|
audit_logs = transaction.audit_logs.present? ? transaction.audit_logs.map { |entry| Kaui::AuditLog.description(entry) }.chunk { |x| x }.map(&:first).join(', ') : ''
|
110
110
|
|
111
|
-
csv << [effective_date, bundle_keys, transaction_type, details.join('; '), audit_logs] if filter_date(effective_date, start_date, end_date)
|
111
|
+
csv << [effective_date, bundle_keys, transaction_type, details.join('; '), audit_logs] if filter_date?(effective_date, start_date, end_date)
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -126,7 +126,7 @@ module Kaui
|
|
126
126
|
phase = event.phase
|
127
127
|
audit_logs = event.audit_logs.present? ? event.audit_logs.map { |entry| Kaui::AuditLog.description(entry) }.join(', ') : ''
|
128
128
|
|
129
|
-
csv << [effective_date, bundle_keys, event_type, phase, audit_logs] if filter_date(effective_date, start_date, end_date)
|
129
|
+
csv << [effective_date, bundle_keys, event_type, phase, audit_logs] if filter_date?(effective_date, start_date, end_date)
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
@@ -138,7 +138,7 @@ module Kaui
|
|
138
138
|
|
139
139
|
private
|
140
140
|
|
141
|
-
def filter_date(target_date, start_date, end_date)
|
141
|
+
def filter_date?(target_date, start_date, end_date)
|
142
142
|
return true if start_date.nil? || end_date.nil?
|
143
143
|
|
144
144
|
target_date = begin
|
@@ -106,9 +106,9 @@ module Kaui
|
|
106
106
|
def create
|
107
107
|
@account = Kaui::Account.new(params.require(:account).delete_if { |_key, value| value.blank? })
|
108
108
|
|
109
|
-
@account.errors.add(:phone, :invalid_phone) if !@account.phone.nil? && !@account.check_account_details_phone
|
109
|
+
@account.errors.add(:phone, :invalid_phone) if !@account.phone.nil? && !@account.check_account_details_phone?
|
110
110
|
|
111
|
-
@account.errors.add(:check_account_details_bill_cycle_day_local, :invalid_bill_cycle_day_local) if !@account.bill_cycle_day_local.nil? && !@account.check_account_details_bill_cycle_day_local
|
111
|
+
@account.errors.add(:check_account_details_bill_cycle_day_local, :invalid_bill_cycle_day_local) if !@account.bill_cycle_day_local.nil? && !@account.check_account_details_bill_cycle_day_local?
|
112
112
|
|
113
113
|
unless @account.errors.empty?
|
114
114
|
flash.now[:errors] = @account.errors.messages.values.flatten
|
@@ -16,6 +16,7 @@ class Kaui::EngineController < ApplicationController
|
|
16
16
|
# Pass the X-Request-Id seen by Rails to Kill Bill
|
17
17
|
# Note that this means that subsequent requests issued by a single action will share the same X-Request-Id in Kill Bill
|
18
18
|
user_tenant_options[:request_id] ||= request.request_id
|
19
|
+
user_tenant_options[:jwt_token] ||= session[:jwt_token]
|
19
20
|
user_tenant_options
|
20
21
|
end
|
21
22
|
|
@@ -20,6 +20,12 @@ module Kaui
|
|
20
20
|
false
|
21
21
|
end
|
22
22
|
|
23
|
+
def aviate_plugin_installed
|
24
|
+
Killbill::Aviate::AviateClient.aviate_plugin_installed(Kaui.current_tenant_user_options(current_user, session)).first
|
25
|
+
rescue StandardError
|
26
|
+
false
|
27
|
+
end
|
28
|
+
|
23
29
|
def account_closed?
|
24
30
|
return false if @account.nil?
|
25
31
|
|
data/app/models/kaui/account.rb
CHANGED
@@ -16,13 +16,13 @@ module Kaui
|
|
16
16
|
ADVANCED_SEARCH_COLUMNS = %w[id external_key email name currency parent_account_id pay_via_parent payment_method_id time_zone country postal_code].freeze
|
17
17
|
ADVANCED_SEARCH_NAME_CHANGES = [%w[pay_via_parent is_payment_delegated_to_parent]].freeze
|
18
18
|
|
19
|
-
def check_account_details_phone
|
19
|
+
def check_account_details_phone?
|
20
20
|
return true if phone =~ /\A(?:\+?\d{1,3}\s*-?)?\(?(?:\d{3})?\)?[- ]?\d{3}[- ]?\d{4}\z/i
|
21
21
|
|
22
22
|
false
|
23
23
|
end
|
24
24
|
|
25
|
-
def check_account_details_bill_cycle_day_local
|
25
|
+
def check_account_details_bill_cycle_day_local?
|
26
26
|
return true if bill_cycle_day_local.to_i.between?(1, 31)
|
27
27
|
|
28
28
|
false
|
@@ -32,6 +32,7 @@ module Kaui
|
|
32
32
|
send(attr)
|
33
33
|
end
|
34
34
|
|
35
|
+
# rubocop:disable Naming/PredicateMethod
|
35
36
|
def save
|
36
37
|
@errors.add(:save, 'Saving this object is not yet supported')
|
37
38
|
false
|
@@ -46,6 +47,7 @@ module Kaui
|
|
46
47
|
@errors.add(:destroy, 'Destroying this object is not yet supported')
|
47
48
|
false
|
48
49
|
end
|
50
|
+
# rubocop:enable Naming/PredicateMethod
|
49
51
|
end
|
50
52
|
|
51
53
|
base_class.instance_eval do
|
@@ -4,6 +4,9 @@
|
|
4
4
|
<p><%= pretty_account_identifier %></p>
|
5
5
|
|
6
6
|
<%= link_to 'Account', kaui_engine.account_path(params[:account_id]), :class => (params[:controller].ends_with?('accounts') ? 'current' : 'non-current') %>
|
7
|
+
<% if aviate_plugin_installed %>
|
8
|
+
<%= link_to 'Wallets', aviate_engine.account_wallets_path(params[:account_id]), :class => (params[:controller].ends_with?('wallets') ? 'current' : 'non-current') %>
|
9
|
+
<% end %>
|
7
10
|
<%= link_to 'Subscriptions', kaui_engine.account_bundles_path(params[:account_id]), :class => (params[:controller].ends_with?('bundles') ? 'current' : 'non-current') %>
|
8
11
|
<%= link_to 'Invoices', kaui_engine.account_invoices_path(params[:account_id]), :class => (params[:controller].ends_with?('invoices') ? 'current' : 'non-current') %>
|
9
12
|
<%= link_to 'Payments', kaui_engine.account_payments_path(params[:account_id]), :class => (params[:controller].ends_with?('payments') ? 'current' : 'non-current') %>
|
data/lib/kaui/version.rb
CHANGED
data/lib/kaui.rb
CHANGED
@@ -77,7 +77,8 @@ module Kaui
|
|
77
77
|
|
78
78
|
case attr
|
79
79
|
when 'is_payment_delegated_to_parent', 'is_migrated'
|
80
|
-
|
80
|
+
checked_attr = account&.send(attr.downcase) ? 'checked' : nil
|
81
|
+
"<div style='text-align: center;'><input type='checkbox' class='custom-checkbox' #{checked_attr}></div>"
|
81
82
|
when 'account_id'
|
82
83
|
view_context.link_to(account.account_id, view_context.url_for(action: :show, account_id: account.account_id))
|
83
84
|
when 'parent_account_id'
|
@@ -296,6 +297,7 @@ module Kaui
|
|
296
297
|
password: user.password,
|
297
298
|
session_id: user.kb_session_id
|
298
299
|
}
|
300
|
+
result[:jwt_token] = session[:jwt_token] if session[:jwt_token]
|
299
301
|
if user_tenant
|
300
302
|
result[:api_key] = user_tenant.api_key
|
301
303
|
result[:api_secret] = user_tenant.api_secret
|
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: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|