}
}
public static final SetExpressCheckoutRequestDetailsType buildSetExpressCheckoutDetailsRequest(
HttpServletRequest _request) {
SetExpressCheckoutRequestDetailsType request = new SetExpressCheckoutRequestDetailsType();
if (_request.getParameter(PARAM_ADDRESS_OVERRIDE) != null) {
if (_request.getParameter(PARAM_ADDRESS_OVERRIDE).equals("1")) {
// Address
request.setAddress(buildAddress(_request));
}
request.setAddressOverride(_request
.getParameter(PARAM_ADDRESS_OVERRIDE));
}
if (_request.getParameter(PARAM_BUYER_EMAIL) != null) {
request.setBuyerEmail(_request.getParameter(PARAM_BUYER_EMAIL));
}
if (_request.getParameter(PARAM_CANCEL_URL) != null) {
request.setCancelURL(_request.getParameter(PARAM_CANCEL_URL));
}
if (_request.getParameter(PARAM_CPP_HEADER_BACK_COLOR) != null) {
request.setCppHeaderBackColor(_request
.getParameter(PARAM_CPP_HEADER_BACK_COLOR));
}
if (_request.getParameter(PARAM_CPP_HEADER_BORDER_COLOR) != null) {
request.setCppHeaderBorderColor(_request
.getParameter(PARAM_CPP_HEADER_BORDER_COLOR));
}
if (_request.getParameter(PARAM_CPP_HEADER_IMAGE) != null) {
request.setCppHeaderImage(_request
.getParameter(PARAM_CPP_HEADER_IMAGE));
}
if (_request.getParameter(PARAM_CPP_PAYFLOW_COLOR) != null) {
request.setCppPayflowColor(_request
.getParameter(PARAM_CPP_PAYFLOW_COLOR));
}
if (_request.getParameter(PARAM_CUSTOM) != null) {
request.setCustom(_request.getParameter(PARAM_CUSTOM));
}
if (_request.getParameter(PARAM_INVOICE_ID) != null) {
request.setInvoiceID(_request.getParameter(PARAM_INVOICE_ID));
}
if (_request.getParameter(PARAM_LOCALE_CODE) != null) {
request.setLocaleCode(_request.getParameter(PARAM_LOCALE_CODE));
}
if (_request.getParameter(PARAM_MAX_AMOUNT) != null) {
BasicAmountType maxAmount = new BasicAmountType();
maxAmount.set_value(_request.getParameter(PARAM_MAX_AMOUNT));
if (_request.getParameter(PARAM_MAX_AMOUNT_CURRENCY_ID) != null) {
maxAmount.setCurrencyID(CurrencyCodeType.fromString(_request
.getParameter(PARAM_MAX_AMOUNT_CURRENCY_ID)));
}
request.setMaxAmount(maxAmount);
}
if (_request.getParameter(PARAM_NO_SHIPPING) != null) {
request.setNoShipping(_request.getParameter(PARAM_NO_SHIPPING));
}
if (_request.getParameter(PARAM_ORDER_DESCRIPTION) != null) {
request.setOrderDescription(_request
.getParameter(PARAM_ORDER_DESCRIPTION));
}
if (_request.getParameter(PARAM_ORDER_TOTAL) != null) {
BasicAmountType orderTotal = new BasicAmountType();
orderTotal.set_value(_request.getParameter(PARAM_ORDER_TOTAL));
if (_request.getParameter(PARAM_ORDER_TOTAL_CURRENCY_ID) != null) {
orderTotal.setCurrencyID(CurrencyCodeType.fromString(_request
.getParameter(PARAM_ORDER_TOTAL_CURRENCY_ID)));
}
request.setOrderTotal(orderTotal);
}
if (_request.getParameter(PARAM_PAGE_STYLE) != null) {
request.setPageStyle(_request.getParameter(PARAM_PAGE_STYLE));
}
if (_request.getParameter(PARAM_PAYMENT_ACTION) != null) {
request.setPaymentAction(PaymentActionCodeType.fromString(_request
.getParameter(PARAM_PAYMENT_ACTION)));
}
if (_request.getParameter(PARAM_REQ_CONFIRM_SHIPPING) != null) {
request.setReqConfirmShipping(_request
.getParameter(PARAM_REQ_CONFIRM_SHIPPING));
}
if (_request.getParameter(PARAM_RETURN_URL) != null) {
request.setReturnURL(_request.getParameter(PARAM_RETURN_URL));
}
if (_request.getParameter(PARAM_TOKEN) != null) {
request.setToken(_request.getParameter(PARAM_TOKEN));
}
return request;
}