killbill-aviate 2.2.0.pre.1 → 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 +4 -4
- data/app/controllers/aviate/wallets_controller.rb +7 -7
- data/app/services/aviate/wallet.rb +14 -3
- data/app/services/aviate/wallet_api.rb +1 -11
- data/config/routes.rb +1 -1
- data/lib/aviate/version.rb +1 -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: 739fc78e3a730813dbd298c5510e7fe1e37ea99e74ff61e097e4dab58908637b
|
|
4
|
+
data.tar.gz: c6561964d12e49441049e59adb9d0d7d770f09907b9e53c46a96170e19adb288
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
data/lib/aviate/version.rb
CHANGED
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.
|
|
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-
|
|
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
|