From f32204df97f7f0ddabfa2a2ee250871915e3d381 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 27 May 2025 18:35:06 -0400 Subject: [PATCH] FIX: Remove toku concept in database --- app/src/Service/Venta/MediosPago/Toku.php | 4 ++-- app/src/Service/Venta/MediosPago/Toku/Customer.php | 1 + app/src/Service/Venta/MediosPago/Toku/Invoice.php | 1 + app/src/Service/Venta/MediosPago/Toku/Subscription.php | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/Service/Venta/MediosPago/Toku.php b/app/src/Service/Venta/MediosPago/Toku.php index af30beb..75e90fa 100644 --- a/app/src/Service/Venta/MediosPago/Toku.php +++ b/app/src/Service/Venta/MediosPago/Toku.php @@ -252,9 +252,9 @@ class Toku extends Ideal\Service { $output = []; try { - $output['invoice'] = $this->invoice->reset($skips['invoice'] ?? []); - $output['subscription'] = $this->subscription->reset($skips['subscription'] ?? []); $output['customer'] = $this->customer->reset($skips['customer'] ?? []); + $output['subscription'] = $this->subscription->reset($skips['subscription'] ?? []); + $output['invoice'] = $this->invoice->reset($skips['invoice'] ?? []); } catch (InvalidResult $exception) { $this->logger->warning($exception); return []; diff --git a/app/src/Service/Venta/MediosPago/Toku/Customer.php b/app/src/Service/Venta/MediosPago/Toku/Customer.php index 3bd5749..53fc013 100644 --- a/app/src/Service/Venta/MediosPago/Toku/Customer.php +++ b/app/src/Service/Venta/MediosPago/Toku/Customer.php @@ -58,6 +58,7 @@ class Customer extends AbstractEndPoint foreach ($customers as $customer) { try { $this->delete($customer->toku_id); + $this->customerRepository->remove($customer); } catch (EmptyResponse $exception) { $this->logger->warning($exception, ['customer' => $customer]); } diff --git a/app/src/Service/Venta/MediosPago/Toku/Invoice.php b/app/src/Service/Venta/MediosPago/Toku/Invoice.php index 2c1d01d..d808516 100644 --- a/app/src/Service/Venta/MediosPago/Toku/Invoice.php +++ b/app/src/Service/Venta/MediosPago/Toku/Invoice.php @@ -65,6 +65,7 @@ class Invoice extends AbstractEndPoint foreach ($invoices as $invoice) { try { $this->delete($invoice->toku_id); + $this->invoiceRepository->remove($invoice); } catch (EmptyResponse $exception) { $this->logger->warning($exception, ['invoice' => $invoice]); } diff --git a/app/src/Service/Venta/MediosPago/Toku/Subscription.php b/app/src/Service/Venta/MediosPago/Toku/Subscription.php index 76a4856..101b624 100644 --- a/app/src/Service/Venta/MediosPago/Toku/Subscription.php +++ b/app/src/Service/Venta/MediosPago/Toku/Subscription.php @@ -62,6 +62,7 @@ class Subscription extends AbstractEndPoint foreach ($subscriptions as $subscription) { try { $this->delete($subscription->toku_id); + $this->subscriptionRepsitory->remove($subscription); } catch (EmptyResponse $exception) { $this->logger->warning($exception, ['subscription' => $subscription]); }