// Use this for initialization
        private async void OnEnable()
        {
            var IBANInputState = IBAN.GetComponent <InputfieldStateController>();

            token = UserManager.Get.getCurrentSessionToken();
            WithdrawButton.interactable = false;
            IBAN.onValueChanged.AddListener(delegate
            {
                IBANInputState.ShowLoading();
                validIban = wm.validateIBAN(IBAN.text);
                if (validIban)
                {
                    IBANInputState.ShowAccepted();
                }
                else
                {
                    IBANInputState.ShowDeclined();
                }
            });
            WithdrawButtonText.text = WithdrawPresenter.WithdrawMoney.ToString() + CurrencyManager.CURRENT_CURRENCY;
            string Id    = UserManager.Get.getCurrentUserId();
            string Token = UserManager.Get.getCurrentSessionToken();

            LoaderManager.Get.LoaderController.ShowLoader(null);

            User user = await UserManager.Get.getUser();

            var account = wm.accountVerificationJSON(Token);

            LoaderManager.Get.LoaderController.HideLoader();
            if (user != null)
            {
                personelInfoVerification(user);
                ibanVerification(user);
                WithdrawButton.onClick.AddListener(() =>
                {
                    Withdraw();
                });
                ContinueButtonIBAN.onClick.AddListener(() =>
                {
                    currentIBAN = IBAN.text;
                    tokenizeAndAttach();
                });
            }
            else
            {
                ConnectivityController.CURRENT_ACTION = ConnectivityController.PERSONNEL_INFO_WITHDRAW_ACTION;
                PopupManager.Get.PopupController.ShowPopup(PopupType.INFO_POPUP_CONNECTION_FAILED, PopupsText.Get.ConnectionFailed());
                LoaderManager.Get.LoaderController.HideLoader();
            }
        }
Ejemplo n.º 2
0
        async void OnEnable()
        {
            userToken = UserManager.Get.getCurrentSessionToken();
            LoaderManager.Get.LoaderController.ShowLoader(null);

            User user = await UserManager.Get.getUser();

            var account = await wm.accountVerificationJSON(userToken);

            LoaderManager.Get.LoaderController.HideLoader();

            if (string.IsNullOrEmpty(user.birthdate) || string.IsNullOrEmpty(user.address) || string.IsNullOrEmpty(user.firstname) || string.IsNullOrEmpty(user.lastname) || string.IsNullOrEmpty(user.zipcode) || string.IsNullOrEmpty(user.city) || string.IsNullOrEmpty(user.phone))
            {
                showMissingInfoPopup();
            }
            else
            {
                string documentFrontID = null;
                string documentBackID  = null;
                string documentAddress = null;
                var    accountStatus   = account["verification_status"].Value;
                Debug.Log(accountStatus);
                try
                {
                    documentFrontID = account["account"]["individual"]["verification"]["document"]["front"].Value;
                }
                catch (NullReferenceException) { }
                try
                {
                    documentBackID = account["account"]["individual"]["verification"]["document"]["back"].Value;
                }
                catch (NullReferenceException) { }
                try
                {
                    documentAddress = account["account"]["individual"]["verification"]["additional_document"]["front"].Value;
                }
                catch (NullReferenceException) { }

                if (accountStatus.Equals(WithdrawManager.ACCOUNT_VERIFICATION_STATUS_VERIFIED))
                {
                    IDAddressSuccess.SetActive(true);
                    if (!string.IsNullOrEmpty(documentBackID))
                    {
                        IDFrontSuccess.SetActive(true);
                        IDBackSuccess.SetActive(true);
                        IDPassport.interactable = false;
                        IDPassportDisabled.SetActive(true);
                    }
                    else
                    {
                        IDPassportSuccess.SetActive(true);
                        IDFront.interactable = false;
                        IDBack.interactable  = false;
                        IDFrontDisabled.SetActive(true);
                        IDBackDisabled.SetActive(true);
                    }
                }
                if (accountStatus.Equals(WithdrawManager.ACCOUNT_VERIFICATION_STATUS_PENDING))
                {
                    IDAddressSuccess.SetActive(true);
                    if (!string.IsNullOrEmpty(documentBackID))
                    {
                        IDFrontWaiting.SetActive(true);
                        IDBackWaiting.SetActive(true);

                        IDPassport.interactable = false;
                        IDPassportDisabled.SetActive(true);
                    }
                    else
                    {
                        IDPassportWaiting.SetActive(true);
                        IDFront.interactable = false;
                        IDBack.interactable  = false;

                        IDFrontDisabled.SetActive(true);
                        IDBackDisabled.SetActive(true);
                    }
                }
                if (!string.IsNullOrEmpty(documentBackID) && user.id_proof_2_uploaded)
                {
                    IDBackWaiting.SetActive(true);
                    IDPassport.interactable = false;

                    IDPassportDisabled.SetActive(true);
                }
                if (!string.IsNullOrEmpty(documentFrontID) && user.id_proof_1_uploaded)
                {
                    IDFrontWaiting.SetActive(true);
                    IDPassport.interactable = false;

                    IDPassportDisabled.SetActive(true);
                }
                if (!string.IsNullOrEmpty(documentBackID) && user.passport_uploaded)
                {
                    IDPassportWaiting.SetActive(true);
                    IDFront.interactable = false;
                    IDBack.interactable  = false;

                    IDFrontDisabled.SetActive(true);
                    IDBackDisabled.SetActive(true);
                }
            }
        }