async function renderGenericComponent() {
  if (Object.keys(componentsObj).length) {
    await unmountComponents();
  }
  let paymentMethod;
  let i;
  checkoutConfiguration.paymentMethodsResponse =
    paymentMethodsResponse.adyenPaymentMethods;
  const paymentMethods = paymentMethodsResponse.adyenPaymentMethods;
  if (paymentMethodsResponse.amount) {
    checkoutConfiguration.amount = paymentMethodsResponse.amount;
    checkoutConfiguration.paymentMethodsConfiguration.paypal.amount = paymentMethodsResponse.amount;
  }
  if (paymentMethodsResponse.countryCode) {
    checkoutConfiguration.countryCode = paymentMethodsResponse.countryCode;
  }
  checkout = new AdyenCheckout(checkoutConfiguration);
  document.querySelector('#paymentMethodsList').innerHTML = '';

  if (paymentMethods.storedPaymentMethods) {
    for (
      i = 0;
      i < checkout.paymentMethodsResponse.storedPaymentMethods.length;
      i++
    ) {
      paymentMethod = checkout.paymentMethodsResponse.storedPaymentMethods[i];
      if (paymentMethod.supportedShopperInteractions.includes('Ecommerce')) {
        renderPaymentMethod(
          paymentMethod,
          true,
          paymentMethodsResponse.ImagePath,
        );
      }
    }
  }

  paymentMethods.paymentMethods.forEach((pm) => {
    !isMethodTypeBlocked(pm.type) &&
      renderPaymentMethod(pm, false, paymentMethodsResponse.ImagePath);
  });

  const firstPaymentMethod = document.querySelector(
    'input[type=radio][name=brandCode]',
  );
  firstPaymentMethod.checked = true;
  displaySelectedMethod(firstPaymentMethod.value);
}
/**
 * Calls getPaymenMethods and then renders the retrieved payment methods (including card component)
 */
Calls getPaymenMethods and then renders the retrieved payment methods (including card component)
Calls getPaymenMethods and then renders the retrieved payment methods ( including card component )
async function renderGenericComponent() {
  if (Object.keys(componentsObj).length) {
    await unmountComponents();
  }
  let paymentMethod;
  let i;
  checkoutConfiguration.paymentMethodsResponse =
    paymentMethodsResponse.adyenPaymentMethods;
  const paymentMethods = paymentMethodsResponse.adyenPaymentMethods;
  if (paymentMethodsResponse.amount) {
    checkoutConfiguration.amount = paymentMethodsResponse.amount;
    checkoutConfiguration.paymentMethodsConfiguration.paypal.amount = paymentMethodsResponse.amount;
  }
  if (paymentMethodsResponse.countryCode) {
    checkoutConfiguration.countryCode = paymentMethodsResponse.countryCode;
  }
  checkout = new AdyenCheckout(checkoutConfiguration);
  document.querySelector('#paymentMethodsList').innerHTML = '';
  if (paymentMethods.storedPaymentMethods) {
    for (
      i = 0;
      i < checkout.paymentMethodsResponse.storedPaymentMethods.length;
      i++
    ) {
      paymentMethod = checkout.paymentMethodsResponse.storedPaymentMethods[i];
      if (paymentMethod.supportedShopperInteractions.includes('Ecommerce')) {
        renderPaymentMethod(
          paymentMethod,
          true,
          paymentMethodsResponse.ImagePath,
        );
      }
    }
  }
  paymentMethods.paymentMethods.forEach((pm) => {
    !isMethodTypeBlocked(pm.type) &&
      renderPaymentMethod(pm, false, paymentMethodsResponse.ImagePath);
  });
  const firstPaymentMethod = document.querySelector(
    'input[type=radio][name=brandCode]',
  );
  firstPaymentMethod.checked = true;
  displaySelectedMethod(firstPaymentMethod.value);
}
async function renderGenericComponent ( ) { if ( Object . keys ( componentsObj ) . length ) { await unmountComponents ( ) ; } let paymentMethod ; let i ; checkoutConfiguration . paymentMethodsResponse = paymentMethodsResponse . adyenPaymentMethods ; const paymentMethods = paymentMethodsResponse . adyenPaymentMethods ; if ( paymentMethodsResponse . amount ) { checkoutConfiguration . amount = paymentMethodsResponse . amount ; checkoutConfiguration . paymentMethodsConfiguration . paypal . amount = paymentMethodsResponse . amount ; } if ( paymentMethodsResponse . countryCode ) { checkoutConfiguration . countryCode = paymentMethodsResponse . countryCode ; } checkout = new AdyenCheckout ( checkoutConfiguration ) ; document . querySelector ( '#paymentMethodsList' ) . innerHTML = '' ; if ( paymentMethods . storedPaymentMethods ) { for ( i = 0 ; i < checkout . paymentMethodsResponse . storedPaymentMethods . length ; i ++ ) { paymentMethod = checkout . paymentMethodsResponse . storedPaymentMethods [ i ] ; if ( paymentMethod . supportedShopperInteractions . includes ( 'Ecommerce' ) ) { renderPaymentMethod ( paymentMethod , true , paymentMethodsResponse . ImagePath , ) ; } } } paymentMethods . paymentMethods . forEach ( ( pm ) => { ! isMethodTypeBlocked ( pm . type ) && renderPaymentMethod ( pm , false , paymentMethodsResponse . ImagePath ) ; } ) ; const firstPaymentMethod = document . querySelector ( 'input[type=radio][name=brandCode]' , ) ; firstPaymentMethod . checked = true ; displaySelectedMethod ( firstPaymentMethod . value ) ; }
Calls getPaymenMethods and then renders the retrieved payment methods (including card component)
Calls getPaymenMethods and then renders the retrieved payment methods ( including card component )