Exemple #1
0
        public QueryTransactionResponse QueryTransaction(TransactionFilter filter)
        {
            if (!filter.IsValid)
            {
                return(SdkInternalErrorsResponse <QueryTransactionResponse>());
            }

            var response = new TransactionSearchResponse();

            if (filter.IsValidTransactionID)
            {
                response = _rapidService.QueryTransaction(filter.TransactionID);
            }
            else if (filter.IsValidAccessCode)
            {
                response = _rapidService.QueryTransaction(filter.AccessCode);
            }
            else if (filter.IsValidInvoiceRef)
            {
                response = _rapidService.QueryInvoiceRef(filter.InvoiceReference);
            }
            else if (filter.IsValidInvoiceNum)
            {
                response = _rapidService.QueryInvoiceNumber(filter.InvoiceNumber);
            }

            return(_mappingService.Map <TransactionSearchResponse, QueryTransactionResponse>(response));
        }
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   March 24, 2017
        *  Function:     GetAccountTransactionSearch
        *  Purpose:      GetAccountTransactionSearch
        *  Inputs:
        *  Returns:      TransactionSearchResponse
        *************************************/
        public async Task <TransactionSearchResponse> GetAccountTransactionSearch(Int64?accountNo, Int64?cardNo, string transacionCategory, int txtCd, string fromDate, string toDate, string statementDate)
        {
            Logger.Info("Invoking GetAccountTransactionSearch function");
            var response = new TransactionSearchResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var    transacionSearchDAO = scope.Resolve <ITransactionSearchDAO>();
                    string frDate  = (string)NumberExtensions.ConvertDatetimeDB(fromDate);
                    string tDate   = (string)NumberExtensions.ConvertDatetimeDB(toDate);
                    var    results = await transacionSearchDAO.GetAccountTxnSearch(accountNo, cardNo, transacionCategory, txtCd, frDate, tDate, statementDate);

                    if (results.Count() > 0)
                    {
                        response.transactionSearches = Mapper.Map <IList <TransactionSearchDTO>, IList <AcctPostedTxnSearch> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }catch (Exception ex)
            {
                string msg = string.Format("Error in GetAccountTransactionSearch: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   March 24, 2017
        *  Function:     GetMerchTransactionSearch
        *  Purpose:      GetMerchTransactionSearch
        *  Inputs:
        *  Returns:      TransactionSearchResponse
        *************************************/
        public async Task <TransactionSearchResponse> GetMerchTransactionSearch(string bussinessLocation, string merchAcctNo, string txnCd, string fromtxnDate, string toTxnDate, string txnCat)
        {
            Logger.Info("Invoking GetAccountTransactionSearch function");
            var response = new TransactionSearchResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var    transacionSearchDAO = scope.Resolve <ITransactionSearchDAO>();
                    string frTransactionDate   = (string)NumberExtensions.ConvertDatetimeDB(fromtxnDate);
                    string toTransactionDate   = (string)NumberExtensions.ConvertDatetimeDB(toTxnDate);
                    var    results             = await transacionSearchDAO.GetMerchTxnSearch(bussinessLocation, merchAcctNo, txnCd, frTransactionDate, toTransactionDate, txnCat);

                    if (results.Count() > 0)
                    {
                        response.merchPostedTxnSearches = Mapper.Map <IList <TransactionSearchDTO>, IList <MerchPostedTxnSearch> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }catch (Exception ex)
            {
                string msg = string.Format("Error in GetMerchTransactionSearch: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
        /*************************************
        *   Created by:   dandy boy
        *   Created on:   March 28, 2017
        *   Function:     GetObjectDetail
        *   Purpose:      GetObjectDetail
        *   Inputs:       prefix,value
        *   Returns:      TransactionSearchResponse
        *************************************/
        public async Task <TransactionSearchResponse> GetObjectDetail(string prefix, string value)
        {
            Logger.Info("Invoking GetObjectDetail function");
            var response = new TransactionSearchResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    ObjectDetailDTO detail = new ObjectDetailDTO();
                    var             transacionSearchDAO = scope.Resolve <ITransactionSearchDAO>();
                    var             result = await transacionSearchDAO.GetObjectDetail(prefix, value);

                    detail.Preifix = result.Flag;
                    if (result.Flag == "ACCT")
                    {
                        detail.AcctNo = result.AcctNo;
                    }
                    else if (result.Flag == "CARD")
                    {
                        detail.AcctNo = result.AcctNo;
                        detail.CardNo = result.CardNo;
                    }
                    else if (result.Flag == "MERCH")
                    {
                        detail.MerchAcctNo = Convert.ToString(result.AcctNo);
                    }
                    else if (result.Flag == "BUSN")
                    {
                        detail.MerchAcctNo  = Convert.ToString(result.AcctNo);
                        detail.BusnLocation = result.BusnLocation;
                    }
                    if (detail != null)
                    {
                        response.objectDetail = Mapper.Map <ObjectDetailDTO, ObjectDetail>(detail);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetObjectDetail: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Exemple #5
0
        public async Task <ActionResult <TransactionSearchResponse> > Search([FromQuery] TransactionSearchRequest request)
        {
            request.EnsureValidation();
            TransactionSearchArgs   transactionSearchArgs = new TransactionSearchArgs();
            IMediator               mediator = Factory.Resolve <IMediator>();
            TransactionSearchResult transactionSearchResult = await mediator.Send(new TransactionSearchCommand(transactionSearchArgs));

            transactionSearchResult.EnsureSuccess();
            TransactionSearchResponse response = new TransactionSearchResponse
            {
                Transactions = transactionSearchResult.Results
                               .Select(x => { return(new TransactionLiteView(x)); })
                               .ToArray()
            };

            return(Ok(response));
        }
Exemple #6
0
        public void Create_NoTransactionNoClaimSavedBefore_GetChargebackIdInMcomRefNo()
        {
            //arrange  9
            var mscTransactionData = new MscTransaction
            {
                F002    = "1234567890123456",
                F012_s1 = "180904"
            };
            var transactionSearchResponse = new TransactionSearchResponse
            {
                authorizationSummaryCount = "1",
                authorizationSummary      = new List <AuthorizationSummary>
                {
                    new AuthorizationSummary
                    {
                        clearingSummary = new List <ClearingSummary>
                        {
                            new ClearingSummary
                            {
                                transactionId = "123"
                            }
                        }
                    }
                }
            };

            transactionData.Setup(f => f.GetTransactionId(mscMcomPool.ProvisionRefKey)).Returns((MscMcomTransaction)null);
            transactionData.Setup(f => f.GetIssuerData(mscMcomPool)).Returns(mscTransactionData);
            transactionData.Setup(f => f.GetClaim(It.IsAny <String>())).Returns((MscMcomClaim)null);
            transactions.Setup(f => f.Search(It.IsAny <long>(), It.IsAny <TransactionSearchRequest>())).Returns(transactionSearchResponse);
            chargebacks.Setup(f => f.Create(It.IsAny <long>(), claimId, It.IsAny <ChargebackFillRequest>())).Returns(chargebackId);
            claims.Setup(f => f.CreateClaim(It.IsAny <long>(), It.IsAny <ClaimRequest>())).Returns(claimId);
            //act
            createChargeback.Create(mscMcomPool);
            //assert
            Assert.That(mscMcomPool.McomRefNo, Is.Not.Null);
            Assert.That(mscMcomPool.McomRefNo, Is.EqualTo(chargebackId));

            transactionData.Verify(f => f.GetTransactionId(It.IsAny <long>()));
            transactionData.Verify(f => f.GetIssuerData(mscMcomPool));
            transactionData.Verify(f => f.CreateTransactionId(It.IsAny <MscMcomTransaction>()));
        }