async Task CheckBalance() { var service = CaptchaServiceFactory.GetService(settings.CaptchaSettings); try { var balance = await service.GetBalanceAsync(); await js.AlertSuccess(Loc["Success"], $"{Loc["Balance"]}: {balance}"); } catch (Exception ex) { await js.AlertException(ex); } }
public CaptchaSharpProvider(RuriLibSettingsService settings) { service = CaptchaServiceFactory.GetService(settings.RuriLibSettings.CaptchaSettings); CheckBalanceBeforeSolving = settings.RuriLibSettings.CaptchaSettings.CheckBalanceBeforeSolving; ServiceType = settings.RuriLibSettings.CaptchaSettings.CurrentService; }