killbill-aviate 2.2.0 → 2.3.0.pre.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34375bae0941a64f0c51dd86b7270c7d4935d18eba0ffd6589c43cb8beb443ca
4
- data.tar.gz: f505e30e4994a7ddec6236374199e16932879d2bb46f717774d644886c09af76
3
+ metadata.gz: 5914b364115e78bab734ddfb0411ad46135f211a60bc3e0459fa7cc4a74ec568
4
+ data.tar.gz: c50e89a47dbfc2b011a036b83936478d68bf38f86bca9fbe5a337f5b36f0535c
5
5
  SHA512:
6
- metadata.gz: 76787dd3684a70dbc6b5aad7562c7db36a5754e16e6dfa0123252953cda9efa3f70c69a9d6711eb0a4547bb3b5afd49339d7b3898ec5d9c607161eea98e0587a
7
- data.tar.gz: a9de156f85783898b8fc197014e20c0822dc956173d4ffc73381e068e58d0aed895532de7bc851eb8015fa96efa1f6fa16cbc45d50120abfebd0cbcbf3e80248
6
+ metadata.gz: 16a38cffd4d769435de74fd1d1a8c59708ca6e99fc10798db0cce73365c1ca4295a982208e1d12a123619e404368e3f5c2f560d4a5a5f2d334b1803311836872
7
+ data.tar.gz: e3fe97aee511a1655ffd4348c386a8300711ebefa5e10aeeba3ce1f9ea06e13273e912161b0b13e1ee152ed53ed188d5286af801b9c03274820bcd96ba0ab1d1
@@ -14,3 +14,45 @@
14
14
  padding-top: 15px;
15
15
  visibility: hidden;
16
16
  }
17
+
18
+ .wallet-tooltip {
19
+ display: inline-flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ width: 1.5rem;
23
+ margin: 0 0.25rem 0 0.5rem;
24
+ flex-shrink: 0;
25
+ position: relative;
26
+ cursor: help;
27
+ }
28
+
29
+ .wallet-tooltip:hover::after,
30
+ .wallet-tooltip:focus::after {
31
+ position: absolute;
32
+ bottom: calc(100% + 8px);
33
+ right: 0;
34
+ background: #333;
35
+ color: #fff;
36
+ padding: 6px 10px;
37
+ border-radius: 4px;
38
+ font-size: 12px;
39
+ line-height: 1.4;
40
+ width: 280px;
41
+ white-space: normal;
42
+ text-align: left;
43
+ z-index: 1050;
44
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
45
+ pointer-events: none;
46
+ }
47
+
48
+ .wallet-tooltip:hover::before,
49
+ .wallet-tooltip:focus::before {
50
+ content: '';
51
+ position: absolute;
52
+ bottom: calc(100% + 3px);
53
+ right: 0.5rem;
54
+ border: 5px solid transparent;
55
+ border-top-color: #333;
56
+ z-index: 1051;
57
+ pointer-events: none;
58
+ }
@@ -12,6 +12,13 @@ module Aviate
12
12
  @limit = params[:limit] || 5
13
13
  end
14
14
 
15
+ def show
16
+ wallets = Aviate::WalletApi.retrieve_wallets(params['account_id'], options_for_klient)
17
+ @wallet = wallets.find { |wallet| wallet['walletId'] == params['id'] }
18
+ @wallet = Aviate::Wallet.from_api_response(@wallet)
19
+ @wallet
20
+ end
21
+
15
22
  def new
16
23
  @currency = @account.currency
17
24
  end
@@ -34,13 +41,6 @@ module Aviate
34
41
  redirect_to account_wallets_path(@account.account_id)
35
42
  end
36
43
 
37
- def show
38
- wallets = Aviate::WalletApi.retrieve_wallets(params['account_id'], options_for_klient)
39
- @wallet = wallets.find { |wallet| wallet['walletId'] == params['id'] }
40
- @wallet = Aviate::Wallet.from_api_response(@wallet)
41
- @wallet
42
- end
43
-
44
44
  def create
45
45
  cached_options_for_klient = options_for_klient
46
46
  wallet = {
@@ -30,16 +30,27 @@ module Aviate
30
30
  balance: response['balance'],
31
31
  live_balance: response['liveBalance'],
32
32
  credit_type: response['creditType'],
33
- amount: response['amount'],
33
+ amount: parse_numeric(response['amount']),
34
34
  exp_date: response['expDate'],
35
35
  top_off_type: response['topOff']['topOffType'],
36
- low_watermark: response['topOff']['lowWatermark'],
37
- top_off_amount: response['topOff']['amount'],
36
+ low_watermark: parse_numeric(response['topOff']['lowWatermark']),
37
+ top_off_amount: parse_numeric(response['topOff']['amount']),
38
38
  exp_duration_unit: response['topOff']['expDurationUnit'],
39
39
  exp_duration_length: response['topOff']['expDurationLength']
40
40
  }
