mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:57:32 -05:00 
			
		
		
		
	
						commit
						d80efb95ea
					
				@ -1 +1 @@
 | 
			
		||||
5.10.9
 | 
			
		||||
5.10.10
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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),
 | 
			
		||||
 | 
			
		||||
@ -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()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user