Ejemplo n.º 1
0
 public ActionResult VirtualTerminalTransactionPost(VirtualTerminalTransactionPostModels.VT_TRANSACTION transaction)
 {
     try
     {
         ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;                                        //tls protocol override
         com.collectorsolutions.stage.ProcessingGateway ws = new com.collectorsolutions.stage.ProcessingGateway(); //The web service
         XmlDocument         xmlRequest = new XmlDocument();
         XMLObjectSerializer obj        = new XMLObjectSerializer();
         //stub any optional/required parameters here that are not in the view//
         transaction.COLLECTIONMODE = "1";
         transaction.CSIUSERID      = "1";
         transaction.URLSILENTPOST  = "";
         transaction.PHONE          = Regex.Replace(transaction.PHONE, @"\D", "");
         xmlRequest.LoadXml(obj.objectXMLConverter <VirtualTerminalTransactionPostModels.VT_TRANSACTION>(transaction));
         //post/receive response//
         var reader     = new StringReader(ws.VT_Transaction_POST(xmlRequest).OuterXml);
         var serializer = new XmlSerializer(typeof(VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION));
         var response   = (VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)serializer.Deserialize(reader);
         //send data to partial view so it can be displayed//
         TempData["VTPostResponse"] = response;
         if (response.RESPONSECODE.StartsWith("Y"))
         {
             return(Redirect("https://stage.collectorsolutions.com/magic-ui/VirtualTerminal/csi-live/" + response.TRANSACTIONID));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception e)
     {
         return(View("Error"));
     }
 }
Ejemplo n.º 2
0
 public ActionResult VirtualTerminalTransactionPost(VirtualTerminalTransactionPostModels.VT_TRANSACTION transaction)
 {
     try
     {
         com.collectorsolutions.secure.legacy.ProcessingGateway ws = new com.collectorsolutions.secure.legacy.ProcessingGateway(); //The web service
         XmlDocument         xmlRequest = new XmlDocument();
         XMLObjectSerializer obj        = new XMLObjectSerializer();
         var xml = String.Empty;
         transaction.URLSILENTPOST = @"https://actweb.acttax.com/act_webdev/common/JavaSecure/CollectorSolutions/realtimeNotification.jsp";
         transaction.PHONE         = Regex.Replace(transaction.PHONE, @"\D", "");
         xmlRequest.LoadXml(obj.objectXMLConverter <VirtualTerminalTransactionPostModels.VT_TRANSACTION>(transaction));
         var reader     = new StringReader(ws.VT_Transaction_POST(xmlRequest).OuterXml);
         var serializer = new XmlSerializer(typeof(VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION));
         var response   = (VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)serializer.Deserialize(reader);
         TempData["VTPostResponse"] = response;
         if (response.RESPONSECODE.StartsWith("Y"))
         {
             //PCB Test
             return(Redirect("https://secure.collectorsolutions.com/csi_ecollections_portal_ui/interchange.aspx?ciid=99999991&ste=5&transid=" + response.TRANSACTIONID));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception e)
     {
         return(View("Error"));
     }
 }
Ejemplo n.º 3
0
 public ActionResult VirtualTerminalTransactionPost(VirtualTerminalTransactionPostModels.VT_TRANSACTION transaction)
 {
     try
     {
         ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;//Needed for .net4.5 and below
         //add any additional objects to model//for demo purposes we set them static//
         transaction.COLLECTIONMODE = "1";
         transaction.CSIUSERID      = "1";
         transaction.URLSILENTPOST  = "";
         transaction.PHONE          = Regex.Replace(transaction.PHONE, @"\D", "");
         var request = new RestRequest("api/transaction/redirect", Method.POST)
         {
             RequestFormat = DataFormat.Json
         };
         request.AddBody(transaction);
         IRestResponse response = client.Execute <VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION>(request);
         //send data to partial view so it can be displayed//
         var vtResponse = JsonConvert.DeserializeObject <VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION>(response.Content);
         TempData["VTPostResponse"] = vtResponse;
         if (vtResponse.status == "ok")
         {
             return(Redirect("https://stage.collectorsolutions.com/magic-ui/VirtualTerminal/csi-live/" + vtResponse.TRANSACTIONID));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception e)
     {
         return(View("Error"));
     }
 }