Ejemplo n.º 1
0
        public XObjs.InterSwitchResponse getJsonTrasactionsData(string product_id, string transactionreference, string amount, string get_trans_hash)
        {
            this.check_trans_page = ConfigurationManager.AppSettings["pd_get_trans_json_page"];
            RemotePost post = new RemotePost();

            post.Add("productid", product_id);
            post.Add("transactionreference", transactionreference);
            post.Add("amount", amount);
            post.AddHeader("Hash", get_trans_hash);
            string formResponse = post.GetFormResponse(this.check_trans_page, "GET");

            this.isr = this.js.Deserialize <XObjs.InterSwitchResponse>(formResponse);
            return(this.isr);
        }
Ejemplo n.º 2
0
 public XObjs.InterSwitchResponse myOldRedirect(string url, string headerName, string headerValue)
 {
     try
     {
         WebRequest request = WebRequest.Create(url);
         request.Headers.Add(headerName, headerValue);
         request.Method = "GET";
         StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.Default);
         string       input  = reader.ReadToEnd();
         reader.Close();
         this.isr = this.js.Deserialize <XObjs.InterSwitchResponse>(input);
     }
     catch (Exception exception)
     {
         string str2 = exception.ToString();
     }
     return(this.isr);
 }
Ejemplo n.º 3
0
 public XObjs.InterSwitchResponse myRedirect(string url, string headerName, string headerValue)
 {
     try
     {
         HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
         request.Headers.Add(headerName, headerValue);
         request.Method = "GET";
         ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
         ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.AcceptAllCertifications);
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();
         StreamReader    reader   = new StreamReader(response.GetResponseStream(), Encoding.Default);
         string          input    = reader.ReadToEnd();
         reader.Close();
         this.isr = this.js.Deserialize <XObjs.InterSwitchResponse>(input);
     }
     catch (Exception exception)
     {
         string str2 = exception.ToString();
         return(this.isr);
     }
     return(this.isr);
 }