From 2de02dfd317530e113feecbb8db31afb58db7d05 Mon Sep 17 00:00:00 2001 From: ncoronel Date: Thu, 20 Aug 2026 09:46:32 -0300 Subject: [PATCH] feat: add item editing preparation and enhance payment intent handling in PurchaseController --- .../Purchase/Controllers/PurchaseController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Domains/Purchase/Controllers/PurchaseController.php b/app/Domains/Purchase/Controllers/PurchaseController.php index 17b05a5..c927ac6 100644 --- a/app/Domains/Purchase/Controllers/PurchaseController.php +++ b/app/Domains/Purchase/Controllers/PurchaseController.php @@ -104,6 +104,19 @@ class PurchaseController extends Controller Tenant $tenant, Purchase $compra, CheckoutService $checkoutService, + ): PurchaseResource { + $compra = $this->resolveScopedPurchase($tenant, $request->user()->id, $compra); + + return PurchaseResource::make( + $checkoutService->prepareItemEditing($compra), + ); + } + + public function paymentIntent( + PaymentIntentRequest $request, + Tenant $tenant, + Purchase $compra, + CheckoutService $checkoutService, ): JsonResponse { $compra = $this->resolveScopedPurchase($tenant, $request->user()->id, $compra); $method = $request->validated('method');