lago-ruby-client 1.11.0 → 1.16.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 356570945e40d6e4e5d6226878bb74f3aad7e28010b78f91f32d25b45bf8374f
|
4
|
+
data.tar.gz: 744c2cd11920c792129340f703d32b87a5f0de91c4b472936505336c418cb92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3a3b6cc44d5e0aee7de6e7e094f98a0678ea84e8a5ecd2724c998818d7920796e150ebe6f1be46f9e7603c07e1fe4147349a7eb18e5670d290544253cd9293
|
7
|
+
data.tar.gz: 5224dd0c15d79de5777985981d8de7ab14e7c22c2d60c49a322bb88b85f2ad27209d8e123c5c72300044653db206ec9eb979cb8689f9809b8b3eb5e72e0b0d27
|
@@ -12,6 +12,15 @@ module Lago
|
|
12
12
|
'billable_metric'
|
13
13
|
end
|
14
14
|
|
15
|
+
def evaluate_expression(params)
|
16
|
+
uri = URI("#{client.base_api_url}#{api_resource}/evaluate_expression")
|
17
|
+
|
18
|
+
payload = whitelist_evalute_expression_params(params)
|
19
|
+
response = connection.post(payload, uri)['expression_result']
|
20
|
+
|
21
|
+
JSON.parse(response.to_json, object_class: OpenStruct)
|
22
|
+
end
|
23
|
+
|
15
24
|
def whitelist_params(params)
|
16
25
|
{
|
17
26
|
root_name => {
|
@@ -22,7 +31,23 @@ module Lago
|
|
22
31
|
aggregation_type: params[:aggregation_type],
|
23
32
|
weighted_interval: params[:weighted_interval],
|
24
33
|
field_name: params[:field_name],
|
34
|
+
expression: params[:expression],
|
25
35
|
filters: params[:filters],
|
36
|
+
rounding_function: params[:rounding_function],
|
37
|
+
rounding_precision: params[:rounding_precision],
|
38
|
+
}.compact,
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
def whitelist_evalute_expression_params(params)
|
43
|
+
event = params[:event] || {}
|
44
|
+
|
45
|
+
{
|
46
|
+
expression: params[:expression],
|
47
|
+
event: {
|
48
|
+
code: event[:code],
|
49
|
+
timestamp: event[:timestamp],
|
50
|
+
properties: event[:properties],
|
26
51
|
}.compact,
|
27
52
|
}
|
28
53
|
end
|
@@ -65,6 +65,9 @@ module Lago
|
|
65
65
|
tax_identification_number: params[:tax_identification_number],
|
66
66
|
logo_url: params[:logo_url],
|
67
67
|
name: params[:name],
|
68
|
+
firstname: params[:firstname],
|
69
|
+
lastname: params[:lastname],
|
70
|
+
customer_type: params[:customer_type],
|
68
71
|
phone: params[:phone],
|
69
72
|
state: params[:state],
|
70
73
|
url: params[:url],
|
@@ -121,7 +124,12 @@ module Lago
|
|
121
124
|
|
122
125
|
(integration_customers || []).each do |m|
|
123
126
|
result = (m || {})
|
124
|
-
.slice(:id,
|
127
|
+
.slice(:id,
|
128
|
+
:external_customer_id,
|
129
|
+
:integration_type,
|
130
|
+
:integration_code,
|
131
|
+
:subsidiary_id,
|
132
|
+
:sync_with_provider)
|
125
133
|
|
126
134
|
processed_integration_customers << result unless result.empty?
|
127
135
|
end
|
@@ -43,6 +43,7 @@ module Lago
|
|
43
43
|
code: params[:code],
|
44
44
|
timestamp: params[:timestamp],
|
45
45
|
external_subscription_id: params[:external_subscription_id],
|
46
|
+
precise_total_amount_cents: params[:precise_total_amount_cents],
|
46
47
|
properties: params[:properties],
|
47
48
|
}.compact,
|
48
49
|
}
|
@@ -59,6 +60,7 @@ module Lago
|
|
59
60
|
root_name => {
|
60
61
|
code: params[:code],
|
61
62
|
external_subscription_id: params[:external_subscription_id],
|
63
|
+
precise_total_amount_cents: params[:precise_total_amount_cents],
|
62
64
|
properties: params[:properties],
|
63
65
|
}.compact,
|
64
66
|
}
|
@@ -25,6 +25,7 @@ module Lago
|
|
25
25
|
pay_in_advance: params[:pay_in_advance],
|
26
26
|
bill_charges_monthly: params[:bill_charges_monthly],
|
27
27
|
tax_codes: params[:tax_codes],
|
28
|
+
cascade_updates: params[:cascade_updates],
|
28
29
|
}.compact
|
29
30
|
|
30
31
|
whitelist_charges(params[:charges]).tap do |charges|
|
data/lib/lago/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lago-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lovro Colic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.3.
|
183
|
+
rubygems_version: 3.3.27
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: Lago Rest API client
|