package org.jpos.tcpay.acquirer;

import org.jpos.tcpay.acquirer.fiserv.JposFiservTranslator;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class JposAcquirerTranslatorFactory {
    private static Map<String, JposAcquirerTranslator> mappers = new ConcurrentHashMap<>();

    public static  JposAcquirerTranslator getJposAcquirerTranslator(String acqName) {
        if (mappers.containsKey(acqName)) {
            return mappers.get(acqName);
        }

        switch (acqName) {
            case "Fiserv":
                JposAcquirerTranslator translator = new JposFiservTranslator();
                mappers.put(acqName, translator);
                return translator;
            default:
                return null;
        }
    }
}
