Package com.ateam.webstore.ui.forms

Examples of com.ateam.webstore.ui.forms.OrderPaymentForm


   * Retrieve payment options from the submitted form
   * @return
   */
  public OrderPaymentForm getOrderPaymentRequest() {
   
    OrderPaymentForm opf = new OrderPaymentForm();
   
    CreditCardHandler cch = new CreditCardHandler(req);
   
    opf.setCard(cch.getSelectedCard());
   
    return opf;
  }
View Full Code Here


   * Adds the payment options to the current order.
   * @param submission
   * @return
   */
  public FormSubmission processOrderPaymentRequest() {
    OrderPaymentForm opf = getOrderPaymentRequest();

    Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
   
    order.setCreditCard(opf.getCard());
   
    SalesTaxService sts = new SalesTaxService();
    SalesTax st = sts.getById(opf.getCard().getBillingAddress().getState());
    Double tax = 10.00;
    if (st != null) {
      tax = st.getPercent()/100 * order.getItemSubTotal();
    }
    order.setSalesTax(tax);
   
    opf.setSuccess(true);
    opf.setResultView(getOrderPreView());
     
    return opf;
  }
View Full Code Here

TOP

Related Classes of com.ateam.webstore.ui.forms.OrderPaymentForm

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.