Exemplo n.º 1
0
        public void Send_ThirdParty_Org_HomeDelivery_Vietnam()
        {
            var sendRequest = new SendRequest
            {
                AgentState     = AgentLocation.MN,
                Country        = Country.Vietnam,
                State          = string.Empty,
                SendCurr       = Currency.Usd,
                AmtRange       = AmountRange.ThirdParty,
                FeeType        = ItemChoiceType1.amountExcludingFee,
                ServiceOption  = ServiceOptionType.HomeDelivery,
                ThirdPartyType = TestThirdPartyType.Org
            };

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

            sendData = _sendOperations.SendCompleteForThirdParty(sendData);
            // ASSERT ALL THE THINGS
            var errorMsg = string.Join(Environment.NewLine, sendData.Errors.Select(x => $"{x.ErrorCode}: {x.OffendingField} - {x.Message}"));

            Assert.IsFalse(sendData.Errors.Any(), $"{Environment.NewLine}Errors:{Environment.NewLine}{errorMsg}");
            //todo: display all errors.
            Assert.IsFalse((sendData.CompleteSessionResp.Errors.Count > 0), $"{sendData.CompleteSessionResp.Errors.Count} errors");
        }
Exemplo n.º 2
0
        public void Send_ValidateShouldReturnFieldsToCollectWithSecondId()
        {
            var sendRequest = new SendRequest
            {
                AgentState     = AgentLocation.MN,
                Country        = Country.Usa,
                State          = State.Ny,
                SendCurr       = Currency.Usd,
                AmtRange       = AmountRange.TwoIds,
                FeeType        = ItemChoiceType1.amountExcludingFee,
                ServiceOption  = ServiceOptionType.WillCall,
                ThirdPartyType = TestThirdPartyType.None
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SingleValidateForExistingSender(sendData);
            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");

            var validationResponse       = sendData.SendValidationResps.FirstOrDefault();
            var containsSecondIdCategory = ContainsCategory(validationResponse?.Payload.FieldsToCollect,
                                                            InfoKeyCategories.mtSenderIdentificationSecondarySet);

            Assert.IsTrue(containsSecondIdCategory, "Ensure that profile editor limits for send are configured properly in the current environment");
        }
Exemplo n.º 3
0
        public void Recv_ValidationUntilReadyForCommit()
        {
            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);

            SendOperations.SendCompleteForNewCustomer(sendData);
            receiveData.Set(sendData);
            ReceiveOperations.ValidateUntilReadyForCommitForReceive(receiveData);

            var receiveValidationResponse = receiveData.ReceiveValidationResponses?.FirstOrDefault();

            // ASSERT ALL THE THINGS
            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(receiveValidationResponse != null && receiveValidationResponse.Payload.ReadyForCommit);
        }
Exemplo n.º 4
0
        public void Send_ReceiveAt_Complete_WithThirdPartyNONE_Test()
        {
            var sendRequest = new SendRequest
            {
                AgentState     = AgentLocation.MN,
                Country        = Country.Mexico,
                State          = string.Empty,
                SendCurr       = Currency.Usd,
                AmtRange       = AmountRange.ThirdParty,
                FeeType        = ItemChoiceType1.amountExcludingFee,
                ServiceOption  = ServiceOptionType.ReceiveAt,
                ThirdPartyType = null
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SendCompleteForThirdParty(sendData);

            // ASSERT ALL THE THINGS
            Assert.IsFalse(sendData.Errors.Any(), $"Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(sendData.CompleteSessionResp != null);
            Assert.IsTrue(!string.IsNullOrEmpty(sendData.CompleteSessionResp.Payload.ReferenceNumber));
        }
Exemplo n.º 5
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);
        }
        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));
        }
        public void ReceiveReversal_ShouldSucceedForReceivingAgent()
        {
            //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()}");

            //Get the transaction reference number

            //ReceiveReversal with single validate
            var request = new ReceiveReversalOperationRequest
            {
                AgentState      = AgentLocation.NY,
                ReferenceNumber = receiveData.SendData.CompleteSessionResp.Payload.ReferenceNumber
            };

            request.PopulateAgentData(request.AgentState);

            var receiveReversalData    = receiveReversalOperations.SingleValidate(request);
            var lastValidationResponse = receiveReversalData.ValidationResponses.LastOrDefault();

            // ASSERT ALL THE THINGS
            Assert.IsFalse(receiveReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveReversalData.Errors?.Log()}");
            Assert.IsTrue(lastValidationResponse.Payload.ReadyForCommit || lastValidationResponse.Payload.FieldsToCollect.Any());
        }
        public void ReceiveReversalTransaction_Complete()
        {
            var sendRequest = new SendRequest
            {
                AgentState    = AgentLocation.MN,
                Country       = Country.Usa,
                State         = State.Ny,
                SendCurr      = Currency.Usd,
                AmtRange      = AmountRange.UnderOneHundred,
                FeeType       = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.WillCall
            };

            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.SendCompleteForExistingCustomer(sendData);
            receiveData.Set(sendData);
            _recvOperations.ReceiveComplete(receiveData);

            //Get the transaction reference number

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

            request.PopulateAgentData(request.AgentState);

            var receiveReversalData = receiveReversalOperations.ReceiveReversalComplete(request);

            Assert.IsFalse(receiveReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveReversalData.Errors?.Log()}");
            //Commented out as CompleteSessionResponse does not contain reference number when performing Receive Reversal. The above check for errors is enough.
            //Assert.IsFalse(string.IsNullOrEmpty(receiveReversalData.CompleteSessionResp.Payload.ReferenceNumber), "there was no reference number on the receive reversal completion response");
        }
        public void ReceiveReversalTransaction_ShouldFailForNonReceivingAgent()
        {
            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);
            var receiveRequest = new ReceiveRequest
            {
                AgentState     = AgentLocation.NY,
                ThirdPartyType = TestThirdPartyType.None
            };

            receiveRequest.PopulateAgentData(receiveRequest.AgentState);

            var receiveData = new ReceiveData(receiveRequest);

            sendData = _sendOperations.SendCompleteForExistingCustomer(sendData);
            receiveData.Set(sendData);
            _recvOperations.ReceiveComplete(receiveData);

            var request = new ReceiveReversalOperationRequest
            {
                AgentState      = AgentLocation.MN,
                ReferenceNumber = receiveData.SendData.CompleteSessionResp.Payload.ReferenceNumber
            };

            request.PopulateAgentData(request.AgentState);

            var receiveReversalData = receiveReversalOperations.SingleValidate(request);

            Assert.IsFalse(receiveReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveReversalData.Errors?.Log()}");

            var lastValidationResponse = receiveReversalData.ValidationResponses.LastOrDefault();

            Assert.IsTrue(lastValidationResponse.Errors.Any());
        }
