Skip to content

Commit

Permalink
feat (integration-customers): update integration customer definition (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrocolic authored Jun 25, 2024
1 parent e42362d commit 6aa30ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/lago/api/resources/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def whitelist_integration_customers(integration_customers)

(integration_customers || []).each do |m|
result = (m || {})
.slice(: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
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/api/customer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
},
"integration_customers": [
{
"lago_id": "123asd123lkj987lkj",
"external_customer_id": "123456789",
"integration_type": "netsuite",
"type": "netsuite",
"integration_code": "test-123",
"subsidiary_id": "2",
"sync_with_provider": true
Expand Down
2 changes: 1 addition & 1 deletion spec/lago/api/resources/customer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
expect(customer.billing_configuration.provider_customer_id).to eq('cus_12345')
expect(customer.billing_configuration.provider_payment_methods).to eq(['card'])
expect(customer.integration_customers.first.external_customer_id).to eq('123456789')
expect(customer.integration_customers.first.integration_type).to eq('netsuite')
expect(customer.integration_customers.first.type).to eq('netsuite')
expect(customer.metadata.first.key).to eq('key')
expect(customer.metadata.first.value).to eq('value')
expect(customer.taxes.map(&:code)).to eq(['tax_code'])
Expand Down

0 comments on commit 6aa30ed

Please sign in to comment.