/**
 * @description Get payment type based on IP mapping
 * @param ipMapping
 * @param cardType
 * @returns {*}
 */
const getPaymentType = (ipMapping, cardType) => {
  const normalizedCardType = (cardType || "").toLowerCase();
  return ipMapping ? ipMapping[normalizedCardType] || cardType : cardType;
};

module.exports = getPaymentType;
