/// <summary> /// /// </summary> /// <param name="reader"></param> /// <returns></returns> internal static AccountCredentials GetAccountCredentials(IPagSeguroConfiguration config, bool sandbox) { AccountCredentials credential = null; string email; string token; if (sandbox) { email = config.SandboxEmail; token = config.SandboxToken; } else { email = config.Email; token = config.Token; } try { credential = new AccountCredentials(email, token); } catch (System.Exception) { throw new ArgumentException("To use credentials from config.properties file you must " + "configure the properties credential email and credential token."); } return credential; }
/// <summary> /// /// </summary> /// <param name="reader"></param> /// <returns></returns> internal static AccountCredentials GetAccountCredentials(IPagSeguroConfiguration config, bool sandbox) { AccountCredentials credential = null; string email; string token; if (sandbox) { email = config.SandboxEmail; token = config.SandboxToken; } else { email = config.Email; token = config.Token; } try { credential = new AccountCredentials(email, token); } catch (System.Exception) { throw new ArgumentException("To use credentials from config.properties file you must " + "configure the properties credential email and credential token."); } return(credential); }
/// <summary> /// Allow's the user to change configuration /// </summary> /// <param name="newLocation"></param> public static void SetConfiguration(IPagSeguroConfiguration config) { currentConfig = config; }