Exemple #1
0
  public String addOrder() {

    paymentInfo.setCreditCardNum(5145);
    paymentInfo.setCvs(234);
    paymentInfo.setExpirationDate(new Date());
    paymentInfo.setPrintedName("Abdallah Mustafa");
    PaymentInfoService paymentInfoService = new PaymentInfoServiceImpl();
    paymentInfo = paymentInfoService.add(paymentInfo);

    order.setPaymentId(paymentInfo);

    order.setDate(new Date());
    order.setQuantity(55);
    order.setTotalPrice(200);

    orderService.add(order);

    return "index?faces-redirect=true";
  }
Exemple #2
0
 public String goToConfirmationPage() {
   order.setTotalPrice(order.getQuantity() * order.getProductId().getPrice());
   return "confirmationPage";
 }