feat: Complete checkout overhaul with Stripe PaymentIntent integration and abandoned cart recovery
This commit is contained in:
@@ -123,32 +123,7 @@ class MarketingController extends Controller
|
||||
return $this->checkout($request, $packageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the purchase wizard.
|
||||
*/
|
||||
public function purchaseWizard(Request $request, $packageId)
|
||||
{
|
||||
$package = Package::findOrFail($packageId)->append(['features', 'limits']);
|
||||
$packageOptions = Package::where('type', $package->type)
|
||||
->orderBy('price')
|
||||
->get()
|
||||
->map(function ($candidate) {
|
||||
return $candidate->append(['features', 'limits']);
|
||||
});
|
||||
$stripePublishableKey = config('services.stripe.key');
|
||||
$privacyHtml = view('legal.datenschutz-partial', ['locale' => app()->getLocale()])->render();
|
||||
|
||||
$csp = "default-src 'self'; script-src 'self' 'unsafe-inline' http://localhost:5173 https://js.stripe.com https://js.stripe.network; style-src 'self' 'unsafe-inline' data: https:; img-src 'self' data: https: blob:; font-src 'self' data: https:; connect-src 'self' http://localhost:5173 ws://localhost:5173 https://api.stripe.com https://api.stripe.network wss://*.stripe.network; media-src data: blob: 'self' https: https://js.stripe.com https://*.stripe.com; frame-src 'self' https://js.stripe.com https://*.stripe.com; object-src 'none'; base-uri 'self'; form-action 'self';";
|
||||
|
||||
$response = Inertia::render('marketing/PurchaseWizard', [
|
||||
'package' => $package,
|
||||
'packageOptions' => $packageOptions,
|
||||
'stripePublishableKey' => $stripePublishableKey,
|
||||
'privacyHtml' => $privacyHtml,
|
||||
])->toResponse($request);
|
||||
$response->headers->set('Content-Security-Policy', $csp);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checkout for Stripe with auth metadata.
|
||||
|
||||
Reference in New Issue
Block a user