diff --git a/lib/lago/api/resources/customer.rb b/lib/lago/api/resources/customer.rb index 2552d61..e448228 100644 --- a/lib/lago/api/resources/customer.rb +++ b/lib/lago/api/resources/customer.rb @@ -74,8 +74,10 @@ def whitelist_params(params) zipcode: params[:zipcode], currency: params[:currency], tax_codes: params[:tax_codes], + invoice_custom_section_codes: params[:invoice_custom_section_codes], timezone: params[:timezone], finalize_zero_amount_invoice: params[:finalize_zero_amount_invoice], + skip_invoice_custom_sections: params[:skip_invoice_custom_sections], } whitelist_billing_configuration(params[:billing_configuration]).tap do |config| diff --git a/spec/factories/customer.rb b/spec/factories/customer.rb index 86cd428..b561f4d 100644 --- a/spec/factories/customer.rb +++ b/spec/factories/customer.rb @@ -22,6 +22,7 @@ net_payment_term { nil } tax_identification_number { 'EU123456789' } finalize_zero_amount_invoice { 'inherit' } + skip_invoice_custom_sections { false } billing_configuration do { invoice_grace_period: 3, @@ -62,6 +63,7 @@ end currency { 'EUR' } tax_codes { ['tax_code'] } + invoice_custom_section_codes { ['ics_code'] } timezone { 'Europe/Paris' } end end diff --git a/spec/fixtures/api/customer.json b/spec/fixtures/api/customer.json index 0211294..20ad19f 100644 --- a/spec/fixtures/api/customer.json +++ b/spec/fixtures/api/customer.json @@ -25,6 +25,7 @@ "timezone": "Europe/Paris", "applicable_timezone": "Europe/Paris", "finalize_zero_amount_invoice": "inherit", + "skip_invoice_custom_sections": false, "billing_configuration": { "invoice_grace_period": 3, "payment_provider": "stripe", @@ -72,6 +73,18 @@ "applied_to_organization": false, "created_at": "2022-04-29T08:59:51Z" } + ], + "invoice_custom_sections": [ + { + "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", + "code": "ics_code", + "name": "ics_name", + "description": "something about this section", + "details": "This part will be shown at the invoice", + "display_name": "Section name displayed on invoice", + "applied_to_organization": true, + "created_at": "2022-04-29T08:59:51Z" + } ] } } diff --git a/spec/fixtures/api/invoice.json b/spec/fixtures/api/invoice.json index be1c1b4..17f110b 100644 --- a/spec/fixtures/api/invoice.json +++ b/spec/fixtures/api/invoice.json @@ -43,6 +43,16 @@ "created_at": "2022-04-29T08:59:51Z" } ], + "applied_invoice_custom_sections": [ + { + "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", + "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", + "code": "ics_code", + "details": "This part will be shown at the invoice", + "display_name": "Section name displayed on invoice", + "created_at": "2022-04-29T08:59:51Z" + } + ], "customer": { "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", "external_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",