public ActionResult CancelOrder()
        {
            var cancelTransactionRequest = new CancelTransactionRequest((string) Session["tid"], _configuration);
            var response = _cieloService.CancelTransaction(cancelTransactionRequest);
            ViewBag.Status = response.Status.ToString();

            return RedirectToAction("Callback");
        }
        public void ToXml_GivenACancelTransactionRequest_ShouldGenerateAXmlAsExpected()
        {
            var cancelTransactionRequest = new CancelTransactionRequest("10069930690864271001", new FakeConfiguration())
            {
                UniqueKey = Guid.Parse("4c38f150-b67d-4059-88d1-b53b13e54a8e")
            };

            cancelTransactionRequest
                .ToXml(false)
                .RemoveNewLinesAndSpaces()
                .Should()
                .Be(ExpectedXml.RemoveNewLinesAndSpaces());
        }
Beispiel #3
0
 public CancelTransactionResponse CancelTransaction(CancelTransactionRequest request)
 {
     var responseContent = string.Empty;
     try
     {
         responseContent = Execute(request);
         CreateExceptionIfError(responseContent);
         return new CancelTransactionResponse(responseContent);
     }
     catch (Exception ex)
     {
         throw new ResponseException(responseContent, ex);
     }
 }