Class: Lago::Api::Resources::Organization
- Inherits:
-
Base
- Object
- Base
- Lago::Api::Resources::Organization
show all
- Defined in:
- lib/lago/api/resources/organization.rb
Instance Attribute Summary
Attributes inherited from Base
#client
Instance Method Summary
collapse
Methods inherited from Base
#create, #destroy, #get, #get_all, #initialize, #update
Instance Method Details
#api_resource ⇒ Object
7
8
9
|
# File 'lib/lago/api/resources/organization.rb', line 7
def api_resource
'organizations'
end
|
#root_name ⇒ Object
11
12
13
|
# File 'lib/lago/api/resources/organization.rb', line 11
def root_name
'organization'
end
|
#whitelist_billing_configuration(billing_params) ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/lago/api/resources/organization.rb', line 40
def whitelist_billing_configuration(billing_params)
(billing_params || {}).slice(
:invoice_footer,
:invoice_grace_period,
:document_locale,
)
end
|
#whitelist_params(params) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/lago/api/resources/organization.rb', line 15
def whitelist_params(params)
result_hash = {
webhook_url: params[:webhook_url],
webhook_urls: params[:webhook_urls],
country: params[:country],
address_line1: params[:address_line1],
address_line2: params[:address_line2],
state: params[:state],
zipcode: params[:zipcode],
email: params[:email],
city: params[:city],
legal_name: params[:legal_name],
legal_number: params[:legal_number],
tax_identification_number: params[:tax_identification_number],
timezone: params[:timezone],
email_settings: params[:email_settings],
}.compact
whitelist_billing_configuration(params[:billing_configuration]).tap do |config|
result_hash[:billing_configuration] = config unless config.empty?
end
{ root_name => result_hash }
end
|