IEnumerator CheckCredentials() { if (CheckCPRLength()) { if (CheckPinLength()) { StartCoroutine(GetUserDataToolkit.GetAccountData(CPRNumber, (var) => userData = var)); yield return(new WaitForSeconds(1f)); if (CheckUserData()) { StartCoroutine(GetUserDataToolkit.GetBankAccountData(CPRNumber, (var) => userData = var)); StartCoroutine(FillTransactionData(1f)); StartCoroutine(FillPaymentAgreementsData(1f)); StartCoroutine(SaveToJSON(2f)); SceneManager.LoadScene("Main"); StartCoroutine(IterateOverAllTransactions(minWaitTime, maxWaitTime)); yield break; } } } yield return(new WaitForSeconds(1.0f)); ErrorImage.SetActive(false); }
IEnumerator DataFiller() { StartCoroutine(GetUserDataToolkit.GetAccountData(CPRNumber, (var) => userData = var)); yield return(new WaitForSeconds(1f)); //if (CheckUserData()) { StartCoroutine(GetUserDataToolkit.GetBankAccountData(CPRNumber, (var) => userData = var)); StartCoroutine(FillTransactionData(1f)); StartCoroutine(FillPaymentAgreementsData(1f)); StartCoroutine(SaveToJSON(2f)); //StartCoroutine(IterateOverAllTransactions(minWaitTime, maxWaitTime)); yield break; } }
IEnumerator CheckForNewData() { yield return(new WaitForSeconds(1.0f)); StartCoroutine(GetUserDataToolkit.GetAccountData(userData.BankAccounts[0]._embedded.owner.customerNumber, (var) => userData = var)); StartCoroutine(GetUserDataToolkit.GetBankAccountData(userData.BankAccounts[0]._embedded.owner.customerNumber, (var) => userData = var)); StartCoroutine(FillTransactionData(1f)); StartCoroutine(FillPaymentAgreementsData(1f)); yield return(new WaitForSeconds(2.0f)); if (!string.Equals(JsonUtility.ToJson(userData), JsonUtility.ToJson(tempData))) { PlayerPrefs.SetString("PlayerInfo", JsonUtility.ToJson(userData)); print("Updated PlayerPrefs"); } }