diff --git a/lib/lago/api/resources/customer.rb b/lib/lago/api/resources/customer.rb index 723d462..9196a54 100644 --- a/lib/lago/api/resources/customer.rb +++ b/lib/lago/api/resources/customer.rb @@ -65,6 +65,9 @@ def whitelist_params(params) tax_identification_number: params[:tax_identification_number], logo_url: params[:logo_url], name: params[:name], + firstname: params[:firstname], + lastname: params[:lastname], + customer_type: params[:customer_type], phone: params[:phone], state: params[:state], url: params[:url], @@ -121,7 +124,12 @@ def whitelist_integration_customers(integration_customers) (integration_customers || []).each do |m| result = (m || {}) - .slice(:id, :external_customer_id, :integration_type, :integration_code, :subsidiary_id, :sync_with_provider) + .slice(:id, + :external_customer_id, + :integration_type, + :integration_code, + :subsidiary_id, + :sync_with_provider) processed_integration_customers << result unless result.empty? end diff --git a/spec/factories/customer.rb b/spec/factories/customer.rb index 6b54d5a..86cd428 100644 --- a/spec/factories/customer.rb +++ b/spec/factories/customer.rb @@ -4,6 +4,9 @@ factory :create_customer, class: OpenStruct do external_id { '1a901a90-1a90-1a90-1a90-1a901a901a90' } name { 'Gavin Belson' } + firstname { 'Gavin' } + lastname { 'Belson' } + customer_type { 'individual' } country { 'US' } address_line1 { '5230 Penfield Ave' } address_line2 { 'fzufuzfuz' } @@ -41,11 +44,11 @@ integration_customers do [ { - integration_type: "netsuite", - integration_code: "test-123", - subsidiary_id: "2", - sync_with_provider: true - } + integration_type: 'netsuite', + integration_code: 'test-123', + subsidiary_id: '2', + sync_with_provider: true, + }, ] end metadata do diff --git a/spec/fixtures/api/customer.json b/spec/fixtures/api/customer.json index e6d237a..0211294 100644 --- a/spec/fixtures/api/customer.json +++ b/spec/fixtures/api/customer.json @@ -14,6 +14,9 @@ "tax_identification_number": "EU123456789", "logo_url": "http://hooli.com/logo.png", "name": "Gavin Belson", + "firstname": "Gavin", + "lastname": "Belson", + "customer_type": "individual", "phone": "1-171-883-3711 x245", "state": "CA", "url": "http://hooli.com",