var timeoutID1;
var timeoutID2;

/**
 * Prints the given error message.
 * @param {string} msg - The error message to print.
 */
function error(msg) {  // eslint-disable-line no-unused-vars
  if (timeoutID1) {
    window.clearTimeout(timeoutID1);
  }
  if (timeoutID2) {
    window.clearTimeout(timeoutID2);
  }
  var element = document.getElementById('msg');
  element.innerHTML = msg;
  element.className = 'error';
  timeoutID1 = window.setTimeout(function() {
    if (element.className !== 'error') {
      return;
    }
    element.className = 'error-hide';
    timeoutID2 = window.setTimeout(function() {
      element.innerHTML = '';
      element.className = '';
    }, 500);
  }, 10000);
}

/**
 * Prints the given informational message.
 * @param {string} msg - The information message to print.
 */
function info(msg) {
  var element = document.getElementById('msg');
  element.innerHTML = msg;
  element.className = 'info';
}

/**
 * Converts an address object into a dictionary.
 * @param {PaymentAddress} addr - The address to convert.
 * @return {object} The resulting dictionary.
 */
function toDictionary(addr) {  // eslint-disable-line no-unused-vars
  var dict = {};
  if (addr) {
    dict.country = addr.country;
    dict.region = addr.region;
    dict.city = addr.city;
    dict.dependentLocality = addr.dependentLocality;
    dict.addressLine = addr.addressLine;
    dict.postalCode = addr.postalCode;
    dict.sortingCode = addr.sortingCode;
    dict.languageCode = addr.languageCode;
    dict.organization = addr.organization;
    dict.recipient = addr.recipient;
    dict.careOf = addr.careOf;
    dict.phone = addr.phone;
  }
  return dict;
}

/**
 * Called when the payment request is complete.
 * @param {string} message - The human readable message to display.
 * @param {ShippingAddress} shippingAddress - User's shipping address.
 * @param {string} shippingOption - User's preferred shipping opion.
 * @param {string} methodName - The type of payment instrument the user is
 *                              providing.
 * @param {object} instrumentDetails - The payment instrument data to charge.
 * @param {object} totalAmount - The total amount to charge.
 * @param {string} payerEmail - User's preferred contact email address.
 * @param {string} payerPhone - User's preferred contact phone number.
 */
function done(message, shippingAddress, shippingOption, methodName, instrumentDetails, totalAmount, payerEmail, payerPhone) {  // eslint-disable-line no-unused-vars
  var element = document.getElementById('contents');
  element.innerHTML = message;
  info('total:<br/>' +
    JSON.stringify(totalAmount, undefined, 2) +
    '<br/>' +
    'method:<br/>' +
    methodName +
    '<br/>' +
    'instrument:<br/>' +
    JSON.stringify(instrumentDetails, undefined, 2) +
    '<br/>' +
    'shipping option:<br/>' +
    shippingOption +
    '<br/>' +
    'shipping address:<br/>' +
    JSON.stringify(toDictionary(shippingAddress), undefined, 2) +
    '<br/>' +
    'email:<br/>' +
    payerEmail +
    '<br/>' +
    'phone:<br/>' +
    payerPhone);
}

@@ -2583,16 +2583,217 @@
 %0A  info(
+'method: ' + methodName +%0A    '%3Cbr/%3E' +%0A    'shipping option: ' + shippingOption +%0A    '%3Cbr/%3E' +%0A    '%3Cbr/%3E' +%0A    'email: ' + payerEmail +%0A    '%3Cbr/%3E' +%0A    'phone: ' + payerPhone +%0A    '%3Cbr/%3E' +%0A    
 'total:%3C
@@ -2866,60 +2866,8 @@
 ' +%0A
-    'method:%3Cbr/%3E' +%0A    methodName +%0A    '%3Cbr/%3E' +%0A
     
@@ -2959,73 +2959,8 @@
 ' +%0A
-    'shipping option:%3Cbr/%3E' +%0A    shippingOption +%0A    '%3Cbr/%3E' +%0A
     
@@ -3053,110 +3053,8 @@
 , 2)
- +%0A    '%3Cbr/%3E' +%0A    'email:%3Cbr/%3E' +%0A    payerEmail +%0A    '%3Cbr/%3E' +%0A    'phone:%3Cbr/%3E' +%0A    payerPhone
 );%0A%7D

Put single line fields together