function buy() {  // eslint-disable-line no-unused-vars
  try {
    new PaymentRequest(
        [
          {supportedMethods: 'https://bobpay.com'},
          {supportedMethods: 'basic-card'},
        ],
        {
          total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
          modifiers: [{
            supportedMethods: 'https://bobpay.com',
            total: {
              label: 'Total',
              amount: {currency: 'USD', value: '4.00'},
            },
            additionalDisplayItems: [{
              label: 'BobPay discount',
              amount: {currency: 'USD', value: '-1.00'},
            }],
            data: {
              discountProgramParticipantId: '86328764873265',
            },
          }],
        })
        .show()
        .then(function(resp) {
          resp.complete('success')
              .then(function() {
                print(JSON.stringify(resp, undefined, 2));
              })
              .catch(function(error) {
                print('complete() rejected<br>' + error.message);
              });
        })
        .catch(function(error) {
          print('show() rejected<br>' + error.message);
        });
  } catch (error) {
    print('exception thrown<br>' + error.message);
  }
}
/**
 * Launches the PaymentRequest UI with Bob Pay and 'basic-card' as
 * payment methods, and Bob Pay modifier.
 */
Launches the PaymentRequest UI with Bob Pay and 'basic-card' as
payment methods, and Bob Pay modifier.
Launches the PaymentRequest UI with Bob Pay and ' basic - card ' as payment methods and Bob Pay modifier .
function buy() {  
  try {
    new PaymentRequest(
        [
          {supportedMethods: 'https://bobpay.com'},
          {supportedMethods: 'basic-card'},
        ],
        {
          total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
          modifiers: [{
            supportedMethods: 'https://bobpay.com',
            total: {
              label: 'Total',
              amount: {currency: 'USD', value: '4.00'},
            },
            additionalDisplayItems: [{
              label: 'BobPay discount',
              amount: {currency: 'USD', value: '-1.00'},
            }],
            data: {
              discountProgramParticipantId: '86328764873265',
            },
          }],
        })
        .show()
        .then(function(resp) {
          resp.complete('success')
              .then(function() {
                print(JSON.stringify(resp, undefined, 2));
              })
              .catch(function(error) {
                print('complete() rejected<br>' + error.message);
              });
        })
        .catch(function(error) {
          print('show() rejected<br>' + error.message);
        });
  } catch (error) {
    print('exception thrown<br>' + error.message);
  }
}
function buy ( ) { try { new PaymentRequest ( [ { supportedMethods : 'https://bobpay.com' } , { supportedMethods : 'basic-card' } , ] , { total : { label : 'Total' , amount : { currency : 'USD' , value : '5.00' } } , modifiers : [ { supportedMethods : 'https://bobpay.com' , total : { label : 'Total' , amount : { currency : 'USD' , value : '4.00' } , } , additionalDisplayItems : [ { label : 'BobPay discount' , amount : { currency : 'USD' , value : '-1.00' } , } ] , data : { discountProgramParticipantId : '86328764873265' , } , } ] , } ) . show ( ) . then ( function ( resp ) { resp . complete ( 'success' ) . then ( function ( ) { print ( JSON . stringify ( resp , undefined , 2 ) ) ; } ) . catch ( function ( error ) { print ( 'complete() rejected<br>' + error . message ) ; } ) ; } ) . catch ( function ( error ) { print ( 'show() rejected<br>' + error . message ) ; } ) ; } catch ( error ) { print ( 'exception thrown<br>' + error . message ) ; } }
Launches the PaymentRequest UI with Bob Pay and 'basic-card' as
 payment methods, and Bob Pay modifier.
Launches the PaymentRequest UI with Bob Pay and ' basic - card ' as payment methods and Bob Pay modifier .
// eslint-disable-line no-unused-vars