From fb7177fd6586087ca3a2ff63e652cc7fa3205b6d Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Sat, 10 May 2025 12:38:14 -0400 Subject: [PATCH] Reorden Toku --- app/setup/setups/services.php | 28 ++++---- .../Controller/API/Ventas/MediosPago/Toku.php | 11 ++- .../{ => Venta}/MediosPago/Toku/Customer.php | 2 +- .../{ => Venta}/MediosPago/Toku/Invoice.php | 2 +- .../MediosPago/Toku/Subscription.php | 2 +- .../{ => Venta}/MediosPago/Toku/Customer.php | 18 ++--- .../{ => Venta}/MediosPago/Toku/Invoice.php | 20 +++--- .../MediosPago/Toku/Subscription.php | 16 ++--- .../MediosPago/AbstractEndPoint.php | 10 +-- .../{ => Venta}/MediosPago/EndPoint.php | 2 +- .../Service/{ => Venta}/MediosPago/Toku.php | 8 +-- .../{ => Venta}/MediosPago/Toku/Customer.php | 10 +-- .../{ => Venta}/MediosPago/Toku/Invoice.php | 16 ++--- .../MediosPago/Toku/Subscription.php | 8 +-- .../MediosPago/Toku/CustomerTest.php | 6 +- .../MediosPago/Toku/InvoiceTest.php | 6 +- .../MediosPago/Toku/SubscriptionTest.php | 6 +- .../MediosPago/Toku/CustomerTest.php | 28 ++++---- .../MediosPago/Toku/InvoiceTest.php | 28 ++++---- .../MediosPago/Toku/SubscriptionTest.php | 28 ++++---- .../MediosPago/Toku/CustomerTest.php | 32 ++++----- .../MediosPago/Toku/InvoiceTest.php | 38 +++++----- .../MediosPago/Toku/SubscriptionTest.php | 34 ++++----- .../{ => Venta}/MediosPago/TokuTest.php | 69 +++++++++---------- 24 files changed, 213 insertions(+), 215 deletions(-) rename app/src/Model/{ => Venta}/MediosPago/Toku/Customer.php (90%) rename app/src/Model/{ => Venta}/MediosPago/Toku/Invoice.php (87%) rename app/src/Model/{ => Venta}/MediosPago/Toku/Subscription.php (87%) rename app/src/Repository/{ => Venta}/MediosPago/Toku/Customer.php (77%) rename app/src/Repository/{ => Venta}/MediosPago/Toku/Invoice.php (74%) rename app/src/Repository/{ => Venta}/MediosPago/Toku/Subscription.php (75%) rename app/src/Service/{ => Venta}/MediosPago/AbstractEndPoint.php (99%) rename app/src/Service/{ => Venta}/MediosPago/EndPoint.php (95%) rename app/src/Service/{ => Venta}/MediosPago/Toku.php (99%) rename app/src/Service/{ => Venta}/MediosPago/Toku/Customer.php (90%) rename app/src/Service/{ => Venta}/MediosPago/Toku/Invoice.php (92%) rename app/src/Service/{ => Venta}/MediosPago/Toku/Subscription.php (94%) rename app/tests/unit/src/Model/{ => Venta}/MediosPago/Toku/CustomerTest.php (94%) rename app/tests/unit/src/Model/{ => Venta}/MediosPago/Toku/InvoiceTest.php (86%) rename app/tests/unit/src/Model/{ => Venta}/MediosPago/Toku/SubscriptionTest.php (85%) rename app/tests/unit/src/Repository/{ => Venta}/MediosPago/Toku/CustomerTest.php (82%) rename app/tests/unit/src/Repository/{ => Venta}/MediosPago/Toku/InvoiceTest.php (80%) rename app/tests/unit/src/Repository/{ => Venta}/MediosPago/Toku/SubscriptionTest.php (79%) rename app/tests/unit/src/Service/{ => Venta}/MediosPago/Toku/CustomerTest.php (88%) rename app/tests/unit/src/Service/{ => Venta}/MediosPago/Toku/InvoiceTest.php (87%) rename app/tests/unit/src/Service/{ => Venta}/MediosPago/Toku/SubscriptionTest.php (86%) rename app/tests/unit/src/Service/{ => Venta}/MediosPago/TokuTest.php (83%) diff --git a/app/setup/setups/services.php b/app/setup/setups/services.php index 286e935..ab2b0ed 100644 --- a/app/setup/setups/services.php +++ b/app/setup/setups/services.php @@ -123,31 +123,31 @@ return [ ] ]); }, - Incoviba\Service\MediosPago\Toku\Customer::class => function(ContainerInterface $container) { - return new Incoviba\Service\MediosPago\Toku\Customer( + Incoviba\Service\Venta\MediosPago\Toku\Customer::class => function(ContainerInterface $container) { + return new Incoviba\Service\Venta\MediosPago\Toku\Customer( $container->get('tokuClient'), - $container->get(Incoviba\Repository\MediosPago\Toku\Customer::class) + $container->get(Incoviba\Repository\Venta\MediosPago\Toku\Customer::class) ); }, - Incoviba\Service\MediosPago\Toku\Subscription::class => function(ContainerInterface $container) { - return new Incoviba\Service\MediosPago\Toku\Subscription( + Incoviba\Service\Venta\MediosPago\Toku\Subscription::class => function(ContainerInterface $container) { + return new Incoviba\Service\Venta\MediosPago\Toku\Subscription( $container->get('tokuClient'), - $container->get(Incoviba\Repository\MediosPago\Toku\Subscription::class) + $container->get(Incoviba\Repository\Venta\MediosPago\Toku\Subscription::class) ); }, - Incoviba\Service\MediosPago\Toku\Invoice::class => function(ContainerInterface $container) { - return new Incoviba\Service\MediosPago\Toku\Invoice( + Incoviba\Service\Venta\MediosPago\Toku\Invoice::class => function(ContainerInterface $container) { + return new Incoviba\Service\Venta\MediosPago\Toku\Invoice( $container->get('tokuClient'), - $container->get(Incoviba\Repository\MediosPago\Toku\Invoice::class), + $container->get(Incoviba\Repository\Venta\MediosPago\Toku\Invoice::class), $container->get(Incoviba\Service\Venta\Pago::class), $container->get(Incoviba\Service\UF::class) ); }, - Incoviba\Service\MediosPago\Toku::class => function(ContainerInterface $container) { - return (new Incoviba\Service\MediosPago\Toku( + Incoviba\Service\Venta\MediosPago\Toku::class => function(ContainerInterface $container) { + return (new Incoviba\Service\Venta\MediosPago\Toku( $container->get(Psr\Log\LoggerInterface::class) - ))->register('customer', $container->get(Incoviba\Service\MediosPago\Toku\Customer::class)) - ->register('subscription', $container->get(Incoviba\Service\MediosPago\Toku\Subscription::class)) - ->register('invoice', $container->get(Incoviba\Service\MediosPago\Toku\Invoice::class)); + ))->register('customer', $container->get(Incoviba\Service\Venta\MediosPago\Toku\Customer::class)) + ->register('subscription', $container->get(Incoviba\Service\Venta\MediosPago\Toku\Subscription::class)) + ->register('invoice', $container->get(Incoviba\Service\Venta\MediosPago\Toku\Invoice::class)); } ]; diff --git a/app/src/Controller/API/Ventas/MediosPago/Toku.php b/app/src/Controller/API/Ventas/MediosPago/Toku.php index 8f2f9ae..c07e62d 100644 --- a/app/src/Controller/API/Ventas/MediosPago/Toku.php +++ b/app/src/Controller/API/Ventas/MediosPago/Toku.php @@ -4,7 +4,6 @@ namespace Incoviba\Controller\API\Ventas\MediosPago; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use Incoviba\Common\Implement\Exception\EmptyResponse; use Incoviba\Common\Ideal\Controller; use Incoviba\Controller\API\withJson; use Incoviba\Exception\InvalidResult; @@ -15,8 +14,8 @@ class Toku extends Controller { use withJson; - public function cuotas(ServerRequestInterface $request, ResponseInterface $response, - Service\MediosPago\Toku $tokuService, Service\Venta $ventaService, int $venta_id): ResponseInterface + public function cuotas(ServerRequestInterface $request, ResponseInterface $response, + Service\Venta\MediosPago\Toku $tokuService, Service\Venta $ventaService, int $venta_id): ResponseInterface { $input = $request->getParsedBody(); $output = [ @@ -38,9 +37,9 @@ class Toku extends Controller } catch (Read | InvalidResult) {} return $this->withJson($response, $output); } - public function success(ServerRequestInterface $request, ResponseInterface $response, - ResponseFactoryInterface $responseFactory, - Service\MediosPago\Toku $tokuService): ResponseInterface + public function success(ServerRequestInterface $request, ResponseInterface $response, + ResponseFactoryInterface $responseFactory, + Service\Venta\MediosPago\Toku $tokuService): ResponseInterface { $body = $request->getBody(); $input = json_decode($body->getContents(), true); diff --git a/app/src/Model/MediosPago/Toku/Customer.php b/app/src/Model/Venta/MediosPago/Toku/Customer.php similarity index 90% rename from app/src/Model/MediosPago/Toku/Customer.php rename to app/src/Model/Venta/MediosPago/Toku/Customer.php index 65e116f..e429100 100644 --- a/app/src/Model/MediosPago/Toku/Customer.php +++ b/app/src/Model/Venta/MediosPago/Toku/Customer.php @@ -1,5 +1,5 @@ register('rut', (new Implement\Repository\Mapper()) @@ -30,9 +30,9 @@ class Customer extends Ideal\Repository return $this->personaService->getById($rut); }) ); - return $this->parseData(new Model\MediosPago\Toku\Customer(), $data, $map); + return $this->parseData(new Model\Venta\MediosPago\Toku\Customer(), $data, $map); } - public function save(Define\Model $model): Model\MediosPago\Toku\Customer + public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Customer { $model->id = $this->saveNew( ['rut', 'toku_id', 'created_at'], @@ -40,17 +40,17 @@ class Customer extends Ideal\Repository ); return $model; } - public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Customer + public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Customer { return $this->update($model, ['rut', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')])); } /** * @param string $rut - * @return Model\MediosPago\Toku\Customer + * @return \Incoviba\Model\Venta\MediosPago\Toku\Customer * @throws Implement\Exception\EmptyResult */ - public function fetchByRut(string $rut): Model\MediosPago\Toku\Customer + public function fetchByRut(string $rut): Model\Venta\MediosPago\Toku\Customer { if (str_contains($rut, '-')) { $rut = str_replace('-', '', $rut); @@ -68,10 +68,10 @@ class Customer extends Ideal\Repository /** * @param string $toku_id - * @return Model\MediosPago\Toku\Customer + * @return \Incoviba\Model\Venta\MediosPago\Toku\Customer * @throws Implement\Exception\EmptyResult */ - public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Customer + public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Customer { $query = $this->connection->getQueryBuilder() ->select() diff --git a/app/src/Repository/MediosPago/Toku/Invoice.php b/app/src/Repository/Venta/MediosPago/Toku/Invoice.php similarity index 74% rename from app/src/Repository/MediosPago/Toku/Invoice.php rename to app/src/Repository/Venta/MediosPago/Toku/Invoice.php index 27a2f7b..2cef3a6 100644 --- a/app/src/Repository/MediosPago/Toku/Invoice.php +++ b/app/src/Repository/Venta/MediosPago/Toku/Invoice.php @@ -1,12 +1,12 @@ register('cuota_id', (new Implement\Repository\Mapper()) @@ -27,9 +27,9 @@ class Invoice extends Ideal\Repository ->setFunction(function($data) { return $this->cuotaRepository->fetchById($data['cuota_id']); })); - return $this->parseData(new Model\MediosPago\Toku\Invoice(), $data, $map); + return $this->parseData(new Model\Venta\MediosPago\Toku\Invoice(), $data, $map); } - public function save(Define\Model $model): Model\MediosPago\Toku\Invoice + public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Invoice { $model->id = $this->saveNew( ['cuota_id', 'toku_id', 'created_at'], @@ -37,17 +37,17 @@ class Invoice extends Ideal\Repository ); return $model; } - public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Invoice + public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Invoice { return $this->update($model, ['cuota_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')])); } /** * @param int $cuota_id - * @return Model\MediosPago\Toku\Invoice + * @return \Incoviba\Model\Venta\MediosPago\Toku\Invoice * @throws Implement\Exception\EmptyResult */ - public function fetchByCuota(int $cuota_id): Model\MediosPago\Toku\Invoice + public function fetchByCuota(int $cuota_id): Model\Venta\MediosPago\Toku\Invoice { $query = $this->connection->getQueryBuilder() ->select() @@ -58,10 +58,10 @@ class Invoice extends Ideal\Repository /** * @param string $toku_id - * @return Model\MediosPago\Toku\Invoice + * @return \Incoviba\Model\Venta\MediosPago\Toku\Invoice * @throws Implement\Exception\EmptyResult */ - public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Invoice + public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Invoice { $query = $this->connection->getQueryBuilder() ->select() diff --git a/app/src/Repository/MediosPago/Toku/Subscription.php b/app/src/Repository/Venta/MediosPago/Toku/Subscription.php similarity index 75% rename from app/src/Repository/MediosPago/Toku/Subscription.php rename to app/src/Repository/Venta/MediosPago/Toku/Subscription.php index 4348a8f..0a96098 100644 --- a/app/src/Repository/MediosPago/Toku/Subscription.php +++ b/app/src/Repository/Venta/MediosPago/Toku/Subscription.php @@ -1,9 +1,9 @@ register('venta_id', (new Implement\Repository\Mapper()) @@ -28,9 +28,9 @@ class Subscription extends Ideal\Repository ->setFunction(function($data) { return $this->ventaRepository->fetchById($data['venta_id']); })); - return $this->parseData(new Model\MediosPago\Toku\Subscription(), $data, $map); + return $this->parseData(new Model\Venta\MediosPago\Toku\Subscription(), $data, $map); } - public function save(Define\Model $model): Model\MediosPago\Toku\Subscription + public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Subscription { $model->id = $this->saveNew( ['venta_id', 'toku_id', 'created_at'], @@ -38,12 +38,12 @@ class Subscription extends Ideal\Repository ); return $model; } - public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Subscription + public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Subscription { return $this->update($model, ['venta_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')])); } - public function fetchByVenta(int $venta_id): Model\MediosPago\Toku\Subscription + public function fetchByVenta(int $venta_id): Model\Venta\MediosPago\Toku\Subscription { $query = $this->connection->getQueryBuilder() ->select() @@ -51,7 +51,7 @@ class Subscription extends Ideal\Repository ->where('venta_id = :venta_id'); return $this->fetchOne($query, compact('venta_id')); } - public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Subscription + public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Subscription { $query = $this->connection->getQueryBuilder() ->select() diff --git a/app/src/Service/MediosPago/AbstractEndPoint.php b/app/src/Service/Venta/MediosPago/AbstractEndPoint.php similarity index 99% rename from app/src/Service/MediosPago/AbstractEndPoint.php rename to app/src/Service/Venta/MediosPago/AbstractEndPoint.php index 882b931..81679cc 100644 --- a/app/src/Service/MediosPago/AbstractEndPoint.php +++ b/app/src/Service/Venta/MediosPago/AbstractEndPoint.php @@ -1,15 +1,15 @@ assertObjectHasProperty($propertyName, $invoice); } @@ -35,7 +35,7 @@ class InvoiceTest extends TestCase $id = $faker->randomNumber(); - $invoice = new Model\MediosPago\Toku\Invoice(); + $invoice = new Model\Venta\MediosPago\Toku\Invoice(); $invoice->id = $id; $invoice->cuota = $cuota; $invoice->toku_id = $toku_id; diff --git a/app/tests/unit/src/Model/MediosPago/Toku/SubscriptionTest.php b/app/tests/unit/src/Model/Venta/MediosPago/Toku/SubscriptionTest.php similarity index 85% rename from app/tests/unit/src/Model/MediosPago/Toku/SubscriptionTest.php rename to app/tests/unit/src/Model/Venta/MediosPago/Toku/SubscriptionTest.php index 9208f40..3c72a67 100644 --- a/app/tests/unit/src/Model/MediosPago/Toku/SubscriptionTest.php +++ b/app/tests/unit/src/Model/Venta/MediosPago/Toku/SubscriptionTest.php @@ -1,5 +1,5 @@ assertObjectHasProperty($propertyName, $subscription); } @@ -34,7 +34,7 @@ class SubscriptionTest extends TestCase $id = $faker->randomNumber(); - $subscription = new Model\MediosPago\Toku\Subscription(); + $subscription = new Model\Venta\MediosPago\Toku\Subscription(); $subscription->id = $id; $subscription->venta = $venta; $subscription->toku_id = $toku_id; diff --git a/app/tests/unit/src/Repository/MediosPago/Toku/CustomerTest.php b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/CustomerTest.php similarity index 82% rename from app/tests/unit/src/Repository/MediosPago/Toku/CustomerTest.php rename to app/tests/unit/src/Repository/Venta/MediosPago/Toku/CustomerTest.php index b0429cd..7b47a46 100644 --- a/app/tests/unit/src/Repository/MediosPago/Toku/CustomerTest.php +++ b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/CustomerTest.php @@ -1,14 +1,14 @@ connection, $this->personaService); + $repository = new Repository\Venta\MediosPago\Toku\Customer($this->connection, $this->personaService); $faker = Faker\Factory::create(); $data = [ @@ -59,9 +59,9 @@ class CustomerTest extends TestCase $this->assertEquals($this->persona, $customer->persona); $this->assertEquals($data['toku_id'], $customer->toku_id); } - public function testSave(): Model\MediosPago\Toku\Customer + public function testSave(): Model\Venta\MediosPago\Toku\Customer { - $repository = new Repository\MediosPago\Toku\Customer($this->connection, $this->personaService); + $repository = new Repository\Venta\MediosPago\Toku\Customer($this->connection, $this->personaService); $faker = Faker\Factory::create(); $data = [ @@ -77,7 +77,7 @@ class CustomerTest extends TestCase return $customer; } #[Depends('testSave')] - public function testFetch(Model\MediosPago\Toku\Customer $reference): void + public function testFetch(Model\Venta\MediosPago\Toku\Customer $reference): void { $result = [ 'id' => $reference->id, @@ -89,16 +89,16 @@ class CustomerTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Customer($this->connection, $this->personaService); + $repository = new Repository\Venta\MediosPago\Toku\Customer($this->connection, $this->personaService); $customer = $repository->fetchById($reference->id); - $this->assertInstanceOf(Model\MediosPago\Toku\Customer::class, $customer); + $this->assertInstanceOf(Model\Venta\MediosPago\Toku\Customer::class, $customer); $this->assertEquals($reference->id, $customer->id); $this->assertEquals($this->persona, $customer->persona); $this->assertEquals($reference->toku_id, $customer->toku_id); } #[Depends('testSave')] - public function testFetchByRut(Model\MediosPago\Toku\Customer $reference): void + public function testFetchByRut(Model\Venta\MediosPago\Toku\Customer $reference): void { $result = [ 'id' => $reference->id, @@ -110,7 +110,7 @@ class CustomerTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Customer($this->connection, $this->personaService); + $repository = new Repository\Venta\MediosPago\Toku\Customer($this->connection, $this->personaService); $customer = $repository->fetchByRut($this->persona->rut); $this->assertEquals($reference->id, $customer->id); @@ -118,7 +118,7 @@ class CustomerTest extends TestCase $this->assertEquals($reference->toku_id, $customer->toku_id); } #[Depends('testSave')] - public function testFetchByTokuId(Model\MediosPago\Toku\Customer $reference): void + public function testFetchByTokuId(Model\Venta\MediosPago\Toku\Customer $reference): void { $result = [ 'id' => $reference->id, @@ -129,7 +129,7 @@ class CustomerTest extends TestCase ->disableOriginalConstructor()->getMock(); $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Customer($this->connection, $this->personaService); + $repository = new Repository\Venta\MediosPago\Toku\Customer($this->connection, $this->personaService); $customer = $repository->fetchByTokuId($reference->toku_id); $this->assertEquals($reference->id, $customer->id); diff --git a/app/tests/unit/src/Repository/MediosPago/Toku/InvoiceTest.php b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/InvoiceTest.php similarity index 80% rename from app/tests/unit/src/Repository/MediosPago/Toku/InvoiceTest.php rename to app/tests/unit/src/Repository/Venta/MediosPago/Toku/InvoiceTest.php index ee1083d..dfd0649 100644 --- a/app/tests/unit/src/Repository/MediosPago/Toku/InvoiceTest.php +++ b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/InvoiceTest.php @@ -1,13 +1,13 @@ connection, $this->cuotaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); $faker = Faker\Factory::create(); $data = [ @@ -51,9 +51,9 @@ class InvoiceTest extends TestCase $this->assertEquals($this->cuota->id, $invoice->cuota->id); $this->assertEquals($data['toku_id'], $invoice->toku_id); } - public function testSave(): Model\MediosPago\Toku\Invoice + public function testSave(): Model\Venta\MediosPago\Toku\Invoice { - $repository = new Repository\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); $faker = Faker\Factory::create(); $data = [ @@ -70,7 +70,7 @@ class InvoiceTest extends TestCase return $invoice; } #[Depends('testSave')] - public function testFetch(Model\MediosPago\Toku\Invoice $reference): void + public function testFetch(Model\Venta\MediosPago\Toku\Invoice $reference): void { $result = [ 'id' => $reference->id, @@ -82,16 +82,16 @@ class InvoiceTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); $invoice = $repository->fetchById($reference->id); - $this->assertInstanceOf(Model\MediosPago\Toku\Invoice::class, $invoice); + $this->assertInstanceOf(Model\Venta\MediosPago\Toku\Invoice::class, $invoice); $this->assertEquals($reference->id, $invoice->id); $this->assertEquals($this->cuota->id, $invoice->cuota->id); $this->assertEquals($reference->toku_id, $invoice->toku_id); } #[Depends('testSave')] - public function testFetchByCuota(Model\MediosPago\Toku\Invoice $reference): void + public function testFetchByCuota(Model\Venta\MediosPago\Toku\Invoice $reference): void { $result = [ 'id' => $reference->id, @@ -103,7 +103,7 @@ class InvoiceTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); $invoice = $repository->fetchByCuota($this->cuota->id); $this->assertEquals($reference->id, $invoice->id); @@ -111,7 +111,7 @@ class InvoiceTest extends TestCase $this->assertEquals($reference->toku_id, $invoice->toku_id); } #[Depends('testSave')] - public function testFetchByTokuId(Model\MediosPago\Toku\Invoice $reference): void + public function testFetchByTokuId(Model\Venta\MediosPago\Toku\Invoice $reference): void { $result = [ 'id' => $reference->id, @@ -123,7 +123,7 @@ class InvoiceTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Invoice($this->connection, $this->cuotaRepository); $invoice = $repository->fetchByTokuId($reference->toku_id); $this->assertEquals($reference->id, $invoice->id); diff --git a/app/tests/unit/src/Repository/MediosPago/Toku/SubscriptionTest.php b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/SubscriptionTest.php similarity index 79% rename from app/tests/unit/src/Repository/MediosPago/Toku/SubscriptionTest.php rename to app/tests/unit/src/Repository/Venta/MediosPago/Toku/SubscriptionTest.php index fee22f2..b1c69f4 100644 --- a/app/tests/unit/src/Repository/MediosPago/Toku/SubscriptionTest.php +++ b/app/tests/unit/src/Repository/Venta/MediosPago/Toku/SubscriptionTest.php @@ -1,13 +1,13 @@ connection, $this->ventaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); $faker = Faker\Factory::create(); $data = [ @@ -50,9 +50,9 @@ class SubscriptionTest extends TestCase $this->assertEquals($this->venta->id, $subscription->venta->id); $this->assertEquals($data['toku_id'], $subscription->toku_id); } - public function testSave(): Model\MediosPago\Toku\Subscription + public function testSave(): Model\Venta\MediosPago\Toku\Subscription { - $repository = new Repository\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); $faker = Faker\Factory::create(); $data = [ @@ -69,7 +69,7 @@ class SubscriptionTest extends TestCase return $subscription; } #[Depends('testSave')] - public function testFetch(Model\MediosPago\Toku\Subscription $reference): void + public function testFetch(Model\Venta\MediosPago\Toku\Subscription $reference): void { $result = [ 'id' => $reference->id, @@ -82,15 +82,15 @@ class SubscriptionTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); $subscription = $repository->fetchById($reference->id); - $this->assertInstanceOf(Model\MediosPago\Toku\Subscription::class, $subscription); + $this->assertInstanceOf(Model\Venta\MediosPago\Toku\Subscription::class, $subscription); $this->assertEquals($reference->id, $subscription->id); $this->assertEquals($this->venta->id, $subscription->venta->id); $this->assertEquals($reference->toku_id, $subscription->toku_id); } #[Depends('testSave')] - public function testFetchByVenta(Model\MediosPago\Toku\Subscription $reference): void + public function testFetchByVenta(Model\Venta\MediosPago\Toku\Subscription $reference): void { $result = [ 'id' => $reference->id, @@ -103,14 +103,14 @@ class SubscriptionTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); $subscription = $repository->fetchByVenta($this->venta->id); $this->assertEquals($reference->id, $subscription->id); $this->assertEquals($this->venta->id, $subscription->venta->id); $this->assertEquals($reference->toku_id, $subscription->toku_id); } #[Depends('testSave')] - public function testFetchByTokuId(Model\MediosPago\Toku\Subscription $reference): void + public function testFetchByTokuId(Model\Venta\MediosPago\Toku\Subscription $reference): void { $result = [ 'id' => $reference->id, @@ -123,7 +123,7 @@ class SubscriptionTest extends TestCase $resultSet->method('fetch')->willReturn($result); $this->connection->method('execute')->willReturn($resultSet); - $repository = new Repository\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); + $repository = new Repository\Venta\MediosPago\Toku\Subscription($this->connection, $this->ventaRepository); $subscription = $repository->fetchByTokuId($reference->toku_id); $this->assertEquals($reference->id, $subscription->id); $this->assertEquals($this->venta->id, $subscription->venta->id); diff --git a/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php b/app/tests/unit/src/Service/Venta/MediosPago/Toku/CustomerTest.php similarity index 88% rename from app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php rename to app/tests/unit/src/Service/Venta/MediosPago/Toku/CustomerTest.php index a1bc021..28f436e 100644 --- a/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php +++ b/app/tests/unit/src/Service/Venta/MediosPago/Toku/CustomerTest.php @@ -1,22 +1,22 @@ apellidoMaterno ])); - $this->customer = $this->getMockBuilder(Model\MediosPago\Toku\Customer::class) + $this->customer = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $this->customer->id = $faker->randomNumber(); $this->customer->persona = $persona; @@ -65,7 +65,7 @@ class CustomerTest extends TestCase 'toku_id' => $this->customer->toku_id ]); - $this->customerRepository = $this->getMockBuilder(Repository\MediosPago\Toku\Customer::class) + $this->customerRepository = $this->getMockBuilder(Repository\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $this->customerRepository->method('fetchById')->willReturn($this->customer); $this->customerRepository->method('fetchByRut')->willReturn($this->customer); @@ -148,25 +148,25 @@ class CustomerTest extends TestCase public function testGetById(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $this->assertEquals(json_decode(json_encode($this->customer), true), $service->getById($this->customer->id)); } public function testGetByExternalId(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $this->assertEquals(json_decode(json_encode($this->customer), true), $service->getByExternalId($this->customer->rut())); } public function testGet(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $this->assertArrayIsEqualToArrayIgnoringListOfKeys($this->getData, $service->get($this->customer->toku_id), []); } public function testAdd(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $sendData = [ 'rut' => $this->postData['government_id'], @@ -178,7 +178,7 @@ class CustomerTest extends TestCase } public function testEdit(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $sendData = [ 'rut' => $this->postData['government_id'], @@ -190,7 +190,7 @@ class CustomerTest extends TestCase } public function testDelete(): void { - $service = new Service\MediosPago\Toku\Customer($this->client, $this->customerRepository); + $service = new Service\Venta\MediosPago\Toku\Customer($this->client, $this->customerRepository); $this->expectNotToPerformAssertions(); $service->delete($this->customer->toku_id); diff --git a/app/tests/unit/src/Service/MediosPago/Toku/InvoiceTest.php b/app/tests/unit/src/Service/Venta/MediosPago/Toku/InvoiceTest.php similarity index 87% rename from app/tests/unit/src/Service/MediosPago/Toku/InvoiceTest.php rename to app/tests/unit/src/Service/Venta/MediosPago/Toku/InvoiceTest.php index 4c12dfa..e18cd10 100644 --- a/app/tests/unit/src/Service/MediosPago/Toku/InvoiceTest.php +++ b/app/tests/unit/src/Service/Venta/MediosPago/Toku/InvoiceTest.php @@ -1,22 +1,22 @@ getMockBuilder(Model\MediosPago\Toku\Customer::class) + $customer = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $customer->id = $faker->randomNumber(); $customer->toku_id = $faker->ean13(); $venta = $this->getMockBuilder(Model\Venta::class) ->disableOriginalConstructor()->getMock(); $venta->id = $faker->randomNumber(); - $subscription = $this->getMockBuilder(Model\MediosPago\Toku\Subscription::class) + $subscription = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Subscription::class) ->disableOriginalConstructor()->getMock(); $subscription->id = $faker->randomNumber(); $subscription->venta = $venta; @@ -75,7 +75,7 @@ class InvoiceTest extends TestCase $this->cuota->numero = $faker->randomNumber(2); $this->cuota->pago = $pago; - $this->invoice = $this->getMockBuilder(Model\MediosPago\Toku\Invoice::class) + $this->invoice = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Invoice::class) ->disableOriginalConstructor()->getMock(); $this->invoice->id = $faker->randomNumber(); $this->invoice->cuota = $this->cuota; @@ -86,7 +86,7 @@ class InvoiceTest extends TestCase 'toku_id' => $this->invoice->toku_id ]); - $this->invoiceRepository = $this->getMockBuilder(Repository\MediosPago\Toku\Invoice::class) + $this->invoiceRepository = $this->getMockBuilder(Repository\Venta\MediosPago\Toku\Invoice::class) ->disableOriginalConstructor()->getMock(); $this->invoiceRepository->method('fetchById')->willReturn($this->invoice); $this->invoiceRepository->method('fetchByCuota')->willReturn($this->invoice); @@ -179,25 +179,25 @@ class InvoiceTest extends TestCase public function testGetById(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $this->assertEquals(json_decode(json_encode($this->invoice), true), $service->getById($this->cuota->id)); } public function testGetByExternalId(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $this->assertEquals(json_decode(json_encode($this->invoice), true), $service->getByExternalId($this->invoice->toku_id)); } public function testGet(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $this->assertEquals($this->getData, $service->get($this->invoice->toku_id)); } public function testAdd(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $sendData = [ 'customer' => $this->postData['customer'], @@ -210,7 +210,7 @@ class InvoiceTest extends TestCase } public function testEdit(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $sendData = [ 'customer' => $this->postData['customer'], @@ -223,7 +223,7 @@ class InvoiceTest extends TestCase } public function testDelete(): void { - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $this->expectNotToPerformAssertions(); $service->delete($this->invoice->toku_id); @@ -258,7 +258,7 @@ class InvoiceTest extends TestCase ] ]; - $service = new Service\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); + $service = new Service\Venta\MediosPago\Toku\Invoice($this->client, $this->invoiceRepository, $this->pagoService, $this->ufService); $this->assertTrue($service->update($request['payment_intent']['invoice'], $request['payment_intent'])); } diff --git a/app/tests/unit/src/Service/MediosPago/Toku/SubscriptionTest.php b/app/tests/unit/src/Service/Venta/MediosPago/Toku/SubscriptionTest.php similarity index 86% rename from app/tests/unit/src/Service/MediosPago/Toku/SubscriptionTest.php rename to app/tests/unit/src/Service/Venta/MediosPago/Toku/SubscriptionTest.php index 12dff1b..213d5de 100644 --- a/app/tests/unit/src/Service/MediosPago/Toku/SubscriptionTest.php +++ b/app/tests/unit/src/Service/Venta/MediosPago/Toku/SubscriptionTest.php @@ -1,22 +1,22 @@ getMockBuilder(Model\MediosPago\Toku\Customer::class) + $customer = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $customer->id = $faker->randomNumber(); @@ -60,7 +60,7 @@ class SubscriptionTest extends TestCase $this->venta->method('proyecto')->willReturn($proyecto); $this->venta->method('propiedad')->willReturn($propiedad); - $this->subscription = $this->getMockBuilder(Model\MediosPago\Toku\Subscription::class) + $this->subscription = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Subscription::class) ->disableOriginalConstructor()->getMock(); $this->subscription->id = $faker->randomNumber(); $this->subscription->venta = $this->venta; @@ -71,7 +71,7 @@ class SubscriptionTest extends TestCase 'toku_id' => $this->subscription->toku_id, ]); - $this->subscriptionRepository = $this->getMockBuilder(Repository\MediosPago\Toku\Subscription::class) + $this->subscriptionRepository = $this->getMockBuilder(Repository\Venta\MediosPago\Toku\Subscription::class) ->disableOriginalConstructor()->getMock(); $this->subscriptionRepository->method('fetchById')->willReturn($this->subscription); $this->subscriptionRepository->method('fetchByVenta')->willReturn($this->subscription); @@ -142,25 +142,25 @@ class SubscriptionTest extends TestCase public function testGetById(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $this->assertEquals(json_decode(json_encode($this->subscription), true), $service->getById($this->subscription->toku_id)); } public function testGetByExternalId(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $this->assertEquals(json_decode(json_encode($this->subscription), true), $service->getByExternalId($this->subscription->toku_id)); } public function testGet(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $this->assertArrayIsEqualToArrayIgnoringListOfKeys($this->getData, $service->get($this->subscription->toku_id), []); } public function testAdd(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $sendData = [ 'customer' => $this->postData['customer'], @@ -171,7 +171,7 @@ class SubscriptionTest extends TestCase } public function testEdit(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $sendData = [ 'customer' => $this->postData['customer'], @@ -182,7 +182,7 @@ class SubscriptionTest extends TestCase } public function testDelete(): void { - $service = new Service\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); + $service = new Service\Venta\MediosPago\Toku\Subscription($this->client, $this->subscriptionRepository); $this->expectNotToPerformAssertions(); $service->delete($this->subscription->toku_id); diff --git a/app/tests/unit/src/Service/MediosPago/TokuTest.php b/app/tests/unit/src/Service/Venta/MediosPago/TokuTest.php similarity index 83% rename from app/tests/unit/src/Service/MediosPago/TokuTest.php rename to app/tests/unit/src/Service/Venta/MediosPago/TokuTest.php index 26faad4..bc7b036 100644 --- a/app/tests/unit/src/Service/MediosPago/TokuTest.php +++ b/app/tests/unit/src/Service/Venta/MediosPago/TokuTest.php @@ -1,23 +1,22 @@ persona->apellidoMaterno = $faker->lastName(); $this->persona->method('datos')->willReturn($datos); $this->persona->method('__get')->with('dv')->willReturn($this->persona->digito); - $this->customer = $this->getMockBuilder(Model\MediosPago\Toku\Customer::class) + $this->customer = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $this->customer->id = $faker->randomNumber(); $this->customer->persona = $this->persona; @@ -88,7 +87,7 @@ class TokuTest extends TestCase $this->venta->method('proyecto')->willReturn($proyecto); $this->venta->method('propiedad')->willReturn($propiedad); $this->venta->method('propietario')->willReturn($propietario); - $this->subscription = $this->getMockBuilder(Model\MediosPago\Toku\Subscription::class) + $this->subscription = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Subscription::class) ->disableOriginalConstructor()->getMock(); $this->subscription->id = $faker->randomNumber(); $this->subscription->venta = $this->venta; @@ -105,7 +104,7 @@ class TokuTest extends TestCase $this->cuota->numero = $faker->randomNumber(2); $this->cuota->pago = $this->pago; $pie->method('cuotas')->willReturn([$this->cuota]); - $this->invoice = $this->getMockBuilder(Model\MediosPago\Toku\Invoice::class) + $this->invoice = $this->getMockBuilder(Model\Venta\MediosPago\Toku\Invoice::class) ->disableOriginalConstructor()->getMock(); $this->invoice->id = $faker->randomNumber(); $this->invoice->cuota = $this->cuota; @@ -116,7 +115,7 @@ class TokuTest extends TestCase 'rut' => $this->customer->rut(), 'toku_id' => $this->customer->toku_id ]; - $this->customerService = $this->getMockBuilder(Service\MediosPago\Toku\Customer::class) + $this->customerService = $this->getMockBuilder(Service\Venta\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $this->customerService->method('getById')->willReturn($customerArray); $this->customerService->method('getByExternalId')->willReturn($customerArray); @@ -143,7 +142,7 @@ class TokuTest extends TestCase $this->customerService->method('edit')->willReturn(true); $this->customerService->method('delete'); - $this->subscriptionService = $this->getMockBuilder(Service\MediosPago\Toku\Subscription::class) + $this->subscriptionService = $this->getMockBuilder(Service\Venta\MediosPago\Toku\Subscription::class) ->disableOriginalConstructor()->getMock(); $this->subscriptionService->method('getById')->willReturn([ 'id' => $this->subscription->id, @@ -173,7 +172,7 @@ class TokuTest extends TestCase 'cuota_id' => $this->cuota->id, 'toku_id' => $this->invoice->toku_id, ]; - $this->invoiceService = $this->getMockBuilder(Service\MediosPago\Toku\Invoice::class) + $this->invoiceService = $this->getMockBuilder(Service\Venta\MediosPago\Toku\Invoice::class) ->disableOriginalConstructor()->getMock(); $this->invoiceService->method('getById')->willReturn($invoiceArray); $this->invoiceService->method('getByExternalId')->willReturn($invoiceArray); @@ -207,8 +206,8 @@ class TokuTest extends TestCase public function testSendCustomer(): void { - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $this->customerService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $this->customerService); $expected = [ 'id' => $this->customer->id, @@ -220,9 +219,9 @@ class TokuTest extends TestCase } public function testSendSubscription(): void { - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $this->customerService); - $service->register(Service\MediosPago\Toku::SUBSCRIPTION, $this->subscriptionService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $this->customerService); + $service->register(Service\Venta\MediosPago\Toku::SUBSCRIPTION, $this->subscriptionService); $expected = [ 'id' => $this->subscription->id, @@ -234,10 +233,10 @@ class TokuTest extends TestCase } public function testSendInvoice(): void { - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $this->customerService); - $service->register(Service\MediosPago\Toku::SUBSCRIPTION, $this->subscriptionService); - $service->register(Service\MediosPago\Toku::INVOICE, $this->invoiceService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $this->customerService); + $service->register(Service\Venta\MediosPago\Toku::SUBSCRIPTION, $this->subscriptionService); + $service->register(Service\Venta\MediosPago\Toku::INVOICE, $this->invoiceService); $expected = [ [ @@ -251,9 +250,9 @@ class TokuTest extends TestCase } public function testUpdatePago(): void { - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $this->customerService); - $service->register(Service\MediosPago\Toku::INVOICE, $this->invoiceService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $this->customerService); + $service->register(Service\Venta\MediosPago\Toku::INVOICE, $this->invoiceService); $faker = Faker\Factory::create(); $request = [ @@ -292,9 +291,9 @@ class TokuTest extends TestCase $customerService = clone($this->customerService); $customerService->method('getByExternalId')->willThrowException($emptyResponse); - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $customerService); - $service->register(Service\MediosPago\Toku::INVOICE, $this->invoiceService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $customerService); + $service->register(Service\Venta\MediosPago\Toku::INVOICE, $this->invoiceService); $faker = Faker\Factory::create(); $request = [ @@ -330,9 +329,9 @@ class TokuTest extends TestCase $invoiceService = clone($this->invoiceService); $invoiceService->method('getByExternalId')->willThrowException($emptyResponse); - $service = new Service\MediosPago\Toku($this->logger); - $service->register(Service\MediosPago\Toku::CUSTOMER, $this->customerService); - $service->register(Service\MediosPago\Toku::INVOICE, $invoiceService); + $service = new Service\Venta\MediosPago\Toku($this->logger); + $service->register(Service\Venta\MediosPago\Toku::CUSTOMER, $this->customerService); + $service->register(Service\Venta\MediosPago\Toku::INVOICE, $invoiceService); $this->expectException(InvalidResult::class); $service->updatePago($request['payment_intent']);