예제 #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)
                {
                }
            }
        }
예제 #3
0
        public static bool Cancel(string refNo, string payType, decimal amount, out CancelResponseModel response)
        {
            bool result;

            try
            {
                string jsonString = new CancelService
                {
                    refNo       = refNo,
                    payType     = payType,
                    transAmount = amount
                }.DefContent();
                response = null;
                response = JsonHelper.JsonDeserialize <List <CancelResponseModel> >(jsonString)[0];
                result   = true;
            }
            catch
            {
                response = null;
                result   = false;
            }
            return(result);
        }
예제 #4
0
 public UserController(UserService userService_, UserRoleService userRoleService_, CancelService cancelService_) : base(userService_)
 {
     userRoleService = userRoleService_;
     cancelService   = cancelService_;
 }
예제 #5
0
 public CountryController(CountryService service_, CancelService cancelService_) : base(service_)
 {
     cancelService = cancelService_;
 }
예제 #6
0
 public CustomerController(CustomerService customerService_, CancelService cancelService_) : base(customerService_)
 {
     cancelService = cancelService_;
 }