Exemple #1
0
        internal static ChangePinResponseInternal ChangePinInternal(ChangePinRequestInternal internalRequest)
        {
            UMarketSCClient           utibaClient      = new UMarketSCClient();
            ChangePinResponseInternal internalResponse = null;

            using (OperationContextScope scope = new OperationContextScope(utibaClient.InnerChannel))
            {
                HttpRequestMessageProperty messageProperty = new HttpRequestMessageProperty();
                messageProperty.Headers.Add(HttpRequestHeader.UserAgent, UserAgent);
                OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, messageProperty);

                //throw new Exception("Exception fuerte");
                string      passwordHash   = GenerateHash(internalRequest.SessionID, internalRequest.Initiator, internalRequest.CurrentPin);
                pinResponse pinChangeUtiba = utibaClient.pin(new pin()
                {
                    pinRequest = new pinRequestType()
                    {
                        sessionid = internalRequest.SessionID, device_type = internalRequest.DeviceType, new_pin = internalRequest.NewPin, pin = passwordHash, initiator = internalRequest.Initiator
                    }
                });

                internalResponse = new ChangePinResponseInternal()
                {
                    ResponseCode    = pinChangeUtiba.pinReturn.result,
                    ResponseMessage = pinChangeUtiba.pinReturn.result_message,
                    TransactionID   = pinChangeUtiba.pinReturn.transid
                };
            }
            return(internalResponse);
        }
Exemple #2
0
        internal static ChangePinResponse ChangePin(ChangePinRequest externalRequest)
        {
            ChangePinRequestInternal internalRequest = new ChangePinRequestInternal()
            {
                Initiator  = externalRequest.Request.Initiator,
                DeviceType = externalRequest.Request.DeviceType,
                NewPin     = externalRequest.Request.NewPin,
                SessionID  = externalRequest.Request.SessionID,
                CurrentPin = externalRequest.Request.CurrentPin
            };
            ChangePinResponseInternal internalResponse     = ChangePinInternal(internalRequest);
            ChangePinResponse         externalResponse     = new ChangePinResponse();
            ChangePinResponseBody     externalResponseBody = new ChangePinResponseBody()
            {
                ResponseCode    = internalResponse.ResponseCode,
                ResponseMessage = internalResponse.ResponseMessage,
                TransactionID   = internalResponse.TransactionID
            };

            externalResponse.Response = externalResponseBody;
            return(externalResponse);
        }