2

My application is on dot net core 2.1. I am using PayTm dll. Everything is working except Refund API. Always it is returning 501 with the PENDING status & message as "System Error".

Please check my below code.

string jsonData = "{ 'mid':'546yrtrgfhrtrgfgfg','orderId':'ROLI0Z5URRTJQ','txnType':'REFUND','refundAmount':'10','txnId':'2019063011121281120949176094516','refId':'REF978000015'}";
            string paytmChecksum = paytm.CheckSum.generateCheckSumByJson("09A76423dfertg", jsonData);
            HttpWebRequest connection = (HttpWebRequest)WebRequest.Create("https://securegw.paytm.in/refund/apply");
            connection.Method = "POST";
            connection.Headers.Add("signature", paytmChecksum);
            using (StreamWriter requestWriter = new StreamWriter(connection.GetRequestStream()))
            {
                requestWriter.Write(jsonData);
            }
            using (StreamReader responseReader = new StreamReader(connection.GetResponse().GetResponseStream()))
            {
                string responseData = string.Empty;
                responseData = responseReader.ReadToEnd();
                return responseData;
            } 

Please Note that: I have tried different checksum generation methods (like generateChecksumForRefund, generateChecksum and generateChecksumByJson), every time I am getting the same error. I am using production keys.

BPDESILVA
  • 2,040
  • 5
  • 15
  • 35
Roushan
  • 264
  • 2
  • 14
  • HTTP 501 error is the [not implemented](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501) error. If that is the case there is nothing you can do about it in your code – MindSwipe Jul 08 '19 at 05:45
  • Thanks for your reply. But payTm have given the official documentation for refund API. Without implementing,I believe they will not provide the documentation. Please visit the url for their documentation. https://developer.paytm.com/docs/refund-api/ – Roushan Jul 08 '19 at 05:55
  • The exact Response is : {"head":{"responseTimestamp":"1562473442033","version":"v1"}, "body":{"resultInfo":{"resultStatus":"PENDING","resultCode":"501","resultMsg":"System Error."}}} – Roushan Jul 08 '19 at 05:57
  • @Roushan, any luck on this? I have the same issue. – Gary Vernon Grubb Jul 25 '19 at 06:27

1 Answers1

0

According to the error doc error 501 is an system error inside payTm.

https://developer.paytm.com/docs/refund-status-api/

There is nothing wrong from your side, I suggest you to wait a few hours and try again. it will automatically work

Eldhopj
  • 2,703
  • 3
  • 20
  • 39