Example #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);
        }
Example #2
0
 public static void ChooseOffer(Guid offerGuid)
 {
     var offersClient = new OffersClient();
     var result       = offersClient.SelectOffer(offerGuid.ToString());
 }