third_party/gpay/src/payments_request_delegate.js
/**
   * @param {!PaymentDataRequest} paymentDataRequest Provides necessary
   *     information to support a payment.
   * @private
   */
@param {!PaymentDataRequest} paymentDataRequest Provides necessary
information to support a payment.
@private
@param { !PaymentDataRequest } paymentDataRequest Provides necessary information to support a payment . @private
loadPaymentDataThroughPaymentRequest_(paymentDataRequest) {
    const currencyCode = (paymentDataRequest.transactionInfo &&
                          paymentDataRequest.transactionInfo.currencyCode) ||
        undefined;
    const totalPrice = (paymentDataRequest.transactionInfo &&
                        paymentDataRequest.transactionInfo.totalPrice) ||
        undefined;
    const paymentRequest = this.createPaymentRequest_(
        paymentDataRequest, this.environment_, currencyCode, totalPrice);
    this.callback_(
        (paymentRequest.show()
             .then(
                 (paymentResponse) => {
                   paymentResponse.complete('success');
                   return paymentResponse.details;
                 })
             .catch(function(err) {
               err['statusCode'] = Constants.ResponseStatus.CANCELED;
               throw err;
             })));
  }
loadPaymentDataThroughPaymentRequest_ ( paymentDataRequest ) { const currencyCode = ( paymentDataRequest . transactionInfo && paymentDataRequest . transactionInfo . currencyCode ) || undefined ; const totalPrice = ( paymentDataRequest . transactionInfo && paymentDataRequest . transactionInfo . totalPrice ) || undefined ; const paymentRequest = this . createPaymentRequest_ ( paymentDataRequest , this . environment_ , currencyCode , totalPrice ) ; this . callback_ ( ( paymentRequest . show ( ) . then ( ( paymentResponse ) => { paymentResponse . complete ( 'success' ) ; return paymentResponse . details ; } ) . catch ( function ( err ) { err [ 'statusCode' ] = Constants . ResponseStatus . CANCELED ; throw err ; } ) ) ) ; }
@param {!PaymentDataRequest} paymentDataRequest Provides necessary
     information to support a payment.
@param { !PaymentDataRequest } paymentDataRequest Provides necessary information to support a payment .
/** @type{!Promise<!PaymentData>} */ /**
                  * @param {!PaymentResponse} paymentResponse
                  * @return {!PaymentData}
                  */ // Should be called to dismiss any remaining UI