Exemplo n.º 10
0
        public void Amend_ShouldSucceedForSendingAgent()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountIncludingFee
            };

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

            sendData = sendOperations.SendCompleteForExistingCustomer(sendData);
            var sendCompleteSessionResponse = sendData.CompleteSessionResp;

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(sendCompleteSessionResponse.Errors.Any(), "Send Failed.");

            //Get the transaction reference number
            string referenceNumber = sendCompleteSessionResponse.Payload?.ReferenceNumber;
            //Amend with single validate
            var request = new AmendOperationRequest
            {
                AgentState      = AgentLocation.MN,
                ReferenceNumber = referenceNumber
            };

            request.PopulateAgentData(request.AgentState);

            var amendData = new AmendData(request);

            amendData.Set(sendData);
            amendOperations.SingleValidate(amendData);
            Assert.IsFalse(amendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{amendData.Errors?.Log()}");
            amendOperations.AmendComplete(amendData);
            var lastAmendValidationResponse = amendData.ValidationResponses.LastOrDefault();

            // ASSERT ALL THE THINGS
            Assert.IsFalse(amendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{amendData.Errors?.Log()}");
            Assert.IsTrue(lastAmendValidationResponse.Payload.FieldsToCollect.Any());
        }
Exemplo n.º 11
0
        public void FeeLookup_SendUsLargeAmt_Test()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.NY,
                Country    = Country.Usa,
                State      = State.Mn,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.TwoIds,
                FeeType    = ItemChoiceType1.amountExcludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData      = new SendData(sendRequest);
            var feeLookupData = _feeLookupOperations.FeeLookupForSend(sendData);

            Assert.IsTrue(feeLookupData.FeeLookupResp.Payload.FeeInfos.Any(), $"Errors: {Environment.NewLine}{feeLookupData.FeeLookupResp.Errors?.Log()}");
        }
Exemplo n.º 12
0
        public void SendReversal_TransactionLookup()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountIncludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = sendOperations.SendCompleteForExistingCustomer(sendData);
            var sendCompleteSessionResponse = sendData.CompleteSessionResp;

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(sendCompleteSessionResponse.Errors.Any(), "Send Failed.");

            //Get the transaction reference number
            var referenceNumber = sendCompleteSessionResponse.Payload.ReferenceNumber;
            //Transaction lookup
            var sendReversalRequest = new SendReversalRequest
            {
                AgentState      = AgentLocation.MN,
                ReferenceNumber = referenceNumber
            };

            sendReversalRequest.PopulateAgentData(sendReversalRequest.AgentState);

            var sendReversalData = new SendReversalData(sendReversalRequest);

            sendReversalData = sendReversalOperations.TransactionLookup(sendReversalData);
            var tranLookupResponse = sendReversalData.TransactionLookup.TransactionLookupResp;

            //ASSERT the resposne.
            Assert.IsFalse(tranLookupResponse.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{tranLookupResponse.Errors?.Log()}");
            Assert.IsTrue(tranLookupResponse.Payload.TransactionStatus == TransactionStatusType.AVAIL);
            Assert.IsFalse(string.IsNullOrEmpty(tranLookupResponse.Payload.MgiSessionID));
        }
