Package com.jada.myaccount.payment

Examples of com.jada.myaccount.payment.MyAccountPaymentActionForm


    public ActionForward start(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      MyAccountPaymentActionForm form = (MyAccountPaymentActionForm) actionForm;
      init(request, form);
      ActionForward actionForward = actionMapping.findForward("success");
      Customer customer = getCustomer(request);
    String siteId = getContentBean(request).getContentSessionKey().getSiteId();

    CustomerCreditCard custCreditCard = null;
      customer = CustomerDAO.load(siteId, customer.getCustId());
      Iterator<?> iterator = customer.getCustCreditCards().iterator();
      if (iterator.hasNext()) {
        custCreditCard = (CustomerCreditCard) iterator.next();
      }
     
      if (custCreditCard != null) {
        form.setCustCreditCardFullName(custCreditCard.getCustCreditCardFullName());
        form.setCustCreditCardExpiryMonth(custCreditCard.getCustCreditCardExpiryMonth());
        form.setCustCreditCardExpiryYear(custCreditCard.getCustCreditCardExpiryYear());
        form.setCustCreditCardNum(AESEncoder.getInstance().decode(custCreditCard.getCustCreditCardNum()));
        form.setCustCreditCardVerNum(custCreditCard.getCustCreditCardVerNum());
        CreditCard creditCard = custCreditCard.getCreditCard();
        if (creditCard != null) {
          form.setCreditCardId(creditCard.getCreditCardId().toString());
        }
      }
      initSearchInfo(form, siteId);
      createEmptySecureTemplateInfo(request);
        return actionForward;
View Full Code Here


            HttpServletResponse response)
        throws Throwable {
     
    createEmptySecureTemplateInfo(request);
    String siteId = ContentAction.getContentBean(request).getContentSessionKey().getSiteId();
    MyAccountPaymentActionForm form = (MyAccountPaymentActionForm) actionForm;
      init(request, form);
 
      ActionMessages messages = validate(form);
      if (messages.size() > 0) {
          initSearchInfo(form, siteId);
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
      }
     
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Customer customer = CustomerDAO.load(siteId, getCustomer(request).getCustId());
    CustomerCreditCard customerCreditCard = null;
      Iterator<?> iterator = customer.getCustCreditCards().iterator();
    boolean found = false;
    if (iterator.hasNext()) {
      found = true;
      customerCreditCard = (CustomerCreditCard) iterator.next();
      customerCreditCard.setRecCreateBy(Constants.USERNAME_SYSTEM);
      customerCreditCard.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    }
    else {
      customerCreditCard = new CustomerCreditCard();
      customerCreditCard.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      customerCreditCard.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customerCreditCard.setRecCreateBy(Constants.USERNAME_SYSTEM);
      customerCreditCard.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    }
    customerCreditCard.setCustCreditCardFullName(form.getCustCreditCardFullName());
    customerCreditCard.setCustCreditCardNum(AESEncoder.getInstance().encode(form.getCustCreditCardNum()));
    customerCreditCard.setCustCreditCardExpiryMonth(form.getCustCreditCardExpiryMonth());
    customerCreditCard.setCustCreditCardExpiryYear(form.getCustCreditCardExpiryYear());
    customerCreditCard.setCustCreditCardVerNum(form.getCustCreditCardVerNum());
    String creditCardId = form.getCreditCardId();
    CreditCard creditCard = (CreditCard) em.find(CreditCard.class, Format.getLong(creditCardId));
    customerCreditCard.setCreditCard(creditCard);
    if (customerCreditCard.getCustCreditCardId() == null) {
      em.persist(customerCreditCard);
    }
View Full Code Here

TOP

Related Classes of com.jada.myaccount.payment.MyAccountPaymentActionForm

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.