third_party/subscriptions-project/swg.js
/**
 * @param {!IsReadyToPayRequest} isReadyToPayRequest
 *
 * @return {boolean} true if the merchant only supports tokenized cards.
 */
@param {!IsReadyToPayRequest} isReadyToPayRequest
@return {boolean} true if the merchant only supports tokenized cards.
@param { !IsReadyToPayRequest } isReadyToPayRequest @return { boolean } true if the merchant only supports tokenized cards .
function doesMerchantSupportOnlyTokenizedCards(isReadyToPayRequest) {
  if (isReadyToPayRequest.apiVersion >= 2) {
    const allowedAuthMethods =
        extractAllowedAuthMethodsForCards_(isReadyToPayRequest);
    if (allowedAuthMethods && allowedAuthMethods.length == 1 &&
        allowedAuthMethods[0] == Constants.AuthMethod.CRYPTOGRAM_3DS) {
      return true;
    }
  }
  return isReadyToPayRequest.allowedPaymentMethods.length == 1 &&
      isReadyToPayRequest.allowedPaymentMethods[0] ==
      Constants.PaymentMethod.TOKENIZED_CARD;
}
function doesMerchantSupportOnlyTokenizedCards ( isReadyToPayRequest ) { if ( isReadyToPayRequest . apiVersion >= 2 ) { const allowedAuthMethods = extractAllowedAuthMethodsForCards_ ( isReadyToPayRequest ) ; if ( allowedAuthMethods && allowedAuthMethods . length == 1 && allowedAuthMethods [ 0 ] == Constants . AuthMethod . CRYPTOGRAM_3DS ) { return true ; } } return isReadyToPayRequest . allowedPaymentMethods . length == 1 && isReadyToPayRequest . allowedPaymentMethods [ 0 ] == Constants . PaymentMethod . TOKENIZED_CARD ; }
@param {!IsReadyToPayRequest} isReadyToPayRequest
 @return {boolean} true if the merchant only supports tokenized cards.
@param { !IsReadyToPayRequest } isReadyToPayRequest @return { boolean } true if the merchant only supports tokenized cards .