Example #1
0
        public static Accounts getAccountsWithOptions()
        {
            string mn = "getAccounts()";

            Console.WriteLine(fqcn + " :: " + mn);
            string        accountSummaryURL = LoginApp.localURLVer1 + "accounts/investmentPlan/investmentOptions/";
            List <string> headers           = new List <string>();
            string        usersessionid     = LoginApp.usession;
            string        cbrandsessionid   = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            string   jsonResponse = HTTP.doGet(accountSummaryURL, headers);//headers-authorization headers i.e-member external sesionid,cobrand external session id
            Type     acc          = typeof(Accounts);
            Accounts accounts     = (Accounts)GSONParser.handleJson(jsonResponse, acc);

            //string type = "";
            //for (int i = 0; i < accounts.account.Count; i++)
            //{
            //    type = accounts.account[i].AccountType;
            //    if (type == "IRA")
            //    {
            //         string holdingURL = LoginApp.localURLVer1 + "holdings/v1/";
            //         jsonResponse = HTTP.doGet(holdingURL, headers);//headers-authorization headers i.e-member external sesionid,cobrand external session id
            //        Type holding = typeof(Holdings);
            //        Holdings holdings = (Holdings)GSONParser.handleJson(jsonResponse, holding);
            //        Console.WriteLine(holdings.ToString());

            //    }
            //}
            return(accounts);
        }
Example #2
0
        public static ProviderAccount getProviderAccount(String providerAccountId)
        {
            String        getRefreshStatusURL = LoginApp.localURLVer1 + "providers/providerAccounts/" + providerAccountId.ToString();
            List <string> headers             = new List <string>();
            string        usersessionid       = LoginApp.usession;
            string        cbrandsessionid     = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            String jsonResponse = HTTP.doGet(getRefreshStatusURL, headers);
            // Console.WriteLine(jsonResponse);
            ProviderAccount providerAccount = (ProviderAccount)GSONParser.handleJson(jsonResponse, typeof(ProviderAccount));

            return(providerAccount);
        }
Example #3
0
        public static Providers getProviderLoginForm(String providerId)
        {
            //Console.WriteLine(fqcn + " :: " + mn);
            String        getSiteURL      = LoginApp.localURLVer1 + "providers/" + providerId;
            List <string> headers         = new List <string>();
            string        usersessionid   = LoginApp.usession;
            string        cbrandsessionid = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            String    jsonResponse = HTTP.doGet(getSiteURL, headers);
            Providers providers    = (Providers)GSONParser.handleJson(jsonResponse, typeof(Providers));

            Console.WriteLine(providers.toString());
            return(providers);
        }
Example #4
0
        public static RefreshStatus getRefreshStatus(String providerAccountId)
        {
            //String mn = "getRefreshStatus( " + providerAccountId.ToString() + " )";
            //Console.WriteLine(fqcn + " :: " + mn);
            String        getRefreshStatusURL = LoginApp.localURLVer1 + "refresh/" + providerAccountId.ToString();
            List <string> headers             = new List <string>();
            string        usersessionid       = LoginApp.usession;
            string        cbrandsessionid     = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            String jsonResponse = HTTP.doGet(getRefreshStatusURL, headers);
            // Console.WriteLine(jsonResponse);
            RefreshStatus refreshStatus = (RefreshStatus)GSONParser.handleJson(jsonResponse, typeof(RefreshStatus));

            Console.WriteLine(refreshStatus.toString());
            return(refreshStatus);
        }
Example #5
0
        public static Accounts getAccounts()
        {
            string mn = "getAccounts()";

            Console.WriteLine(fqcn + " :: " + mn);
            string        accountSummaryURL = LoginApp.localURLVer1 + "accounts/";
            List <string> headers           = new List <string>();
            string        usersessionid     = LoginApp.usession;
            string        cbrandsessionid   = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            string   jsonResponse = HTTP.doGet(accountSummaryURL, headers);//headers-authorization headers i.e-member external sesionid,cobrand external session id
            Type     acc          = typeof(Accounts);
            Accounts accounts     = (Accounts)GSONParser.handleJson(jsonResponse, acc);

            return(accounts);
        }
Example #6
0
        public static void searchProvider(String searchString)
        {
            String mn = "searchSite(searchString " + searchString + " )";

            Console.WriteLine(fqcn + " :: " + mn);
            String        searchProviderURL = LoginApp.localURLVer1 + "providers?name=" + searchString;
            List <string> headers           = new List <string>();
            string        usersessionid     = LoginApp.usession;
            string        cbrandsessionid   = LoginApp.cbsession;

            headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}");
            String    jsonResponse = HTTP.doGet(searchProviderURL, headers);
            Providers providers    = (Providers)GSONParser.handleJson(jsonResponse, typeof(Providers));

            Console.WriteLine("------------------------------------------------");
            Console.WriteLine(" Id  Provider Name        Login Url");
            Console.WriteLine("------------------------------------------------");
            for (int i = 0; i < providers.provider.Length; i++)//deserialized json response for showing tabular format .
            {
                Console.WriteLine(providers.provider[i].id + " " + ">>" + " " + providers.provider[i].name + "  " + ">>" + "  " + providers.provider[i].loginUrl);
            }
            Console.WriteLine("--------------------------------------------------");
            //Console.Write(providers.toString());
        }