Posted: October 05, 2017 at 12:38 PM Quote #194229
I customise the payment plugin in which  I  post  parameters  and  show  the  return  page. But  i  face  problem   After  Posting  data  to  a  specific  URL,  Return  page  did't  show completely/properly (Only  text  shows  with out  any  image.                        

                                                              

    public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
                {
                
                string orderNo = postProcessPaymentRequest.Order.Id.ToString();
                string amount = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
                string merchantId = _NetConnectPaymentSettings.CustomerId;   //"170900010400235"
                string date = DateTime.Now.ToString("dd/MM/yyyy");
                string time = DateTime.Now.ToString("HH:mm:ss");
                string urlNetConnect = _NetConnectPaymentSettings.PaymentPage;
    
                var handler1 = new HttpClientHandler();
                if (handler1.SupportsAutomaticDecompression)
                {
                    handler1.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
                               }
    
                string checksum4 = Generate_MerchantRequest_Check_Sum("7C1266A3351A3F900A85B9098BB1981", merchantId, orderNo, amount, date, time);
    
                HttpClientHandler handler = new HttpClientHandler()
                {
                    AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
                };
    
                var client = new HttpClient(handler1);
    
                var values = new List<KeyValuePair<string, string>>();
                values.Add(new KeyValuePair<string, string>("Merchant_ID", merchantId));
                values.Add(new KeyValuePair<string, string>("Order_NO", orderNo));
                values.Add(new KeyValuePair<string, string>("Order_Amount", amount));
    
                values.Add(new KeyValuePair<string, string>("Date", date));
                values.Add(new KeyValuePair<string, string>("Time", time));
    
                values.Add(new KeyValuePair<string, string>("CheckSum", checksum4));
                values.Add(new KeyValuePair<string, string>("Transaction_Desc", "Shop From SM Motors"));
    
                var content = new FormUrlEncodedContent(values);
    
    
                // string postBack = "http://www.smmotors.org"
                  "http://www.smmotors.org" rel="nofollow">http://www.smmotors.org          

                //HttpResponseMessage response = client.PostAsync("http://103.25.136.125/KPALServer/NetConnect.aspx", content).Result;
    

           //  client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                
                HttpResponseMessage response = client.PostAsync(urlNetConnect, content).Result;
    
            //    response.Content.Headers.ContentType = new MediaTypeHeaderValue("application / json");
    
                if (response.IsSuccessStatusCode)
                {
                    
                    var     responseString = response.Content.ReadAsStringAsync().Result;
                    
    
    //                responseString.Wait();
                    
                    HttpContext.Current.Response.Write(responseString);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    HttpContext.Current.Response.End();
                    _webHelper.IsPostBeingDone = true;
    
                }
                else
                {
                    throw new NopException();
                }
                return;
    
    }





Below Is The Return Page After Posting Data. Please guide how to solve this issue.

This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)