lago-ruby-client 1.6.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f973fe617bed4806811f92a62a21cfb3d695726f2d73e2a69ae1ee1dac2a9758
4
- data.tar.gz: 596685fab05c14e0e2886987fd8180408812f3b4ca0bdea7c69f7b521b6d45db
3
+ metadata.gz: a06a434d612dac4dd28908f0c6efe459971a21c9f0c75f21c7f3dbe7990e7c43
4
+ data.tar.gz: b46ff9ebe47cda0d112a16d40b9609a86634afde49aaa90b577e0fb46a2e8eac
5
5
  SHA512:
6
- metadata.gz: c76af0008afb6b25aa1c6bcd8f2a3d89287aa46d326954888d5d7d979da1e6f38458ce60204a00a933bc5c173a71881135ca4c148fd1795a7f2f8def434c7f7f
7
- data.tar.gz: 81a9260248f2bf7ed4903cbdb05a324ba4f43753afa9378c41f27298a0644bbb5a6769987167af2263ac930154bdfaf972c68207898c57e4581d6dc35696df4c
6
+ metadata.gz: 13889c09c6c4ebf582d463554e87113c76f0f216ba83823e192c850597fe80f2416e18472c7773a2f31471ed044a2204596b80a82c3332320172e94ef2cbe8f4
7
+ data.tar.gz: 9bc14fc53e6c21f72644f42a07f9beb799153f1801dd750a62d98bc15a171b7920cd3d51458c9e6f80ec11a6b419bd213c2bbc1fadd25d309a6ffda719354e9d
@@ -39,10 +39,6 @@ module Lago
39
39
  Lago::Api::Resources::Fee.new(self)
40
40
  end
41
41
 
42
- def groups
43
- Lago::Api::Resources::Group.new(self)
44
- end
45
-
46
42
  def applied_coupons
47
43
  Lago::Api::Resources::AppliedCoupon.new(self)
48
44
  end
@@ -22,7 +22,6 @@ module Lago
22
22
  aggregation_type: params[:aggregation_type],
23
23
  weighted_interval: params[:weighted_interval],
24
24
  field_name: params[:field_name],
25
- group: params[:group],
26
25
  filters: params[:filters],
27
26
  }.compact,
28
27
  }
@@ -78,6 +78,10 @@ module Lago
78
78
  result_hash[:billing_configuration] = config unless config.empty?
79
79
  end
80
80
 
81
+ whitelist_shipping_address(params[:shipping_address]).tap do |address|
82
+ result_hash[:shipping_address] = address unless address.empty?
83
+ end
84
+
81
85
  integration_customers = whitelist_integration_customers(params[:integration_customers])
82
86
  result_hash[:integration_customers] = integration_customers unless integration_customers.empty?
83
87
 
@@ -100,6 +104,17 @@ module Lago
100
104
  )
101
105
  end
102
106
 
107
+ def whitelist_shipping_address(address)
108
+ (address || {}).slice(
109
+ :address_line1,
110
+ :address_line2,
111
+ :city,
112
+ :zipcode,
113
+ :state,
114
+ :country,
115
+ )
116
+ end
117
+
103
118
  def whitelist_integration_customers(integration_customers)
104
119
  processed_integration_customers = []
105
120
 
@@ -30,7 +30,6 @@ module Lago
30
30
  {
31
31
  root_name => {
32
32
  transaction_id: params[:transaction_id],
33
- external_customer_id: params[:external_customer_id],
34
33
  code: params[:code],
35
34
  timestamp: params[:timestamp],
36
35
  external_subscription_id: params[:external_subscription_id],
@@ -49,7 +48,6 @@ module Lago
49
48
  {
50
49
  root_name => {
51
50
  code: params[:code],
52
- external_customer_id: params[:external_customer_id],
53
51
  external_subscription_id: params[:external_subscription_id],
54
52
  properties: params[:properties],
55
53
  }.compact,
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lago
4
+ module Api
5
+ module Resources
6
+ class OverdueBalance < Base
7
+ def api_resource
8
+ 'analytics/overdue_balance'
9
+ end
10
+
11
+ def root_name
12
+ 'overdue_balance'
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lago
4
+ module Api
5
+ module Resources
6
+ class PaymentRequest < Base
7
+ def api_resource
8
+ 'payment_requests'
9
+ end
10
+
11
+ def root_name
12
+ 'payment_request'
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -56,10 +56,10 @@ module Lago
56
56
  :charge_model,
57
57
  :pay_in_advance,
58
58
  :invoiceable,
59
+ :regroup_paid_fees,
59
60
  :invoice_display_name,
60
61
  :min_amount_cents,
61
62
  :properties,
62
- :group_properties,
63
63
  :filters,
64
64
  :tax_codes,
65
65
  )
@@ -22,9 +22,8 @@ module Lago
22
22
  billing_time: params[:billing_time],
23
23
  subscription_at: params[:subscription_at],
24
24
  ending_at: params[:ending_at],
25
- subscription_date: params[:subscription_date], # Deprecated
26
25
  plan_overrides: params[:plan_overrides],
27
- }.compact
26
+ }.compact,
28
27
  }
