makeTestData(); if (config('ninja.testvars.travis') !== false || !config('ninja.storecove_api_key')) $this->markTestSkipped("do not run in CI"); } // public function testCreateLegalEntity() // { // $data = [ // 'acts_as_receiver' => true, // 'acts_as_sender' => true, // 'advertisements' => ['invoice'], // 'city' => $this->company->settings->city, // 'country' => 'DE', // 'county' => $this->company->settings->state, // 'line1' => $this->company->settings->address1, // 'line2' => $this->company->settings->address2, // 'party_name' => $this->company->present()->name(), // 'tax_registered' => true, // 'tenant_id' => $this->company->company_key, // 'zip' => $this->company->settings->postal_code, // 'peppol_identifiers' => [ // 'scheme' => 'DE:VAT', // 'id' => 'DE:VAT' // ], // ]; // $sc = new \App\Services\EDocument\Gateway\Storecove\Storecove(); // $r = $sc->createLegalEntity($data, $this->company); // $this->assertIsArray($r); // } // public function testAddPeppolIdentifier() // { // $sc = new \App\Services\EDocument\Gateway\Storecove\Storecove(); // $r = $sc->addIdentifier(291394, "DE923356489", "DE:VAT"); // nlog($r); // } // public function testUpdateLegalEntity() // { // $data = [ // 'peppol_identifiers' => [ // 'scheme' => 'DE:VAT', // 'id' => 'DE:VAT' // ], // ]; // $sc = new \App\Services\EDocument\Gateway\Storecove\Storecove(); // $r = $sc->updateLegalEntity(290868, $data); // $this->assertIsArray($r); // nlog($r); // } public function testGetLegalEntity() { $sc = new \App\Services\EDocument\Gateway\Storecove\Storecove(); $r = $sc->getLegalEntity(290868); $this->assertIsArray($r); } public function testSendDocument() { $x = ' DE-77323 2024-07-18 380 Untitled Company Dudweilerstr. 34b Ost Alessa 98060 Bayern DE Dudweilerstr. 34b Ost Alessa 98060 Bayern DE owner@gmail.com German Client Name Kinderhausen 96b Süd Jessestadt 33323 Bayern DE Kinderhausen 96b Süd Jessestadt 33323 Bayern DE No Email Set DE89370400440532013000 PFA-NAME PFA-Alias CHECKING IBAN EUR DEUTDEMMXXX Deutsche Bank 100 100 119.00 119.00 1 10 100 19 100 19 C62 19 mwst Product Description Product Key 10 '; //inclusive $x = ' DE-93090 2024-07-18 380 Untitled Company Dudweilerstr. 34b Ost Alessa 98060 Bayern DE Dudweilerstr. 34b Ost Alessa 98060 Bayern DE owner@gmail.com German Client Name Kinderhausen 96b Süd Jessestadt 33323 Bayern DE Kinderhausen 96b Süd Jessestadt 33323 Bayern DE No Email Set DE89370400440532013000 PFA-NAME PFA-Alias CHECKING IBAN EUR DEUTDEMMXXX Deutsche Bank 15.97 84.03 15.97 C62 0 84.03 84.03 100.00 100.00 1 10 84.03 15.97 84.03 15.97 C62 19 mwst Product Description Product Key 8.403 '; $sc = new \App\Services\EDocument\Gateway\Storecove\Storecove(); $sc->sendDocument($x); } public function testCreateCHClient() { Client::unguard(); $c = Client::create([ 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'name' => 'Test Company AG', 'website' => 'https://www.testcompany.ch', 'private_notes' => 'These are some private notes about the test client.', 'balance' => 0, 'paid_to_date' => 0, 'vat_number' => '654321987', 'id_number' => 'CH9300762011623852957', // Sample Swiss IBAN 'custom_value1' => '2024-07-22 10:00:00', 'custom_value2' => 'blue', 'custom_value3' => 'sampleword', 'custom_value4' => 'test@example.com', 'address1' => '123', 'address2' => 'Test Street 45', 'city' => 'Zurich', 'state' => 'Zurich', 'postal_code' => '8001', 'country_id' => '756', // Switzerland 'shipping_address1' => '123', 'shipping_address2' => 'Test Street 45', 'shipping_city' => 'Zurich', 'shipping_state' => 'Zurich', 'shipping_postal_code' => '8001', 'shipping_country_id' => '756', // Switzerland 'settings' => ClientSettings::Defaults(), 'client_hash' => \Illuminate\Support\Str::random(32), 'routing_id' => '', ]); $this->assertInstanceOf(\App\Models\Client::class, $c); } }