package org.jpos.tcpay.connection;

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

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

public class AcquirerChannelFactory {

    private static Map<String, AcquirerChannel> mappers = new ConcurrentHashMap<>();

    public static  AcquirerChannel getAcquirerChannel(String acqName) {
        if (mappers.containsKey(acqName)) {
            return mappers.get(acqName);
        }

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