Package com.jada.content.checkout

Examples of com.jada.content.checkout.ShoppingCartActionForm


      EntityManager em = null;
    em = JpaConnection.getInstance().getCurrentEntityManager();
   
    Customer customer = getCustomer(request);
    if (customer.getCustPassword() == null) {
        ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ActionMessages errors = validate(form, site.getSiteId());
      if (errors.size() != 0) {
        saveMessages(request, errors);
        form.setCustPassword(null);
        form.setCustVerifyPassword(null);
        this.initAddressInfo(form, site, shoppingCart, request, errors);
        this.initSearchInfo(form, site.getSiteId(), errors);
        this.initCartInfo(form, site, shoppingCart, request, errors);
            createEmptySecureTemplateInfo(request);
        return actionMapping.findForward("error");
      }
      Customer c = (Customer) em.find(Customer.class, customer.getCustId());
      c.setCustPassword(AESEncoder.getInstance().encode(form.getCustPassword()));
      c.setCustPublicName(form.getCustPublicName());
       }
   
      PayPalEngine paymentEngine = (PayPalEngine) shoppingCart.getPaymentEngine();
      String orderNum = null;
      createEmptySecureTemplateInfo(request);
View Full Code Here


    public ActionForward finalize(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
      ContentBean contentBean = getContentBean(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
      createEmptySecureTemplateInfo(request);
    try {
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ActionForward actionForward = actionMapping.findForward("success");
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
   
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
    this.initCartInfo(form, site, shoppingCart, request, messages);
    this.initCreditCardInfo(form, site, shoppingCart, request, messages);
    this.initSearchInfo(form, site.getSiteId(), messages);
   
    if (form.getPaymentError() != null && form.getPaymentError().equalsIgnoreCase("true")) {
      form.setPaymentMessage(shoppingCart.getPaymentEngine().getPaymentMessage());
    }
   
    if (shoppingCart.isShippingQuoteLock()) {
      this.saveOpenOrder(shoppingCart, Constants.ORDER_STEP_QUOTE_CREDITCARD);
    }
View Full Code Here

        throws Throwable {
     
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      createEmptySecureTemplateInfo(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;

      ActionMessages messages = this.validateCreditCard(form);
      if (messages.size() > 0) {
      saveMessages(request, messages);
        initSearchInfo(form, site.getSiteId(), messages);
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ActionForward actionForward = actionMapping.findForward("success");
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
   
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    if (shoppingCart.isShippingQuoteLock()) {
View Full Code Here

        throws Throwable {
     
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      createEmptySecureTemplateInfo(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
//    shoppingCart.setShippingPickUp(false);
    ActionForward actionForward = null;
    if (shoppingCart.isShippingQuoteLock()) {
          actionForward = actionMapping.findForward("quote");
View Full Code Here

    public ActionForward finalize(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
      ContentBean contentBean = getContentBean(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
      createEmptySecureTemplateInfo(request);
    try {
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
     
      init(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();

    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
    this.initAddressInfo(form, site, shoppingCart, request, messages);
    this.initSearchInfo(form, site.getSiteId(), messages);
    this.initCartInfo(form, site, shoppingCart, request, messages);
   
    if (shoppingCart.isShippingPickUp()) {
      form.setShippingMethodId(Constants.SHOPPING_CART_SHIPPING_PICKUP);
    }
   
    if (shoppingCart.isShippingQuoteLock()) {
      this.saveOpenOrder(shoppingCart, Constants.ORDER_STEP_QUOTE_REVIEWPURCHASE);
    }
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
     
      init(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
     
      ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
     
      String shippingMethodId = form.getShippingMethodId();
      if (shippingMethodId.equals(Constants.SHOPPING_CART_SHIPPING_PICKUP)) {
        shoppingCart.setShippingPickUp(true);
        shoppingCart.setShippingMethod(null);
      }
      else {
View Full Code Here

            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      String couponCode = form.getCouponCode();
    createEmptySecureTemplateInfo(request);
      ActionMessages messages = new ActionMessages();
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
      if (Format.isNullOrEmpty(couponCode)) {
        this.initAddressInfo(form, site, shoppingCart, request, messages);
        this.initCartInfo(form, site, shoppingCart, request, messages);
        messages.add("couponCode", new ActionMessage("content.error.string.required"));
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
      }
     
        Coupon coupon = CouponDAO.loadByCouponCode(site.getSiteId(), couponCode);
        if (coupon == null) {
        this.initAddressInfo(form, site, shoppingCart, request, messages);
          this.initCartInfo(form, site, shoppingCart, request, messages);
        messages.add("couponCode", new ActionMessage("content.error.coupon.invalid"));
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
        }
       
    try {
      shoppingCart.addCoupon(coupon, contentBean);
    }
    catch (CouponNotApplicableException e1) {
      this.initAddressInfo(form, site, shoppingCart, request, messages);
      this.initCartInfo(form, site, shoppingCart, request, messages);
        messages.add("couponCode", new ActionMessage("content.error.coupon.notApplicable"));
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
    }
    catch (CouponUserNotRegisterException e2) {
      this.initAddressInfo(form, site, shoppingCart, request, messages);
      this.initCartInfo(form, site, shoppingCart, request, messages);
        messages.add("couponCode", new ActionMessage("content.error.coupon.notRegister"));
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
    }

    form.setCouponCode("");
    this.initCartInfo(form, site, shoppingCart, request, messages);
   
    if (shoppingCart.isShippingQuoteLock()) {
      this.saveOpenOrder(shoppingCart, Constants.ORDER_STEP_QUOTE_REVIEWPURCHASE);
    }
View Full Code Here

TOP

Related Classes of com.jada.content.checkout.ShoppingCartActionForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.