You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using GMEStatusSync.Common; using GMEStatusSync.Dao.KoronaPay; using GMEStatusSync.Helper; using Newtonsoft.Json; using System; using System.Data;
namespace GMEStatusSync.Business.KoronaPay { public class KoronaPayBusiness { private KoronaPayDao koronapay; public KoronaPayBusiness() { koronapay = new KoronaPayDao(); }
public void SynchronizeTran() { GetStatic.WriteLog("Koronapay Status Checking Started on :"); var dt = koronapay.GetTransactions(); if (dt == null || dt.Rows.Count == 0) { return; }
foreach (DataRow row in dt.Rows) { try { var json = new {oId= row["oId"]};
GMECoreAPIRequest req = new GMECoreAPIRequest(); req.provider = "koronapay"; req.processId = Guid.NewGuid().ToString(); req.requestJSON = JsonConvert.SerializeObject(json);
var res = ThirdPartyApi.GetStatus(req); if (res != null) { var st = JsonConvert.DeserializeObject<GetStatusResponseModel>(res); if (st.TpStatus.ToUpper() == "PAIDOUT" && st.ErrorCode=="0") { GetStatic.WriteLog(row["ControlNo"] + " updating as paid"); koronapay.SynchronizePaid(Convert.ToString(row["TranId"])); } else if (st.ErrorCode == "0" && (st.TpStatus.ToUpper() == "REFUNDED" || st.TpStatus.ToUpper() =="CANCELED")) { GetStatic.WriteLog(row["ControlNo"] + " updating as cancel"); koronapay.SynchronizeCancel(Convert.ToString(row["TranId"])); } } else { GetStatic.WriteLog("Null from Third party api call :"); } } catch (Exception ex) { GetStatic.WriteLog(ex.ToString()); continue; }
GetStatic.WriteLog("Koronapay Status Checking Ended on :"); } } } }
|