示例#1
0
        // return a borrower that has registered and accepted the primary offer
        public static LoanApplicationAgentStateObject GetPrimaryOffer(RegisterBorrower.Request borrower, Guid applicationGuid, string borrowerGuid = null)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var offerJson = new GetOffers.GenerateRequest();

            offerJson.LoanAmount = borrower.RequestedLoanAmount;

            var result = loanApplicationOffersClient.GenerateOffers(offerJson, applicationGuid.ToString());

            result = loanApplicationOffersClient.GetOffer(applicationGuid.ToString());

            var offerGuid    = result.content.LoanOfferGroup.LoanApplicationOffers[0].Guid.ToString();
            var offersClient = new OffersClient();
            var noResult     = offersClient.SelectOffer(offerGuid);
            var stateObject  = new LoanApplicationAgentStateObject();

            stateObject.Borrower = borrower;

            if (borrowerGuid != null)
            {
                stateObject.BorrowerGuid = new Guid(borrowerGuid);
            }

            stateObject.OfferGuid           = new Guid(offerGuid);
            stateObject.LoanApplicationGuid = applicationGuid;
            return(stateObject);
        }
示例#2
0
        public static Guid?GetPrimaryOffer(Guid loanApplicationGuid)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var result = loanApplicationOffersClient.GetOffer(loanApplicationGuid.ToString());

            return(result.content.LoanOfferGroup.LoanApplicationOffers[0].Guid);
        }
        public static Guid?GetAlternativeOffer(Guid loanApplicationGuid, int offerIndex)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var result = loanApplicationOffersClient.GetOffer(loanApplicationGuid.ToString());

            return(result.content.LoanOfferGroup.LoanApplicationOffers[offerIndex + 1].Guid);
        }
示例#4
0
        public static Guid?GetAlternativeOffer(Guid loanApplicationGuid, int offerIndex)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var result = loanApplicationOffersClient.GetOffer(loanApplicationGuid.ToString());
            var offers = result.content.LoanOfferGroup.LoanApplicationOffers;

            return(offers.GetRange(1, offers.Count)[offerIndex].Guid);
        }