String currency) throws ProtocolException {
if (StringUtil.isEmpty(reason)) {
throw new ProtocolException("Refunding order: reason is missing!");
}
RefundOrderRequest refundRequest = _objectFact.createRefundOrderRequest();
refundRequest.setGoogleOrderNumber(orderNumber);
refundRequest.setReason(reason);
if (amount > 0.0F && !StringUtil.isEmpty(currency)) {
Money refundAmount = createMoney(amount, currency);
refundRequest.setAmount(refundAmount);
}
JAXBElement<RefundOrderRequest> refundOrder
= _objectFact.createRefundOrder(refundRequest);
return convertToDOM(refundOrder);