Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.OrderHeader


      PayPalEngine paymentEngine = (PayPalEngine) shoppingCart.getPaymentEngine();
      String orderNum = null;
      createEmptySecureTemplateInfo(request);
    OrderEngine orderEngine = new OrderEngine(shoppingCart, null);
      try {
        OrderHeader orderHeader = orderEngine.getOrderHeader();
      InvoiceEngine invoiceEngine = new InvoiceEngine(orderHeader, null);
      invoiceEngine.invoiceAll();
      invoiceEngine.setCreditCardInfo(orderEngine.getCreditCardInfo());
      invoiceEngine.payOrder(shoppingCart.getPaymentEngine(), request);
      orderEngine.saveOrder();
View Full Code Here


    paymentMessage = MESSAGE_NOTIMPLEMENTED;
    throw new NotImplementedException("");
  }

  public void authorizeAndCapturePayment(InvoiceHeader invoiceHeader, HttpServletRequest request) throws PaymentException, Exception {
    OrderHeader orderHeader = invoiceHeader.getOrderHeader();
    TxnRequest order = formatOrder(orderHeader);
    order.setTxnType(CARDACTION_SALE);

    String url = SERVICE_URL_SANDBOX;
    if (isProduction()) {
View Full Code Here

  public void voidPayment(InvoiceHeader invoiceHeader) throws AuthorizationException, PaymentException, Exception {
    throw new NotImplementedException("");
  }

  public void creditPayment(CreditHeader creditHeader) throws AuthorizationException, PaymentException, Exception {
    OrderHeader orderHeader = creditHeader.getOrderHeader();

    TxnRequest order = new TxnRequest();
    order.setPostUsername(postUsername);
    order.setPostPassword(postPassword)
    order.setInputCurrency(orderHeader.getSiteCurrency().getSiteCurrencyClass().getSiteCurrencyClassName());
    order.setAmount(Format.getSimpleFloat(creditHeader.getCreditTotal()));

    PaymentTran payment = orderHeader.getPaymentTran();
    if (payment == null) {
      for (InvoiceHeader invoiceHeader : orderHeader.getInvoiceHeaders()) {
        payment = invoiceHeader.getPaymentTran();
      }
    }
    order.setDpsTxnRef(payment.getPaymentReference1());
    order.setTxnId(payment.getPaymentReference2());
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
      initOrder(form, orderHeader, null, null, null, request);
    ActionForward actionForward = actionMapping.findForward("success");
    return actionForward;
  }
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
      String siteId = getAdminBean(request).getSiteId();
      OrderHeader orderHeader = OrderHeaderDAO.load(siteId, Format.getLong(form.getOrderHeaderId()));
      orderHeader.setOrderStatus(Constants.ORDERSTATUS_CANCELLED);
      initOrder(form, orderHeader, null, null, null, request);
    ActionForward actionForward = actionMapping.findForward("success");
    return actionForward;
  }
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
      String orderTrackingMessage = form.getOrderTrackingMessage();
      if (!Format.isNullOrEmpty(orderTrackingMessage)) {
        AdminBean adminBean = getAdminBean(request);
        User user = adminBean.getUser();
        OrderTracking orderTracking = new OrderTracking();
        orderTracking.setOrderTrackingCode("");
        orderTracking.setOrderTrackingMessage(orderTrackingMessage);
        if (form.isOrderTrackingInternal()) {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_YES));
        }
        else {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_NO));
        }
        orderTracking.setRecUpdateBy(user.getUserId());
        orderTracking.setRecUpdateDatetime(new Date());
        orderTracking.setRecCreateBy(user.getUserId());
        orderTracking.setRecCreateDatetime(new Date());
        orderTracking.setOrderHeader(orderHeader);
        em.persist(orderTracking);
        orderHeader.getOrderTrackings().add(orderTracking);
       
        /*
        Vector<OrderTracking> temp = new Vector<OrderTracking>();
        Iterator<?> trackingIterator<?> = orderHeader.getOrderTrackings().iterator();
        while (trackingIterator.hasNext()) {
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
     
    ActionMessages errors = validateShipping(form);
    if (errors.size() != 0) {
      saveMessages(request, errors);
        initOrder(form, orderHeader, null, null, null, request);
      return actionMapping.findForward("error");
    }
   
    orderHeader.setShippingTotal(Format.getFloatObj(form.getShippingQuoteTotal()));
    orderHeader.setShippingValidUntil(Format.getDate(form.getShippingValidUntil()));

      initOrder(form, orderHeader, null, null, null, request);
    ActionForward actionForward = actionMapping.findForward("success");
    return actionForward;
  }
View Full Code Here

    AdminBean adminBean = getAdminBean(request);
    User user = adminBean.getUser();

      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
     
    ActionMessages errors = validateShipping(form);
    if (errors.size() != 0) {
      saveMessages(request, errors);
        initOrder(form, orderHeader, null, null, null, request);
      return actionMapping.findForward("error");
    }
   
    orderHeader.setShippingTotal(Format.getFloatObj(form.getShippingQuoteTotal()));
    orderHeader.setShippingValidUntil(Format.getDate(form.getShippingValidUntil()));

    OrderEngine orderEngine = new OrderEngine(orderHeader, null);
    try {
      orderEngine.sendShippingQuoteEmail(this.getServlet().getServletContext());
     
        OrderTracking orderTracking = new OrderTracking();
        orderTracking.setOrderTrackingCode("");
        orderTracking.setOrderTrackingMessage("Shipping qoute sent");
        orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_NO));
        orderTracking.setRecUpdateBy(user.getUserId());
        orderTracking.setRecUpdateDatetime(new Date());
        orderTracking.setRecCreateBy(user.getUserId());
        orderTracking.setRecCreateDatetime(new Date());
        orderTracking.setOrderHeader(orderHeader);
        em.persist(orderTracking);
        orderHeader.getOrderTrackings().add(orderTracking);
    }
    catch (Exception e) {
      logger.error("Unable to send mail", e);
        initOrder(form, orderHeader, null, null, null, request);
        errors.add("sendShippingQuote", new ActionMessage("content.error.mail.send"));
View Full Code Here

            HttpServletResponse response) throws Throwable {
      OrderMaintActionForm form = (OrderMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    AdminBean adminBean = getAdminBean(request);
    User user = adminBean.getUser();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
      OrderTrackingDisplayForm trackingForms[] = form.getOrderTrackings();
      for (int i = 0 ; i < trackingForms.length; i++) {
        OrderTracking orderTracking = (OrderTracking) em.find(OrderTracking.class, Format.getLong(trackingForms[i].getOrderTrackingId()));
        String value = String.valueOf(Constants.VALUE_NO);
        if (trackingForms[i].isOrderTrackingInternal()) {
View Full Code Here

            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
   
    InvoiceEngine invoiceEngine = new InvoiceEngine(orderHeader, user);
    invoiceEngine.invoiceAll();
      initOrder(form, orderHeader, null, null, null, request);
    InvoiceHeader invoiceHeader = invoiceEngine.getInvoiceHeader();
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.OrderHeader

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.