diff options
Diffstat (limited to 'controller-server')
3 files changed, 3 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index fa32d61675c..1fd8e7c8f3b 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -721,10 +721,6 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { var mergedPurchaseOrder = optional("purchaseOrder", inspector).map(PurchaseOrder::new).orElse(billing.getPurchaseOrder()); var mergedInvoiceEmail = optional("invoiceEmail", inspector).map(mail -> new Email(mail, false)).orElse(billing.getInvoiceEmail()); - if (!inspector.field("taxId").valid() && inspector.field("address").valid()) { - throw new IllegalArgumentException("Tax ID information is mandatory for setting up billing"); - } - var mergedBilling = info.billingContact() .withContact(mergedContact) .withAddress(mergedAddress) diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java index b4237a46c5a..93c13e6ed4c 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java @@ -131,6 +131,7 @@ public class BillingApiHandlerV2 extends RestApiRequestHandler<BillingApiHandler var countryCursor = countries.addObject(); countryCursor.setString("code", country.code()); countryCursor.setString("name", country.displayName()); + countryCursor.setBool("taxIdMandatory", country.taxIdMandatory()); var taxTypesCursors = countryCursor.setArray("taxTypes"); country.taxTypes().forEach(taxType -> { var taxTypeCursor = taxTypesCursors.addObject(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json index 2714de1e64d..5247b84a900 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json @@ -3,6 +3,7 @@ { "code": "NO", "name": "Norway", + "taxIdMandatory": true, "taxTypes": [ { "id": "no_vat", @@ -15,6 +16,7 @@ { "code": "CA", "name": "Canada", + "taxIdMandatory": true, "taxTypes": [ { "id": "ca_gst_hst", |