# fluent-cart/1.6.4/app/Http/Controllers/CheckoutController.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 69 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Controllers/CheckoutController.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Http/Controllers/CheckoutController.php
- Modified: 2026-02-25T14:08:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Controllers/CheckoutController.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Http\Controllers;


use FluentCart\Api\Checkout\CheckoutApi;
use FluentCart\App\Helpers\CartHelper;
use FluentCart\App\Helpers\Helper;
use FluentCart\App\Models\ShippingMethod;
use FluentCart\App\Services\RateLimiter;
use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
use FluentCart\Framework\Http\Request\Request;

class CheckoutController extends Controller
{
    /**
     * @throws \Exception
     */
    public function placeOrder(Request $request)
    {
        RateLimiter::isSpamming('place_order_attempt', 5, 60, true);

        CheckoutApi::placeOrder($request->all(), true);
    }

    public function getCheckoutSummary(Request $request)
    {
        $checkOutHelper =  \FluentCart\App\Helpers\CartCheckoutHelper::make();
        $shippingMethodId = $request->getSafe('shipping_method_id', 'sanitize_text_field');


        $charge = 0;
        $shippingMethod = ShippingMethod::query()->find($shippingMethodId);
        if (!empty($shippingMethod)) {
            $charge = CartHelper::calculateShippingMethodCharge($shippingMethod);
        }

        ob_start();
        do_action('fluent_cart/views/checkout_page_cart_item_list', [
            'checkout' => $checkOutHelper,
            'items'    => $checkOutHelper->getItems()
        ]);
        $views = ob_get_clean();

        $items['views'] = $views;
        $items['subtotal'] = $checkOutHelper->getItemsAmountSubtotal(true, true);

        $total = $checkOutHelper->getItemsAmountTotal(false, false);

        $items['has_subscriptions'] = $checkOutHelper->hasSubscription() === 'yes';
        $items['shipping_charge'] = $charge;
        $items['unformatted_total'] = $total + $charge;
        $formatted = Helper::toDecimal($total + $charge, true);
        $items['total'] = $formatted;
        $items['shipping_charge_formated'] = Helper::toDecimal($charge, true);
        $items['shipping_method_id'] = $shippingMethodId;

        return [
            'items' => $items
        ];
    }

    public function getOrderInfo(Request $request)
    {
        $paymentManager = GatewayManager::getInstance()->get($request->getSafe('method', 'sanitize_text_field'));
        return $paymentManager->getOrderInfo($request->all());
    }
}

```
