From 2f481ef8a905084e44bcbb75c2c706bfa938e04a Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 15 May 2025 10:06:35 -0400 Subject: [PATCH] FIX: mapeo de datos al actualizar pago --- app/src/Service/Venta/MediosPago/Toku.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/Service/Venta/MediosPago/Toku.php b/app/src/Service/Venta/MediosPago/Toku.php index b34aab2..a295148 100644 --- a/app/src/Service/Venta/MediosPago/Toku.php +++ b/app/src/Service/Venta/MediosPago/Toku.php @@ -161,7 +161,7 @@ class Toku extends Ideal\Service $customer = $this->customer->getByExternalId($request['customer']); $invoice = $this->invoice->getByExternalId($request['invoice']); - return $this->invoice->update($invoice['id'], $request); + return $this->invoice->update($invoice['toku_id'], $request); } protected function successTransaction(array $input): bool { @@ -253,6 +253,9 @@ class Toku extends Ideal\Service protected function mapPaymentEventData(array $input): array { $data = $input['payment']; + if (!array_key_exists('amount', $data) and array_key_exists('payment_amount', $data)) { + $data['amount'] = $data['payment_amount']; + } $data['status'] = 'AUTHORIZED'; $data['date'] = $data['payment_date']; return $data;