Пример #1
0
        /// <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;
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 /// <summary>
 /// Allow's the user to change configuration
 /// </summary>
 /// <param name="newLocation"></param>
 public static void SetConfiguration(IPagSeguroConfiguration config)
 {
     currentConfig = config;
 }
Пример #4
0
 /// <summary>
 /// Allow's the user to change configuration
 /// </summary>
 /// <param name="newLocation"></param>
 public static void SetConfiguration(IPagSeguroConfiguration config)
 {
     currentConfig = config;
 }