App\Http\Controllers\StoreController::postCheckout PHP Method

postCheckout() public method

public postCheckout ( )
    public function postCheckout()
    {
        $order = $this->userCart();
        if ($order->items()->count() === 0) {
            return error_popup('cart is empty');
        }
        $order->checkout();
        if ((double) $order->getTotal() === 0.0 && Request::input('completed')) {
            file_get_contents("https://osu.ppy.sh/web/ipn.php?mc_gross=0&item_number=store-{$order->user_id}-{$order->order_id}");
            return ujs_redirect(action('StoreController@getInvoice', [$order->order_id]) . '?thanks=1');
        }
        return js_view('store.order-create');
    }