29
28
  end
30
29
  end
@@ -21,6 +21,8 @@ module Lago
21
21
  granted_credits: params[:granted_credits],
22
22
  currency: params[:currency],
23
23
  expiration_at: params[:expiration_at],
24
+ transaction_metadata: params[:transaction_metadata],
25
+ invoice_requires_successful_payment: params[:invoice_requires_successful_payment],
24
26
  }.compact
25
27
 
26
28
  recurring_rules = whitelist_recurring_rules(params[:recurring_transaction_rules])
@@ -38,11 +40,13 @@ module Lago
38
40
  :paid_credits,
39
41
  :granted_credits,
40
42
  :threshold_credits,
43
+ :invoice_requires_successful_payment,
41
44
  :trigger,
42
45
  :interval,
43
46
  :method,
44
47
  :started_at,
45
48
  :target_ongoing_balance,
49
+ :transaction_metadata
46
50
  )
47
51
 
48
52
  processed_rules << result unless result.empty?
@@ -25,7 +25,9 @@ module Lago
25
25
  wallet_id: params[:wallet_id],
26
26
  paid_credits: params[:paid_credits],
27
27
  granted_credits: params[:granted_credits],
28
- voided_credits: params[:voided_credits]
28
+ voided_credits: params[:voided_credits],
29
+ invoice_requires_successful_payment: params[:invoice_requires_successful_payment],
30
+ metadata: params[:metadata],
29
31
  }.compact
30
32
  }
31
33
  end
data/lib/lago/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lago
4
- VERSION = '1.6.0'
4
+ VERSION = '1.9.0'
5
5
  end
@@ -21,12 +21,13 @@ require 'lago/api/resources/customer'
21
21
  require 'lago/api/resources/event'
22
22
  require 'lago/api/resources/fee'
23
23
  require 'lago/api/resources/gross_revenue'
24
- require 'lago/api/resources/group'
25
24
  require 'lago/api/resources/invoice'
26
25
  require 'lago/api/resources/invoice_collection'
27
26
  require 'lago/api/resources/invoiced_usage'
28
27
  require 'lago/api/resources/mrr'
29
28
  require 'lago/api/resources/organization'
29
+ require 'lago/api/resources/overdue_balance'
30
+ require 'lago/api/resources/payment_request'
30
31
  require 'lago/api/resources/plan'
31
32
  require 'lago/api/resources/subscription'
32
33
  require 'lago/api/resources/tax'
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.6.0
4
+ version: 1.9.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-06-27 00:00:00.000000000 Z
11
+ date: 2024-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -143,12 +143,13 @@ files:
143
143
  - lib/lago/api/resources/event.rb
144
144
  - lib/lago/api/resources/fee.rb
145
145
  - lib/lago/api/resources/gross_revenue.rb
146
- - lib/lago/api/resources/group.rb
147
146
  - lib/lago/api/resources/invoice.rb
148
147
  - lib/lago/api/resources/invoice_collection.rb
149
148
  - lib/lago/api/resources/invoiced_usage.rb
150
149
  - lib/lago/api/resources/mrr.rb
151
150
  - lib/lago/api/resources/organization.rb
151
+ - lib/lago/api/resources/overdue_balance.rb
152
+ - lib/lago/api/resources/payment_request.rb
152
153
  - lib/lago/api/resources/plan.rb
153
154
  - lib/lago/api/resources/subscription.rb
154
155
  - lib/lago/api/resources/tax.rb
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lago
4
- module Api
5
- module Resources
6
- class Group < Base
7
- def api_resource
8
- 'groups'
9
- end
10
-
11
- def root_name
12
- 'group'
13
- end
14
-
15
- def get_all(code, options = {})
16
- path = "/api/v1/billable_metrics/#{code}/groups"
17
- response = connection.get_all(options, path)
18
-
19
- JSON.parse(response.to_json, object_class: OpenStruct)
20
- end
21
- end
22
- end
23
- end
24
- end