Exemplo n.º 13
0
        public void SendReversalTransaction_Complete()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountIncludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = sendOperations.SendCompleteForExistingCustomer(sendData);
            var sendCompleteSessionResponse = sendData.CompleteSessionResp;

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(sendCompleteSessionResponse.Errors.Any(), "Send Failed.");

            string referenceNumber     = sendCompleteSessionResponse.Payload.ReferenceNumber;
            var    sendReversalRequest = new SendReversalRequest
            {
                AgentState      = AgentLocation.MN,
                ReferenceNumber = referenceNumber,
                RefundReason    = new EnumeratedIdentifierInfo {
                    Identifier = "NO_RCV_LOC"
                },
                RefundFee = true
            };

            sendReversalRequest.PopulateAgentData(sendReversalRequest.AgentState);

            var sendReversalData = new SendReversalData(sendReversalRequest);

            sendReversalData = sendReversalOperations.SendReversalComplete(sendReversalData);
            Assert.IsFalse(sendReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendReversalData.Errors?.Log()}");
            Assert.IsFalse(string.IsNullOrEmpty(sendReversalData.CompleteSessionResp.Payload.ReferenceNumber));
        }
Exemplo n.º 14
0
        public void SendReversalTransaction_ShouldFailForNonSendingAgent()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountIncludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = sendOperations.SendCompleteForExistingCustomer(sendData);
            var sendCompleteSessionResponse = sendData.CompleteSessionResp;

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(sendCompleteSessionResponse.Errors.Any(), "Send Failed.");

            string referenceNumber = sendCompleteSessionResponse.Payload.ReferenceNumber;

            var sendReversalRequest = new SendReversalRequest
            {
                AgentState      = AgentLocation.NY,
                ReferenceNumber = referenceNumber
            };

            sendReversalRequest.PopulateAgentData(sendReversalRequest.AgentState);

            var sendReversalData = new SendReversalData(sendReversalRequest);

            sendReversalData = sendReversalOperations.SingleValidate(sendReversalData);
            Assert.IsFalse(sendReversalData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendReversalData.Errors?.Log()}");

            var lastValidationResponse = sendReversalData.ValidationResponses.LastOrDefault();

            Assert.IsTrue(lastValidationResponse.Errors.Any());
        }
