feat: enhance checkout process with cart integration and stock confirmation

This commit is contained in:
2026-07-06 14:06:25 -03:00
parent 6bda3bf013
commit dc32eb9bee
11 changed files with 403 additions and 64 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Domains\Integration\Services;
use App\Domains\Purchase\Services\CheckoutService;
use App\Domains\Purchase\Models\TelepagosPayment;
use App\Domains\Purchase\Models\TelepagosQr;
use App\Domains\Tenant\Models\Tenant;
@@ -10,6 +11,10 @@ use Illuminate\Support\Facades\Log;
class TelepagosWebhookService
{
public function __construct(
private readonly CheckoutService $checkoutService,
) {}
/**
* Handle the Telepagos webhook notification.
*
@@ -79,6 +84,7 @@ class TelepagosWebhookService
\Illuminate\Support\Facades\DB::transaction(function () use ($compra, $paymentData) {
TelepagosPayment::create($paymentData);
$this->checkoutService->confirmPurchase($compra);
$compra->finalize();
});