From eca3b01083f6ac360639d37c409a0b3c628a1ace Mon Sep 17 00:00:00 2001 From: ncoronel Date: Tue, 7 Jul 2026 11:11:21 -0300 Subject: [PATCH] feat: update Telepagos webhook and payment intent logic for improved data handling --- app/Domains/Integration/Services/TelepagosWebhookService.php | 4 ++-- app/Domains/Purchase/Controllers/PurchaseController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Domains/Integration/Services/TelepagosWebhookService.php b/app/Domains/Integration/Services/TelepagosWebhookService.php index 53058cb..85663d8 100644 --- a/app/Domains/Integration/Services/TelepagosWebhookService.php +++ b/app/Domains/Integration/Services/TelepagosWebhookService.php @@ -98,8 +98,8 @@ class TelepagosWebhookService $paymentData = [ 'compra_id' => $compra->id, - 'cuit_buyer' => $details['data']['cuit_buyer'] ?? $details['cuit_buyer'] ?? null, - 'cvu_buyer' => $details['data']['cvu_buyer'] ?? $details['cvu_buyer'] ?? null, + 'cuit_buyer' => $details['data']['buyer']['cuit'] ?? $details['buyer']['cuit'] ?? null, + 'cvu_buyer' => $details['data']['buyer']['cvu'] ?? $details['buyer']['cvu'] ?? null, 'amount' => $amount, 'concept' => $details['data']['concept'] ?? $details['concept'] ?? null, 'operation' => $details['data']['operation'] ?? $details['operation'] ?? null, diff --git a/app/Domains/Purchase/Controllers/PurchaseController.php b/app/Domains/Purchase/Controllers/PurchaseController.php index a471256..eda7762 100644 --- a/app/Domains/Purchase/Controllers/PurchaseController.php +++ b/app/Domains/Purchase/Controllers/PurchaseController.php @@ -99,8 +99,8 @@ class PurchaseController extends Controller ); $telepagosQr = $compra->telepagosQr()->create([ - 'qr_order_id' => (string) ($qrResponse['id'] ?? $qrResponse['order_id'] ?? $qrResponse['cashin_id'] ?? ''), - 'qr_code' => $qrResponse['qr'] ?? $qrResponse['qr_code'] ?? $qrResponse['qr_data'] ?? '', + 'qr_order_id' => (string) ($qrResponse['qr_order_id'] ?? ''), + 'qr_code' => $qrResponse['qr_code'] ?? '', ]); } catch (\Exception $e) { return response()->json([