Beispiel #1
0
 public static void getRefreshStatus(RefreshStatus refreshStatus)
 {
     Console.WriteLine(refreshStatus.toString());
     //Keep Polling this api to get RefreshStatus :
     for (int i = 0; i < 10; i++)
     {
         getRefreshStatus(refreshStatus.getProviderAccountId());
     }
 }
Beispiel #2
0
        public static void addMFA_Account(Providers providers)
        {
            Console.WriteLine(" Add MFA_Account:  ");
            Console.WriteLine("Enter your provider userName : "******"DBmet1.site16442.1";

            // For internal Yodlee Dag tool use this hardcoded user Name = "DBmet1.site16441.1"
            providers.getProvider()[0].getLoginForm().getRow()[0].getField()[0].setValue(userName);

            Console.WriteLine("Enter provider password : "******"site16442.1";

            //String password = con.readLine("Enter provider password : "******"site16441.1"
            providers.getProvider()[0].getLoginForm().getRow()[1].getField()[0].setValue(password);
            RefreshStatus refreshStatus = AddProviderAccount.addProviderAccount(providers);
            string        refMsg;

            // RefreshStatus rstatus;
            do
            {
                refreshStatus = AddProviderAccount.getRefreshStatus(refreshStatus.providerAccountId);
                //RefreshStatus rstatus = (RefreshStatus)GSONParser.handleJson(jsonResponse, typeof(RefreshStatus));
                refMsg = refreshStatus.refreshInfo.refreshStatus;
                if (refMsg == "LOGIN_FAILURE" || refMsg == "REFRESH_TIMED_OUT" || refMsg == "REFRESH_CANCELLED" || refMsg == "SITE_CANNOT_BE_REFRESHED")
                {
                    Console.WriteLine("login failed please try again" + refMsg);
                    break;
                }
                if (refMsg == "REFRESH_COMPLETED_ACCOUNTS_ALREADY_AGGREGATED")
                {
                    Console.WriteLine("Account already added" + refMsg);
                    break;
                }
                // Console.WriteLine("login failed please try again" + refMsg);
                // }
            } while (refreshStatus.getLoginForm() == null);
            //while(refreshStatus.getLoginForm()==null)
            //{
            //refreshStatus = AddProviderAccount.getRefreshStatus(refreshStatus.providerAccountId);
            //}

            refreshStatus.getLoginForm().getRow()[0].getField()[0].setValue("123456");
            doChallenge(refreshStatus.getLoginForm(), refreshStatus.providerAccountId);
            refreshStatus = AddProviderAccount.getRefreshStatus(refreshStatus.getProviderAccountId());
            while (refreshStatus.getLoginForm() == null)
            {
                refreshStatus = AddProviderAccount.getRefreshStatus(refreshStatus.getProviderAccountId());
            }
            refreshStatus.getLoginForm().getRow()[0].getField()[0].setValue("Texas");
            refreshStatus.getLoginForm().getRow()[1].getField()[0].setValue("w3schools");
            doChallenge(refreshStatus.getLoginForm(), refreshStatus.getProviderAccountId());

            while (refMsg != "REFRESH_COMPLETED")
            {
                refreshStatus = AddProviderAccount.getRefreshStatus(refreshStatus.getProviderAccountId());
                refMsg        = refreshStatus.refreshInfo.refreshStatus;
            }
            Console.WriteLine("acount aded successfully");
            // Fetch the accounts if you need !
        }