feat: add item editing preparation and enhance payment intent handling in PurchaseController
This commit is contained in:
parent
f9a766dee1
commit
2de02dfd31
|
|
@ -104,6 +104,19 @@ class PurchaseController extends Controller
|
||||||
Tenant $tenant,
|
Tenant $tenant,
|
||||||
Purchase $compra,
|
Purchase $compra,
|
||||||
CheckoutService $checkoutService,
|
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 {
|
): JsonResponse {
|
||||||
$compra = $this->resolveScopedPurchase($tenant, $request->user()->id, $compra);
|
$compra = $this->resolveScopedPurchase($tenant, $request->user()->id, $compra);
|
||||||
$method = $request->validated('method');
|
$method = $request->validated('method');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue