_request.setVersion(CURRENT_VERSION);
}
// Add a ButtonSource value.
if (_request instanceof DoDirectPaymentRequestType) {
DoDirectPaymentRequestType dpReq = (DoDirectPaymentRequestType) _request;
if (dpReq.getDoDirectPaymentRequestDetails() == null) {
dpReq.setDoDirectPaymentRequestDetails(new DoDirectPaymentRequestDetailsType());
}
if (dpReq.getDoDirectPaymentRequestDetails().getPaymentDetails() == null) {
dpReq.getDoDirectPaymentRequestDetails().setPaymentDetails(new PaymentDetailsType());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Setting ButtonSource to [" + JavaCommerce.VERSION + "]");
}
dpReq.getDoDirectPaymentRequestDetails().getPaymentDetails().setButtonSource(JavaCommerce.VERSION);
}
else if (_request instanceof DoExpressCheckoutPaymentRequestType) {
DoExpressCheckoutPaymentRequestType ecReq = (DoExpressCheckoutPaymentRequestType) _request;
if (ecReq.getDoExpressCheckoutPaymentRequestDetails() == null) {
ecReq.setDoExpressCheckoutPaymentRequestDetails(new DoExpressCheckoutPaymentRequestDetailsType());