public void ReceiveReversal_TransactionLookup()
        {
            //PERFORM send
            var sendRequest = new SendRequest
            {
                AgentState    = AgentLocation.MN,
                Country       = Country.Usa,
                State         = State.Ny,
                SendCurr      = Currency.Usd,
                AmtRange      = AmountRange.NoIdsNoThirdParty,
                FeeType       = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.WillCall
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);
            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SendCompleteForExistingCustomer(sendData);

            //ASSERT send
            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");

            //PERFORM receive
            var receiveRequest = new ReceiveRequest
            {
                AgentState     = AgentLocation.NY,
                ThirdPartyType = TestThirdPartyType.None
            };

            receiveRequest.PopulateAgentData(receiveRequest.AgentState);
            var receiveData = new ReceiveData(receiveRequest);

            receiveData.Set(sendData);
            _recvOperations.ReceiveComplete(receiveData);

            //ASSERT receive
            Assert.IsFalse(receiveData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveData.Errors?.Log()}");

            //PERFORM transaction lookup
            var request = new ReceiveReversalOperationRequest
            {
                AgentState      = AgentLocation.NY,
                ReferenceNumber = receiveData.SendData.CompleteSessionResp.Payload.ReferenceNumber
            };

            request.PopulateAgentData(request.AgentState);
            var receiveReversalData = new ReceiveReversalData(request);

            receiveReversalOperations.TransactionLookup(receiveReversalData);
            var transLookupResponse = receiveReversalData.TransactionLookup.TransactionLookupResp;

            //ASSERT transaction lookup
            Assert.IsTrue(transLookupResponse.Payload.TransactionStatus == TransactionStatusType.RECVD);
            Assert.IsFalse(receiveReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveReversalData.Errors?.Log()}");
            Assert.IsFalse(string.IsNullOrEmpty(transLookupResponse.Payload.MgiSessionID));
        }
Exemple #2
0
        public void Recv_Complete()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountExcludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);
            var sendData       = new SendData(sendRequest);
            var receiveRequest = new ReceiveRequest
            {
                AgentState     = AgentLocation.NY,
                ThirdPartyType = TestThirdPartyType.None
            };

            receiveRequest.PopulateAgentData(receiveRequest.AgentState);

            var receiveData = new ReceiveData(receiveRequest);

            sendData = SendOperations.SendCompleteForNewCustomer(sendData);
            receiveData.Set(sendData);
            receiveData = ReceiveOperations.ReceiveComplete(receiveData);
            var transLookupResponse = TranLookupOperations.TransactionLookupForStatus(receiveRequest.AgentId, receiveRequest.AgentPos, receiveData.CompleteSessionResponse.Payload.ReferenceNumber);

            // ASSERT ALL THE THINGS
            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(receiveData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(transLookupResponse.TransactionLookupResp.Payload.TransactionStatus == TransactionStatusType.RECVD);
        }