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(); } }
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) { } } }
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); }
public UserController(UserService userService_, UserRoleService userRoleService_, CancelService cancelService_) : base(userService_) { userRoleService = userRoleService_; cancelService = cancelService_; }
public CountryController(CountryService service_, CancelService cancelService_) : base(service_) { cancelService = cancelService_; }
public CustomerController(CustomerService customerService_, CancelService cancelService_) : base(customerService_) { cancelService = cancelService_; }