public DeclinedRefundException(int statusCode, String responseBody, RefundErrorResponse errors) {
   super(
       buildMessage(errors),
       statusCode,
       responseBody,
       errors != null ? errors.getErrorId() : null,
       errors != null ? errors.getErrors() : null);
   this.errors = errors;
 }
 private static String buildMessage(RefundErrorResponse errors) {
   RefundResult refund = errors != null ? errors.getRefundResult() : null;
   if (refund != null) {
     return "declined refund '" + refund.getId() + "' with status '" + refund.getStatus() + "'";
   } else {
     return "the GlobalCollect platform returned a declined refund response";
   }
 }
 /** @return The result of creating a refund if available, otherwise returns {@code null}. */
 public RefundResult getRefundResult() {
   return errors == null ? null : errors.getRefundResult();
 }