}
return details;
}
public static final DoDirectPaymentRequestDetailsType buildDoDirectPaymentRequestDetails(HttpServletRequest _request) {
DoDirectPaymentRequestDetailsType details = new DoDirectPaymentRequestDetailsType();
CreditCardDetailsType cardDetails = new CreditCardDetailsType();
PayerInfoType cardOwner = new PayerInfoType();
cardOwner.setAddress(buildAddress(_request));
if (_request.getParameter(PARAM_PAYER) != null) {
cardOwner.setPayer(_request.getParameter(PARAM_PAYER));
}
PersonNameType name = new PersonNameType();
if (_request.getParameter(PARAM_FIRST_NAME) != null) {
name.setFirstName(_request.getParameter(PARAM_FIRST_NAME));
}
if (_request.getParameter(PARAM_LAST_NAME) != null) {
name.setLastName(_request.getParameter(PARAM_LAST_NAME));
}
cardOwner.setPayerName(name);
cardDetails.setCardOwner(cardOwner);
if (_request.getParameter(PARAM_CREDIT_CARD_NUMBER) != null) {
cardDetails.setCreditCardNumber(_request.getParameter(PARAM_CREDIT_CARD_NUMBER));
}
if (_request.getParameter(PARAM_CREDIT_CARD_TYPE) != null) {
cardDetails.setCreditCardType(CreditCardTypeType.fromString(_request.getParameter(PARAM_CREDIT_CARD_TYPE)));
}
if (_request.getParameter(PARAM_CVV2) != null) {
cardDetails.setCVV2(_request.getParameter(PARAM_CVV2));
}
if (_request.getParameter(PARAM_EXP_MONTH) != null) {
cardDetails.setExpMonth(Integer.parseInt(_request.getParameter(PARAM_EXP_MONTH)));
}
if (_request.getParameter(PARAM_EXP_YEAR) != null) {
cardDetails.setExpYear(Integer.parseInt(_request.getParameter(PARAM_EXP_YEAR)));
}
details.setCreditCard(cardDetails);
if (_request.getParameter(PARAM_IP_ADDRESS) != null) {
details.setIPAddress(_request.getParameter(PARAM_IP_ADDRESS));
}
if (_request.getParameter(PARAM_MERCHANT_SESSION_ID) != null) {
details.setMerchantSessionId(_request.getParameter(PARAM_MERCHANT_SESSION_ID));
}
if (_request.getParameter(PARAM_PAYMENT_ACTION) != null) {
details.setPaymentAction(PaymentActionCodeType.fromString(_request.getParameter(PARAM_PAYMENT_ACTION)));
}
details.setPaymentDetails(buildPaymentDetails(_request));
return details;
}