示例#1
0
        static void Main(string[] args)
        {
            bool isSandbox = false;

            EnvironmentConfiguration.ChangeEnvironment(isSandbox);

            Decimal amount          = 1000.00m;
            String  creditCardBrand = "visa";

            try
            {
                AccountCredentials credentials = PagSeguroConfiguration.Credentials(isSandbox);

                Installments result = InstallmentService.GetInstallments(credentials, amount, creditCardBrand);

                Console.WriteLine("Começando listagem de parcelas - \n");
                foreach (Installment installment in result.Get())
                {
                    Console.WriteLine(installment.ToString());
                }
                Console.WriteLine(" - Terminando listagem de parcelas ");

                Console.ReadKey();
            }
            catch (PagSeguroServiceException exception)
            {
                Console.WriteLine(exception.Message + "\n");

                foreach (ServiceError element in exception.Errors)
                {
                    Console.WriteLine(element + "\n");
                }
                Console.ReadKey();
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            bool isSandbox = false;

            EnvironmentConfiguration.ChangeEnvironment(isSandbox);

            Decimal amount                   = 1000.00m;
            String  creditCardBrand          = "visa";
            Int32   maxInstallmentNoInterest = 5;

            try
            {
                AccountCredentials credentials = PagSeguroConfiguration.GetAccountCredentials(isSandbox);

                Installments result = InstallmentService.GetInstallments(credentials, amount, creditCardBrand, maxInstallmentNoInterest);


                foreach (Installment installment in result.Get())
                {
                }
            }
            catch (PagSeguroServiceException exception)
            {
                foreach (ServiceError element in exception.Errors)
                {
                }
            }
        }