From 82b90ce970a9ba791e080232e0475f764722092a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 18 Nov 2024 17:46:44 +0100 Subject: [PATCH] Proxy method for removing tax identifiers --- .../Gateway/Storecove/StorecoveProxy.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/Services/EDocument/Gateway/Storecove/StorecoveProxy.php b/app/Services/EDocument/Gateway/Storecove/StorecoveProxy.php index 35e294c192..35ea65b464 100644 --- a/app/Services/EDocument/Gateway/Storecove/StorecoveProxy.php +++ b/app/Services/EDocument/Gateway/Storecove/StorecoveProxy.php @@ -142,6 +142,23 @@ class StorecoveProxy return $this->remoteRequest('/api/einvoice/peppol/add_additional_legal_identifier', $data); } + public function removeAdditionalTaxIdentifier(array $data): array|false + { + $data['legal_entity_id'] = $this->company->legal_entity_id; + + if (Ninja::isHosted()) { + $response = $this->storecove->removeAdditionalTaxIdentifier($data['legal_entity_id'], $data['vat_number']); + + if (is_array($response) || is_bool($response)) { + return $response; + } + + return $this->handleResponseError($response); + } + + return $this->remoteRequest('/api/einvoice/peppol/remove_additional_legal_identifier', $data); + } + /** * handleResponseError *