41
41
  end
42
42
 
43
+ def self.parse_numeric(value)
44
+ return nil if value.nil?
45
+
46
+ string_value = value.to_s
47
+ return nil if string_value.strip.empty?
48
+
49
+ BigDecimal(string_value).to_f
50
+ rescue ArgumentError
51
+ nil
52
+ end
53
+
43
54
  def to_api_params
44
55
  {
45
56
  currency: @currency,
@@ -3,17 +3,7 @@
3
3
  module Aviate
4
4
  module WalletApi
5
5
  class << self
6
- def retrieve_wallets(account_id, options_for_klient)
7
- Killbill::Aviate::AviateClient.retrieve_wallets(account_id, options_for_klient)
8
- end
9
-
10
- def create_wallet(account_id, wallet, options_for_klient)
11
- Killbill::Aviate::AviateClient.create_wallet(account_id, wallet, options_for_klient)
12
- end
13
-
14
- def modify_wallet(wallet_params, options_for_klient)
15
- Killbill::Aviate::AviateClient.modify_wallet(wallet_params, options_for_klient)
16
- end
6
+ delegate :retrieve_wallets, :create_wallet, :modify_wallet, to: :'Killbill::Aviate::AviateClient'
17
7
  end
18
8
  end
19
9
  end
@@ -14,24 +14,27 @@
14
14
  <div class="form-group d-flex pb-3">
15
15
  <%= label_tag :credit_type, 'Credit Type', :class => 'col-sm-3 control-label' %>
16
16
  <div class="col-sm-9">
17
- <%= select_tag :credit_type,
18
- options_for_select(['CREDIT_PAID', 'CREDIT_FREE'], @wallet.try(:[], :credit_type)),
17
+ <%= select_tag :credit_type,
18
+ options_for_select(['CREDIT_PAID', 'CREDIT_FREE'], @wallet.try(:[], :credit_type)),
19
19
  :class => 'form-control',
20
20
  :disabled => local_assigns[:readonly],
21
21
  required: true %>
22
22
  </div>
23
+ <span class="wallet-tooltip" data-tooltip="Identifies the source or purpose of the credit. Use CREDIT_PAID for purchased credits or CREDIT_FREE for promotional credits."><i class="fa fa-info-circle text-muted"></i></span>
23
24
  </div>
24
25
  <div class="form-group d-flex pb-3">
25
26
  <%= label_tag :amount, 'Amount', :class => 'col-sm-3 control-label' %>
26
27
  <div class="col-sm-9">
27
28
  <%= number_field_tag :amount, @wallet.try(:[], :amount), :class => 'form-control', :step => '0.01', :min => '0', required: true %>
28
29
  </div>
30
+ <span class="wallet-tooltip" tabindex="0" aria-label="The amount of credit to add to the wallet when it is created." data-tooltip="The amount of credit to add to the wallet when it is created."><i class="fa fa-info-circle text-muted"></i></span>
29
31
  </div>
30
32
  <div class="form-group d-flex pb-3">
31
33
  <%= label_tag :exp_date, 'Expiration Date', :class => 'col-sm-3 control-label' %>
32
34
  <div class="col-sm-9">
33
- <%= date_field_tag :exp_date, @wallet.try(:[], :exp_date), class: 'form-control', id: 'exp_date_input', required: true %>
35
+ <%= date_field_tag :exp_date, @wallet.try(:[], :exp_date), class: 'form-control', id: 'exp_date_input' %>
34
36
  </div>
37
+ <span class="wallet-tooltip" data-tooltip="Optional. The date after which the initial credit can no longer be used. Leave blank if the credit should never expire."><i class="fa fa-info-circle text-muted"></i></span>
35
38
  </div>
36
39
  <% end %>
37
40
 
@@ -39,40 +42,45 @@
39
42
  <div class="form-group d-flex pb-3">
40
43
  <%= label_tag :top_off_type, 'Top Off Type', :class => 'col-sm-3 control-label' %>
41
44
  <div class="col-sm-9">
42
- <%= select_tag :top_off_type,
43
- options_for_select(['TOP_OFF_FIXED', 'TOP_OFF_TARGET'], @wallet.try(:[], :top_off_type)),
45
+ <%= select_tag :top_off_type,
46
+ options_for_select(['TOP_OFF_FIXED', 'TOP_OFF_TARGET'], @wallet.try(:[], :top_off_type)),
44
47
  :class => 'form-control',
45
48
  :disabled => local_assigns[:readonly],
46
49
  required: true %>
47
50
  </div>
51
+ <span class="wallet-tooltip" data-tooltip="Defines how credits are replenished when the wallet balance falls below the Low Water Mark. Use TOP_OFF_FIXED to add a fixed amount of credit, or TOP_OFF_TARGET to restore the balance to a specified target amount."><i class="fa fa-info-circle text-muted"></i></span>
48
52
  </div>
49
53
  <div class="form-group d-flex pb-3">
50
54
  <%= label_tag :low_watermark, 'Low Water Mark', :class => 'col-sm-3 control-label' %>
51
55
  <div class="col-sm-9">
52
56
  <%= text_field_tag :low_watermark, @wallet.try(:[], :low_watermark), :class => 'form-control', required: true %>
53
57
  </div>
58
+ <span class="wallet-tooltip" data-tooltip="The minimum wallet balance that triggers an automatic top-up. When the balance drops below this value, additional credit is added automatically."><i class="fa fa-info-circle text-muted"></i></span>
54
59
  </div>
55
60
  <div class="form-group d-flex pb-3">
56
61
  <%= label_tag :top_off_amount, 'Amount', :class => 'col-sm-3 control-label' %>
57
62
  <div class="col-sm-9">
58
63
  <%= number_field_tag :top_off_amount, @wallet.try(:[], :top_off_amount), :class => 'form-control', :step => '0.01', :min => '0', required: true %>
59
64
  </div>
65
+ <span class="wallet-tooltip" data-tooltip="The amount of credit added during an automatic top-up."><i class="fa fa-info-circle text-muted"></i></span>
60
66
  </div>
61
67
  <div class="form-group d-flex pb-3">
62
68
  <%= label_tag :exp_duration_unit, 'Expiration Duration Unit', :class => 'col-sm-3 control-label pe-3' %>
63
69
  <div class="col-sm-9">
64
- <%= select_tag :exp_duration_unit,
65
- options_for_select(['DAYS', 'WEEKS', 'MONTHS', 'YEARS'], @wallet.try(:[], :exp_duration_unit)),
70
+ <%= select_tag :exp_duration_unit,
71
+ options_for_select(['DAYS', 'WEEKS', 'MONTHS', 'YEARS'], @wallet.try(:[], :exp_duration_unit)),
66
72
  :class => 'form-control',
67
73
  :disabled => local_assigns[:readonly],
68
74
  required: true %>
69
75
  </div>
76
+ <span class="wallet-tooltip" data-tooltip="The time unit used when calculating the expiration period for credits added through automatic top-ups."><i class="fa fa-info-circle text-muted"></i></span>
70
77
  </div>
71
78
  <div class="form-group d-flex pb-4">
72
79
  <%= label_tag :exp_duration_length, 'Expiration Duration Length', :class => 'col-sm-3 control-label' %>
73
80
  <div class="col-sm-9">
74
81
  <%= number_field_tag :exp_duration_length, @wallet.try(:[], :exp_duration_length), :class => 'form-control', required: true %>
75
82
  </div>
83
+ <span class="wallet-tooltip" data-tooltip="Duration length for credit expiration from the time of issuance."><i class="fa fa-info-circle text-muted"></i></span>
76
84
  </div>
77
85
 
78
86
  <div class="form-group d-flex justify-content-end pt-3 border-top">
data/config/routes.rb CHANGED
@@ -4,7 +4,7 @@ Aviate::Engine.routes.draw do
4
4
  root to: 'configuration#index', as: 'aviate_root'
5
5
 
6
6
  scope '/configuration' do
7
- match '/session_create' => 'configuration#session_create', :via => :post, :as => 'aviate_session_create'
7
+ post '/session_create' => 'configuration#session_create', :as => 'aviate_session_create'
8
8
  match '/session_destroy' => 'configuration#session_destroy', :via => %i[get delete], :as => 'aviate_session_destroy'
9
9
  end
10
10
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aviate
4
- VERSION = '2.2.0'
4
+ VERSION = '2.3.0.pre.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-aviate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0.pre.2
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: 2026-02-11 00:00:00.000000000 Z
11
+ date: 2026-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: killbill-assets-ui
@@ -114,9 +114,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">="
117
+ - - ">"
118
118
  - !ruby/object:Gem::Version
119
- version: '0'
119
+ version: 1.3.1
120
120
  requirements: []
121
121
  rubygems_version: 3.4.10
122
122
  signing_key: