Beispiel #1
0
        public async Task <bool> TokenizeAndCreate(string country_code, string currency, string iban)
        {
            WithdrawManager wm         = new WithdrawManager();
            var             user_token = UserManager.Get.getCurrentSessionToken();

            if (string.IsNullOrEmpty(iban) || string.IsNullOrEmpty(country_code) || string.IsNullOrEmpty(currency))
            {
                return(false);
            }

            LoaderManager.Get.LoaderController.ShowLoader();
            string account_token = await wm.TokenizeAccountAsync();

            string bank_account_token = await wm.TokenizeBankAccount(country_code, currency, iban);

            Debug.LogWarning(account_token);
            if (!string.IsNullOrEmpty(bank_account_token) && !string.IsNullOrEmpty(account_token))
            {
                Debug.LogWarning("here");
                bool res = await wm.CreateConnectAccount(account_token, bank_account_token, currency, country_code, user_token);

                LoaderManager.Get.LoaderController.HideLoader();
                return(res);
            }
            LoaderManager.Get.LoaderController.HideLoader();
            return(false);
        }
        private async void tokenizeAndAttach()
        {
            if (!String.IsNullOrEmpty(InfoPersonnelWithdraw.currentIBAN))
            {
                LoaderManager.Get.LoaderController.ShowLoader(null);
                string accounttoken = await wm.TokenizeAccountAsync();

                if (!String.IsNullOrEmpty(accounttoken))
                {
                    if (await wm.attachTokenToAccountAsync(accounttoken, token))
                    {
                        string[] attrib = { "iban_uploaded" };
                        string[] value5 = { "true" };
                        UserManager.Get.UpdateUserByField(attrib, value5);
                    }
                }

                LoaderManager.Get.LoaderController.HideLoader();
            }
        }