feat: add payer_dni field and validation for transfer payments, update related logic and tests

This commit is contained in:
2026-07-12 19:48:56 +00:00
parent ca4fea6bcd
commit ca7a2ae55c
7 changed files with 102 additions and 4 deletions

View File

@@ -57,10 +57,16 @@ class PurchaseController extends Controller
$method = $request->validated('method');
$totalAmount = $compra->calculateCurrentTotalAmount();
$compra->update([
$purchaseUpdate = [
'payment_method' => $method,
'total' => $totalAmount,
]);
];
if ($method === 'transfer') {
$purchaseUpdate['payer_dni'] = preg_replace('/\D+/', '', (string) $request->validated('payer_dni'));
}
$compra->update($purchaseUpdate);
if ($method === 'transfer') {
$telepagosService = new \App\Domains\Integration\Services\TelepagosIntegrationService();