예제 #1
0
        public TopUpResponse TopUp(TopUpRequest topUpRequest)
        {
            Log(Logger.LogMessageType.Info, "->   -------------------- Comienza la ejecución del método Stock.TopUp", Logger.LoggingLevelType.Medium);
            TopUpRequestInternal internalObject = new TopUpRequestInternal()
            {
                Amount       = topUpRequest.Request.Amount,
                DeviceType   = topUpRequest.Request.DeviceType,
                HostTransRef = topUpRequest.Request.HostTransRef,
                MNO          = topUpRequest.Request.MNO,
                MNODefinedID = topUpRequest.Request.MNODefinedID,
                Recipient    = topUpRequest.Request.Recipient,
                SessionID    = topUpRequest.Request.SessionID
            };
            TopUpResponseInternal internalResponse = TopUpProvider.TopUpInternal(internalObject);
            TopUpResponse         response         = new TopUpResponse();
            TopUpResponseBody     responseBody     = new TopUpResponseBody()
            {
                ResponseCode    = internalResponse.ResponseCode,
                ResponseMessage = internalResponse.ResponseMessage,
                TransactionID   = internalResponse.TransactionID,
                HostTransRef    = internalResponse.HostTransRef,
                Fee             = internalResponse.Fee,
                BalanceStock    = internalResponse.BalanceStock
            };

            response.Response = responseBody;
            Log(Logger.LogMessageType.Info, "->   -------------------- Termina la ejecución del método Stock.TopUp", Logger.LoggingLevelType.Medium);
            return(response);
        }
예제 #2
0
        public NewSaleWithExternalIDExtendedResponse NewSaleWithExternalIDExtended(NewSaleWithExternalIDExtendedRequest externalRequest)
        {
            Log(Logger.LogMessageType.Info, "->   -------------------- Comienza la ejecución del método Sales.NewSaleWithExternalID", Logger.LoggingLevelType.Medium);
            LoginRequestInternal loginRequest = new LoginRequestInternal()
            {
                DeviceType = externalRequest.Request.AccessType,
                Password   = externalRequest.Request.Password,
                User       = externalRequest.Request.AccessId
            };
            LoginResponseInternal loginResponse   = AuthenticationProvider.LoginInternal(loginRequest);
            TopUpRequestInternal  internalRequest = new TopUpRequestInternal()
            {
                SessionID    = loginResponse.SessionID,
                Recipient    = externalRequest.Request.Customer,
                MNODefinedID = externalRequest.Request.ExternalId,
                MNO          = externalRequest.Request.IdProduct,
                HostTransRef = externalRequest.Request.ExternalId,
                DeviceType   = _deciveTypeForNewSaleWithExternalID,
                Amount       = externalRequest.Request.Amount
            };
            TopUpResponseInternal internalResponse = TopUpProvider.TopUpInternal(internalRequest);
            NewSaleWithExternalIDExtendedResponse externalResponse = new NewSaleWithExternalIDExtendedResponse()
            {
                Response = new NewSaleWithExternalIDExtendedResponseBody()
                {
                    Result        = internalResponse.ResponseCode.ToString() == "0" ? "true" : "false",
                    Message       = internalResponse.ResponseCode.ToString() == "0" ? "Recarga Exitosa" : "Recarga Fallida",
                    IdTransaction = internalResponse.TransactionID,
                    SaleData      = internalResponse.ResponseMessage
                }
            };

            Log(Logger.LogMessageType.Info, "->   -------------------- Termina la ejecución del método Sales.NewSaleWithExternalID", Logger.LoggingLevelType.Medium);
            return(externalResponse);
        }
예제 #3
0
        public TopUpExtendedResponse TopUpExtended(TopUpExtendedRequest externalRequest)
        {
            Log(Logger.LogMessageType.Info, "->   -------------------- Comienza la ejecución del método Stock.TopUp", Logger.LoggingLevelType.Medium);
            LoginRequestInternal loginRequest = new LoginRequestInternal()
            {
                DeviceType = externalRequest.Request.DeviceType,
                Password   = externalRequest.Request.Password,
                User       = externalRequest.Request.Username
            };
            LoginResponseInternal loginResponse  = AuthenticationProvider.LoginInternal(loginRequest);
            TopUpRequestInternal  internalObject = new TopUpRequestInternal()
            {
                Amount       = externalRequest.Request.Amount,
                DeviceType   = externalRequest.Request.DeviceType,
                HostTransRef = externalRequest.Request.HostTransRef,
                MNO          = externalRequest.Request.MNO,
                MNODefinedID = externalRequest.Request.MNODefinedID,
                Recipient    = externalRequest.Request.Recipient,
                SessionID    = loginResponse.SessionID
            };
            TopUpResponseInternal internalResponse = TopUpProvider.TopUpInternal(internalObject);
            TopUpExtendedResponse response         = new TopUpExtendedResponse()
            {
                Response = new TopUpExtendedResponseBody()
                {
                    ResponseCode    = internalResponse.ResponseCode,
                    ResponseMessage = internalResponse.ResponseMessage,
                    TransactionID   = internalResponse.TransactionID,
                    HostTransRef    = internalResponse.HostTransRef,
                    Fee             = internalResponse.Fee,
                    BalanceStock    = internalResponse.BalanceStock
                }
            };

            Log(Logger.LogMessageType.Info, "->   -------------------- Termina la ejecución del método Stock.TopUp", Logger.LoggingLevelType.Medium);
            return(response);
        }