Beispiel #1
0
        internal void procesaDatos(trnRequestValues requestValues, string data)
        {
            string[] trnRequest = data.Split('|');
            int      contador   = 0;

            requestValues.clear();

            foreach (string campo in trnRequest)
            {
                if (contador != 0 && campo != string.Empty)
                {
                    string[] detalle = campo.Split('=');
                    if (requestValues.hasProperty(detalle[0].ToString()))
                    {
                        requestValues[detalle[0].ToString()] = detalle[1];
                    }
                }
                contador++;
            }
        }
Beispiel #2
0
        internal string ejecutaLlamada(trnRequestValues requestValues)
        {
            //_logger.Info("Karen -> ejecutaLlamada");

            Upay u = new Upay();
            availableOperatives operacion = new availableOperatives();

            bool exists = Enum.IsDefined(typeof(availableOperatives), requestValues.dcs_form);

            if (exists)
            {
                operacion = (availableOperatives)System.Enum.Parse(typeof(availableOperatives), requestValues.dcs_form);
            }
            else
            {
                operacion = availableOperatives.error;
            }

            string result = string.Empty;

            switch (operacion)
            {
            case availableOperatives.PRINT:
                #region reimpresion
                result = u.opspreimp(requestValues.trn_orig_id);
                break;

                #endregion
            case availableOperatives.INIKEY:
                #region inicializacion
                result = u.opcpiniciallave();
                break;

                #endregion
            case availableOperatives.T060S000:
                #region venta
                result = u.opcpventa(requestValues.trn_amount, requestValues.trn_qty_pay);
                break;

                #endregion
            case availableOperatives.T040S000:
                #region devolucion
                result = u.opcpdevolucion(requestValues.trn_orig_id, requestValues.trn_auth_code, requestValues.trn_amount);
                break;

                #endregion
            case availableOperatives.T120S001:
                #region ajuste
                result = u.opspajuste(requestValues.trn_orig_id, requestValues.trn_amount);
                break;

                #endregion
            case availableOperatives.T120S000:
                #region cancelación
                result = u.opspcancel(requestValues.trn_orig_id);
                break;

                #endregion
            case availableOperatives.SHOWCONF:
                #region showConflocal
                result = u.opspconf();
                break;

                #endregion
            case availableOperatives.UPDATECONF:
                #region updateConflocal
                result = u.opspupdateconf(requestValues.HOST, requestValues.PORT, requestValues.hostStunnel, requestValues.portStunnel, requestValues.TIMEOUT, requestValues.llave, requestValues.mer_id, requestValues.ter_id, requestValues.merUSD_id, requestValues.terUSD_id, requestValues.puertoCom);
                break;

                #endregion
            default:
                result = "|trn_internal_respcode=-2|trn_msg_host=Operativa No Existe|dcs_status=ERROR|";
                break;
            }
            result = "|Respuesta=" + result + "|dcs_form=" + operacion.ToString() + "|";
            return(result);
        }
Beispiel #3
0
 public TransactionSwitch(ILogger logger)
 {
     _logger       = logger;
     requestValues = new trnRequestValues(_logger);
     myFunctions   = new localFunctions(_logger);
 }