function buyWithRequestedEmail() {  // eslint-disable-line no-unused-vars
  try {
    new PaymentRequest(
        [{supportedMethods: 'https://bobpay.com'}],
        {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}},
        {requestPayerEmail: true})
        .show()
        .then(function(resp) {
          resp.complete('success')
              .then(function() {
                print(
                    resp.methodName + '<br>' +
                    JSON.stringify(resp.details, undefined, 2));
              })
              .catch(function(error) {
                print('complete() rejected<br>' + error);
              });
        })
        .catch(function(error) {
          print('show() rejected<br>' + error);
        });
  } catch (error) {
    print('exception thrown<br>' + error);
  }
}
/**
 * Launches the PaymentRequest UI with Bob Pay as the only payment method but
 * requesting the payer's email as to disable skip ui.
 */
Launches the PaymentRequest UI with Bob Pay as the only payment method but
requesting the payer's email as to disable skip ui.
Launches the PaymentRequest UI with Bob Pay as the only payment method but requesting the payer ' s email as to disable skip ui .
function buyWithRequestedEmail() {  
  try {
    new PaymentRequest(
        [{supportedMethods: 'https://bobpay.com'}],
        {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}},
        {requestPayerEmail: true})
        .show()
        .then(function(resp) {
          resp.complete('success')
              .then(function() {
                print(
                    resp.methodName + '<br>' +
                    JSON.stringify(resp.details, undefined, 2));
              })
              .catch(function(error) {
                print('complete() rejected<br>' + error);
              });
        })
        .catch(function(error) {
          print('show() rejected<br>' + error);
        });
  } catch (error) {
    print('exception thrown<br>' + error);
  }
}
function buyWithRequestedEmail ( ) { try { new PaymentRequest ( [ { supportedMethods : 'https://bobpay.com' } ] , { total : { label : 'Total' , amount : { currency : 'USD' , value : '5.00' } } } , { requestPayerEmail : true } ) . show ( ) . then ( function ( resp ) { resp . complete ( 'success' ) . then ( function ( ) { print ( resp . methodName + '<br>' + JSON . stringify ( resp . details , undefined , 2 ) ) ; } ) . catch ( function ( error ) { print ( 'complete() rejected<br>' + error ) ; } ) ; } ) . catch ( function ( error ) { print ( 'show() rejected<br>' + error ) ; } ) ; } catch ( error ) { print ( 'exception thrown<br>' + error ) ; } }
Launches the PaymentRequest UI with Bob Pay as the only payment method but
 requesting the payer's email as to disable skip ui.
Launches the PaymentRequest UI with Bob Pay as the only payment method but requesting the payer ' s email as to disable skip ui .
// eslint-disable-line no-unused-vars