killbill-aviate 2.2.0 → 2.3.0.pre.1

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: 739fc78e3a730813dbd298c5510e7fe1e37ea99e74ff61e097e4dab58908637b
4
+ data.tar.gz: c6561964d12e49441049e59adb9d0d7d770f09907b9e53c46a96170e19adb288
5
5
  SHA512:
6
- metadata.gz: 76787dd3684a70dbc6b5aad7562c7db36a5754e16e6dfa0123252953cda9efa3f70c69a9d6711eb0a4547bb3b5afd49339d7b3898ec5d9c607161eea98e0587a
7
- data.tar.gz: a9de156f85783898b8fc197014e20c0822dc956173d4ffc73381e068e58d0aed895532de7bc851eb8015fa96efa1f6fa16cbc45d50120abfebd0cbcbf3e80248
6
+ metadata.gz: fea6ddfece26d879ef262a472c356168cb23972e1db59715fe3ae353fa5d861eca42710415d568b06e38417c5cdce05a9680040ee7ca8788b80381f14579663b
7
+ data.tar.gz: c01c55eb6e4ecb3f69a7ed717141828374e496f3d618a6bdf5a8375328532edbd004f807de78b0838f6ec36624739855029c20781d8ab2f5b67402792d58da86
@@ -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
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.1'
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.1
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-04-08 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: