Skip to content

Commit d98a682

Browse files
authored
Merge pull request #234 from getlago/getlago/invoice_custom_sections
Feat(invoice_custom_sections): add ics to ruby-client
2 parents 8195d35 + 9878c83 commit d98a682

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

lib/lago/api/resources/customer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ def whitelist_params(params)
7474
zipcode: params[:zipcode],
7575
currency: params[:currency],
7676
tax_codes: params[:tax_codes],
77+
invoice_custom_section_codes: params[:invoice_custom_section_codes],
7778
timezone: params[:timezone],
7879
finalize_zero_amount_invoice: params[:finalize_zero_amount_invoice],
80+
skip_invoice_custom_sections: params[:skip_invoice_custom_sections],
7981
}
8082

8183
whitelist_billing_configuration(params[:billing_configuration]).tap do |config|

spec/factories/customer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
net_payment_term { nil }
2323
tax_identification_number { 'EU123456789' }
2424
finalize_zero_amount_invoice { 'inherit' }
25+
skip_invoice_custom_sections { false }
2526
billing_configuration do
2627
{
2728
invoice_grace_period: 3,
@@ -62,6 +63,7 @@
6263
end
6364
currency { 'EUR' }
6465
tax_codes { ['tax_code'] }
66+
invoice_custom_section_codes { ['ics_code'] }
6567
timezone { 'Europe/Paris' }
6668
end
6769
end

spec/fixtures/api/customer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"timezone": "Europe/Paris",
2626
"applicable_timezone": "Europe/Paris",
2727
"finalize_zero_amount_invoice": "inherit",
28+
"skip_invoice_custom_sections": false,
2829
"billing_configuration": {
2930
"invoice_grace_period": 3,
3031
"payment_provider": "stripe",
@@ -72,6 +73,18 @@
7273
"applied_to_organization": false,
7374
"created_at": "2022-04-29T08:59:51Z"
7475
}
76+
],
77+
"invoice_custom_sections": [
78+
{
79+
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
80+
"code": "ics_code",
81+
"name": "ics_name",
82+
"description": "something about this section",
83+
"details": "This part will be shown at the invoice",
84+
"display_name": "Section name displayed on invoice",
85+
"applied_to_organization": true,
86+
"created_at": "2022-04-29T08:59:51Z"
87+
}
7588
]
7689
}
7790
}

spec/fixtures/api/invoice.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@
4343
"created_at": "2022-04-29T08:59:51Z"
4444
}
4545
],
46+
"applied_invoice_custom_sections": [
47+
{
48+
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
49+
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
50+
"code": "ics_code",
51+
"details": "This part will be shown at the invoice",
52+
"display_name": "Section name displayed on invoice",
53+
"created_at": "2022-04-29T08:59:51Z"
54+
}
55+
],
4656
"customer": {
4757
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
4858
"external_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",

0 commit comments

Comments
 (0)