Exemplo n.º 15
0
        public void StagingSend_SmallAmountNewCustomer()
        {
            var sendRequest = new SendRequest
            {
                AgentState    = AgentLocation.NY,
                Country       = Country.Usa,
                State         = State.Mn,
                SendCurr      = Currency.Usd,
                AmtRange      = AmountRange.NoIdsNoThirdParty,
                FeeType       = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.WillCall
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SendCompleteStagedForNewCustomer(sendData);

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
        }
Exemplo n.º 16
0
        public void StagingSend_HighAmount_ThirdParty_Person()
        {
            var sendRequest = new SendRequest
            {
                AgentState     = AgentLocation.MN,
                Country        = Country.Usa,
                State          = State.Ny,
                SendCurr       = Currency.Usd,
                AmtRange       = AmountRange.ThirdParty,
                FeeType        = ItemChoiceType1.amountExcludingFee,
                ServiceOption  = ServiceOptionType.WillCall,
                ThirdPartyType = TestThirdPartyType.Person
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SendCompleteStagedForExistingCustomerThirdParty(sendData);

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
        }
Exemplo n.º 17
0
        public void AmendTransaction_Complete()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.MN,
                Country    = Country.Usa,
                State      = State.Ny,
                SendCurr   = Currency.Usd,
                AmtRange   = AmountRange.NoIdsNoThirdParty,
                FeeType    = ItemChoiceType1.amountIncludingFee
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = sendOperations.SendCompleteForExistingCustomer(sendData);
            var sendCompleteSessionResponse = sendData.CompleteSessionResp;

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsFalse(sendCompleteSessionResponse.Errors.Any(), "Send Failed.");

            string referenceNumber = sendCompleteSessionResponse.Payload?.ReferenceNumber;

            var request = new AmendOperationRequest
            {
                AgentState      = AgentLocation.MN,
                ReferenceNumber = referenceNumber
            };

            request.PopulateAgentData(request.AgentState);

            var amendData = new AmendData(request);

            amendData.Set(sendData);
            amendOperations.AmendComplete(amendData);
            Assert.IsFalse(amendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{amendData.Errors?.Log()}");
            Assert.IsFalse(string.IsNullOrEmpty(amendData.CompleteSessionResp.Payload.ReferenceNumber));
        }
Exemplo n.º 18
0
        public void Send_Complete_LowAmount_NewCustomer()
        {
            var sendRequest = new SendRequest
            {
                AgentState    = AgentLocation.MN,
                Country       = Country.Usa,
                State         = State.Ny,
                SendCurr      = Currency.Usd,
                AmtRange      = AmountRange.UnderOneHundred,
                FeeType       = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.WillCall
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = _sendOperations.SendCompleteForNewCustomer(sendData);

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(sendData.CompleteSessionResp.Payload != null && !string.IsNullOrWhiteSpace(sendData.CompleteSessionResp.Payload.ReferenceNumber));
        }
Exemplo n.º 19
0
        public void Recv_StageReceive_SmallAmount_NewCustomer()
        {
            var sendRequest = new SendRequest
            {
                AgentState     = AgentLocation.MN,
                Country        = Country.Usa,
                State          = State.Ny,
                SendCurr       = Currency.Usd,
                AmtRange       = AmountRange.UnderOneHundred,
                FeeType        = ItemChoiceType1.amountExcludingFee,
                ThirdPartyType = TestThirdPartyType.None
            };

            sendRequest.PopulateAgentData(sendRequest.AgentState);

            var sendData = new SendData(sendRequest);

            sendData = SendOperations.SendCompleteForNewCustomer(sendData);
            var receiveRequest = new ReceiveRequest()
            {
                AgentState     = AgentLocation.NY,
                ThirdPartyType = TestThirdPartyType.None
            };

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

            receiveData.Set(sendData);

            receiveData = ReceiveOperations.ReceiveCompleteStaged(receiveData);
            receiveData = ReceiveOperations.TransactionLookupForReceiveCompletion(receiveData);

            // 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.IsFalse(receiveData.TransactionLookupResponse.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{receiveData.TransactionLookupResponse.Errors?.Log()}");
            Assert.IsTrue(receiveData.TransactionLookupResponse.Payload.TransactionStatus == TransactionStatusType.AVAIL);
        }
Exemplo n.º 20
0
        [Ignore] //test dependent on AC and currently failing
        public void TrainingMode_Send_CompleteRequest()
        {
            var sendRequest = new SendRequest
            {
                AgentState = AgentLocation.NY,
                Country = Country.Usa,
                State = State.Ny,
                SendCurr = Currency.Usd,
                AmtRange = AmountRange.NoIdsNoThirdParty,
                FeeType = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.WillCall
            };
            sendRequest.PopulateAgentData(sendRequest.AgentState, true);

            var sendData = new SendData(sendRequest);
            sendData = _sendOperations.SendCompleteForExistingCustomer(sendData);

            Assert.IsFalse(sendData.Errors.Any(),
                $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(sendData.CompleteSessionResp.Payload != null &&
                          !string.IsNullOrWhiteSpace(sendData.CompleteSessionResp.Payload.ReferenceNumber));
            Assert.AreEqual(sendData.CompleteSessionResp.Payload.ReferenceNumber, "12345678");
        }
Exemplo n.º 21
0
        public void Send_ValidationUntilReadyForCommit()
        {
            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.ValidateUntilReadyForCommit(sendData);
            var validationResponse = sendData.SendValidationResps.LastOrDefault();

            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(validationResponse.Payload.ReadyForCommit);
        }
Exemplo n.º 22
0
        public void Send_BankDeposit_Complete_WithTwoIds_Test()
        {
            var sendRequest = new SendRequest
            {
                AgentState    = AgentLocation.MN,
                Country       = Country.Poland,
                State         = State.Ny,
                SendCurr      = Currency.Usd,
                AmtRange      = AmountRange.TwoIds,
                FeeType       = ItemChoiceType1.amountExcludingFee,
                ServiceOption = ServiceOptionType.BankDeposit
            };

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

            sendData = _sendOperations.SendCompleteForExistingCustomer(sendData);

            // ASSERT ALL THE THINGS
            Assert.IsFalse(sendData.Errors.Any(), $"Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(sendData.CompleteSessionResp != null);
            Assert.IsTrue(!string.IsNullOrEmpty(sendData.CompleteSessionResp.Payload.ReferenceNumber));
        }
Exemplo n.º 23
0
        public void Send_ValidateShouldReturnFieldsToCollectWithNoIdsOrThirdParty()
        {
            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,
                ThirdPartyType = TestThirdPartyType.None
            };

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

            sendData = _sendOperations.SingleValidateForExistingSender(sendData);
            var validationResponse = sendData.SendValidationResps?.FirstOrDefault();

            // ASSERT ALL THE THINGS
            Assert.IsFalse(sendData.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{sendData.Errors?.Log()}");
            Assert.IsTrue(validationResponse.Payload.FieldsToCollect.Any());
        }