Exemple #1
0
        public BankCreditResponse sendCreditRequest(BankCreditRequest request)
        {
            YBankCreditApprove yrequest = new YBankCreditApprove();

            yrequest.Credit = (float)request.getAmount();
            yrequest.Name   = request.getCustomer();

            YBankCreditSender sender = new YBankCreditSender();

            sender.sendCreditForValidate(yrequest, this);

            do
            {
                try {
                    Thread.Sleep(10000);
                    Console.WriteLine("yBank request on hold....");
                } catch (Exception e) {
                    Console.WriteLine(e.ToString());
                }
            } while (yresponse == null);

            BankCreditResponse response = new BankCreditResponse();

            response.setApproved(yresponse.Approved == "Y" ? true : false);
            return(response);
        }
Exemple #2
0
        public BankCreditResponse sendCreditRequest(BankCreditRequest request)
        {
            XBankCreditRequest xrequest = new XBankCreditRequest();

            xrequest.CustomerNam   = request.getCustomer();
            xrequest.RequestAmount = request.getAmount();

            XBankCreditAPI      api       = new XBankCreditAPI();
            XBankCreditResponse xresponse = api.SendCreditRequest(xrequest);

            BankCreditResponse response = new BankCreditResponse();

            response.setApproved(xresponse.Aproval);
            return(response);
        }