mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:17:34 -05:00 
			
		
		
		
	
						commit
						d80efb95ea
					
				@ -1 +1 @@
 | 
				
			|||||||
5.10.9
 | 
					5.10.10
 | 
				
			||||||
@ -113,9 +113,9 @@ class Storecove {
 | 
				
			|||||||
            ],
 | 
					            ],
 | 
				
			||||||
            "document"=> [
 | 
					            "document"=> [
 | 
				
			||||||
                'documentType' => 'invoice',
 | 
					                'documentType' => 'invoice',
 | 
				
			||||||
                'rawDocumentData' => ['document' => base64_encode($document)],
 | 
					                'rawDocumentData' => ['document' => base64_encode($document), 'parse' => true, 'parseStrategy', 'ubl'],
 | 
				
			||||||
                '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 = [])
 | 
					    private function getHeaders(array $headers = [])
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -271,7 +294,7 @@ class Storecove {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private function httpClient(string $uri, string $verb, array $data, ?array $headers = [])
 | 
					    private function httpClient(string $uri, string $verb, array $data, ?array $headers = [])
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
nlog("{$this->base_url}{$uri}");
 | 
					        
 | 
				
			||||||
        $r = Http::withToken(config('ninja.storecove_api_key'))
 | 
					        $r = Http::withToken(config('ninja.storecove_api_key'))
 | 
				
			||||||
                ->withHeaders($this->getHeaders($headers))
 | 
					                ->withHeaders($this->getHeaders($headers))
 | 
				
			||||||
                ->{$verb}("{$this->base_url}{$uri}", $data);
 | 
					                ->{$verb}("{$this->base_url}{$uri}", $data);
 | 
				
			||||||
 | 
				
			|||||||
@ -17,8 +17,8 @@ return [
 | 
				
			|||||||
    'require_https' => env('REQUIRE_HTTPS', true),
 | 
					    'require_https' => env('REQUIRE_HTTPS', true),
 | 
				
			||||||
    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
					    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
				
			||||||
    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
					    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
				
			||||||
    'app_version' => env('APP_VERSION', '5.10.9'),
 | 
					    'app_version' => env('APP_VERSION', '5.10.10'),
 | 
				
			||||||
    'app_tag' => env('APP_TAG', '5.10.9'),
 | 
					    'app_tag' => env('APP_TAG', '5.10.10'),
 | 
				
			||||||
    'minimum_client_version' => '5.0.16',
 | 
					    'minimum_client_version' => '5.0.16',
 | 
				
			||||||
    'terms_version' => '1.0.1',
 | 
					    'terms_version' => '1.0.1',
 | 
				
			||||||
    'api_secret' => env('API_SECRET', false),
 | 
					    '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()
 | 
					    // public function testUpdateLegalEntity()
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
    //     $data = [
 | 
					    //     $data = [
 | 
				
			||||||
@ -86,8 +98,6 @@ class StorecoveTest extends TestCase
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $this->assertIsArray($r);
 | 
					        $this->assertIsArray($r);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        nlog($r);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }    
 | 
					    }    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function testSendDocument()
 | 
					    public function testSendDocument()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user