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);
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();
orderNum = orderEngine.getOrderHeader().getOrderNum();
invoiceEngine.saveOrder();
}
catch (PaymentException e) {
logger.error(e);
paymentEngine.cancelPayment();
shoppingCart.cancelTransaction();
em.getTransaction().setRollbackOnly();
return actionMapping.findForward("paymentError");
}