public virtual void OnRequestMessage(IYandexApiClient client, string method, IDictionary<string, object> messageParams, bool financeTokenRequired) { if (financeTokenRequired) { if (string.IsNullOrEmpty(Login)) throw new InvalidOperationException("Unable to call finance operation because authentication login not set in configuration."); if (string.IsNullOrEmpty(MasterToken)) throw new InvalidOperationException("Unable to call finance operation because authentication master token not set in configuration."); FinanceTokenGenerator tokenGenerator = new FinanceTokenGenerator(Login, method, MasterToken); messageParams["login"] = tokenGenerator.Login; messageParams["operation_num"] = tokenGenerator.OperationId; messageParams["finance_token"] = tokenGenerator.FinanceToken; } }
public virtual void OnRequestMessage(IYandexApiClient client, string method, IDictionary <string, object> messageParams, bool financeTokenRequired) { if (financeTokenRequired) { if (string.IsNullOrEmpty(Login)) { throw new InvalidOperationException("Unable to call finance operation because authentication login not set in configuration."); } if (string.IsNullOrEmpty(MasterToken)) { throw new InvalidOperationException("Unable to call finance operation because authentication master token not set in configuration."); } FinanceTokenGenerator tokenGenerator = new FinanceTokenGenerator(Login, method, MasterToken); messageParams["login"] = tokenGenerator.Login; messageParams["operation_num"] = tokenGenerator.OperationId; messageParams["finance_token"] = tokenGenerator.FinanceToken; } }