// get the customer object from the session
Customer customer = (Customer) session.getAttribute(Constants.LOGGED_IN_USER_KEY);
// copy form-bean values to new Stake and Address objects
CreditCardBillingDetails creditCardDetails = new CreditCardBillingDetails();
creditCardDetails.setCreditCardType(CreditCardType.getInstance(billingForm.getCreditCardType()));
creditCardDetails.setCreditCardExpirationMonth(billingForm.getCreditCardExpirationMonth());
creditCardDetails.setCreditCardExpirationYear(billingForm.getCreditCardExpirationYear());
creditCardDetails.setCreditCardNumber(billingForm.getCreditCardNumber());
creditCardDetails.setCreditCardCVVSCode(billingForm.getCreditCardCVVSCode());
// attache the address to this new customer
customer.addBillingDetails(creditCardDetails);
// get a DAO for the new Stake