WrongGuestCredentialsException example

// Throw exception when customer is not guest         if (!$guest) {
            throw CartException::customerNotLoggedIn();
        }

        // Verify email and zip code with this order         if ($request->get('email', false) && $request->get('zipcode', false)) {
            $billingAddress = $order->getBillingAddress();
            if ($billingAddress === null
                || $request->get('email') !== $orderCustomer->getEmail()
                || $request->get('zipcode') !== $billingAddress->getZipcode()) {
                throw new WrongGuestCredentialsException();
            }
        } else {
            throw new GuestNotAuthenticatedException();
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.