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

            EnvironmentConfiguration.ChangeEnvironment(isSandbox);

            String transactionCode = "3B1097583EC84C7E9EDC391949F9C4BC";

            try
            {
                AccountCredentials credentials = new AccountCredentials("", "");

                // TODO: Substitute the code below with a valid transaction code for your transaction
                RequestResponse result = CancelService.RequestCancel(credentials, transactionCode);

                Console.WriteLine(result.ToString());

                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);

            String transactionCode = "3B1097583EC84C7E9EDC391949F9C4BC";

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

                // TODO: Substitute the code below with a valid transaction code for your transaction
                RequestResponse result = CancelService.RequestCancel(credentials, transactionCode);
            }
            catch (PagSeguroServiceException exception)
            {
                foreach (ServiceError element in exception.Errors)
                {
                }
            }
        }