Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public static AccountCredentials GetAccountCredentials(bool isSandbox, string email = null, string token = null)
        {
            var appConfig = GetAppConfig(isSandbox, email, token);

            if (appConfig == null)
            {
                return(PagSeguroConfigSerializer.GetAccountCredentials(XmlConfiguration, isSandbox));
            }

            email = appConfig.GetCredentialEmail(isSandbox);
            token = appConfig.GetCredentialToken(isSandbox);
            if (string.IsNullOrWhiteSpace(email) && string.IsNullOrWhiteSpace(token))
            {
                return(PagSeguroConfigSerializer.GetAccountCredentials(XmlConfiguration, isSandbox));
            }

            return(new AccountCredentials(isSandbox, email, token));
        }
        /// <summary>
        ///
        /// </summary>
        public static AccountCredentials Credentials(bool?sandbox = null)
        {
            if (!sandbox.HasValue)
            {
                sandbox = Sandbox;
            }

            if (Configuration == null)
            {
                return(PagSeguroConfigSerializer.GetAccountCredentials(LoadXmlConfig(), sandbox.Value));
            }

            if (sandbox.Value)
            {
                return(new AccountCredentials(Configuration.Credential.SandboxEmail.Value, Configuration.Credential.SandboxToken.Value));
            }

            return(new AccountCredentials(Configuration.Credential.Email.Value, Configuration.Credential.Token.Value));
        }
 /// <summary>
 ///
 /// </summary>
 public static AccountCredentials Credentials(bool sandbox)
 {
     return(PagSeguroConfigSerializer.GetAccountCredentials(LoadXmlConfig(), sandbox));
 }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 public static AccountCredentials Credentials(bool sandbox)
 {
     return(PagSeguroConfigSerializer.GetAccountCredentials(CurrentConfig, sandbox));
 }