1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
This commit is contained in:
David Bomba 2024-07-17 15:37:54 +10:00
parent d48ecc0ce5
commit e423816bd3
4 changed files with 42 additions and 9 deletions

View File

@ -1 +1 @@
5.10.9
5.10.10

View File

@ -113,9 +113,9 @@ class Storecove {
],
"document"=> [
'documentType' => 'invoice',
'rawDocumentData' => ['document' => base64_encode($document)],
'parse' => true,
'parseStrategy', 'ubl'
'rawDocumentData' => ['document' => base64_encode($document), 'parse' => true, 'parseStrategy', 'ubl'],
//
// '
],
];
@ -258,6 +258,29 @@ class Storecove {
}
public function addIdentifier(int $legal_entity_id, string $identifier, string $scheme)
{
$uri = "legal_entities/{$legal_entity_id}/peppol_identifiers";
$data = [
"identifier" => $identifier,
"scheme" => $scheme,
"superscheme" => "iso6523-actorid-upis",
];
$r = $this->httpClient($uri, (HttpVerb::POST)->value, $data);
if($r->successful()) {
return $r->json();
}
return $r;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private function getHeaders(array $headers = [])
{
@ -271,7 +294,7 @@ class Storecove {
private function httpClient(string $uri, string $verb, array $data, ?array $headers = [])
{
nlog("{$this->base_url}{$uri}");
$r = Http::withToken(config('ninja.storecove_api_key'))
->withHeaders($this->getHeaders($headers))
->{$verb}("{$this->base_url}{$uri}", $data);

View File

@ -17,8 +17,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION', '5.10.9'),
'app_tag' => env('APP_TAG', '5.10.9'),
'app_version' => env('APP_VERSION', '5.10.10'),
'app_tag' => env('APP_TAG', '5.10.10'),
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),

View File

@ -60,6 +60,18 @@ class StorecoveTest extends TestCase
}
public function tesXAddPeppolIdentifier()
{
$sc = new \App\Services\EDocument\Gateway\Storecove\Storecove();
$r = $sc->addIdentifier(290868, "DE923356489", "DE:VAT");
// nlog($r->body());
// $this->assertIsArray($r);
nlog($r);
}
// public function testUpdateLegalEntity()
// {
// $data = [
@ -86,8 +98,6 @@ class StorecoveTest extends TestCase
$this->assertIsArray($r);
nlog($r);
}
public function testSendDocument()