Exemple #1
0
        private async void Start()
        {
            controller = new WithdrawController();
            string token = UserManager.Get.getCurrentSessionToken();

            User user = null;

            user = await UserManager.Get.getUser();

            var accountStatus = await withdrawManager.accountVerificationStatus(token);

            balance.text = user.money_credit.ToString("N2") + CurrencyManager.CURRENT_CURRENCY;

            WithdrawButton.onClick.AddListener(() =>
            {
                SeembaAnalyticsManager.Get.SendWithdrawalEvent("Click On Withdrawal", AmountToWithdraw);
                CheckAndWithdraw();
            });

            Amount.onValueChanged.AddListener(delegate
            {
                if (string.IsNullOrEmpty(Amount.text))
                {
                    WithdrawButton.interactable = false;
                    TextEuro.text = "";
                }
                else
                {
                    TextEuro.text    = CurrencyManager.CURRENT_CURRENCY;
                    AmountToWithdraw = float.Parse(Amount.text);
                    if ((float.Parse(Amount.text, CultureInfo.InvariantCulture) > 0) &&
                        (float.Parse(Amount.text, CultureInfo.InvariantCulture) <= (float.Parse(UserManager.Get.GetCurrentMoneyCredit()))))
                    {
                        WithdrawButton.interactable = true;
                    }
                    else
                    {
                        WithdrawButton.interactable = false;
                    }
                }
            });
        }
 // Start is called before the first frame update
 void OnEnable()
 {
     controller = new WithdrawController();
     init();
 }