function buy() {  // eslint-disable-line no-unused-vars
  try {
    new PaymentRequest(
        [{supportedMethods: 'https://bobpay.com'}],
        {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}})
        .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.
 *
 * <p>When the developer chooses a single payment method and requests no other
 * data (no shipping, no email, no phone, ...), Payment Request will apply
 * the UI skip optimization, skipping its own UI enterily and going directly to
 * Bob Pay.
 */
Launches the PaymentRequest UI with Bob Pay as the only payment method.
When the developer chooses a single payment method and requests no other
data (no shipping, no email, no phone, ...), Payment Request will apply
the UI skip optimization, skipping its own UI enterily and going directly to
Bob Pay.
Launches the PaymentRequest UI with Bob Pay as the only payment method . When the developer chooses a single payment method and requests no other data ( no shipping no email no phone ... ) Payment Request will apply the UI skip optimization skipping its own UI enterily and going directly to Bob Pay .
function buy() {  
  try {
    new PaymentRequest(
        [{supportedMethods: 'https://bobpay.com'}],
        {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}})
        .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 buy ( ) { try { new PaymentRequest ( [ { supportedMethods : 'https://bobpay.com' } ] , { total : { label : 'Total' , amount : { currency : 'USD' , value : '5.00' } } } ) . 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.
Launches the PaymentRequest UI with Bob Pay as the only payment method .
// eslint-disable-line no-unused-vars