public IHttpActionResult recieptData(dynamic data) { string serialized_data = token_gen.Authorize_aesdecrpty(data); recieptModel rootobj = JsonConvert.DeserializeObject <recieptModel>(serialized_data); return(Ok(rbkPaymentsHelper.recieptData(rootobj))); }
public static dynamic recieptData(recieptModel obj) { dynamic objdata = new ExpandoObject(); try { string serialized_data = decryptString(obj.encryptedString); walletRespModel objResp = JsonConvert.DeserializeObject <walletRespModel>(serialized_data); if (objResp.ERRORCODE == "101") { try { walletProcModel walletObj = new walletProcModel(); walletObj.type = "2"; walletObj.walletTxnId = objResp.WALLETREFNO; walletObj.paymentStatus = "1"; walletObj.APPLICATIONNO = objResp.APPLICATIONNO; walletObj.GSWSREFNO = objResp.GSWSREFNO; DataTable dt = walletProc(walletObj); if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1") { resProcModel objRes = new resProcModel(); objRes.type = "5"; objRes.txnId = objResp.GSWSREFNO; DataTable dt1 = resProc(objRes); if (dt1 != null && dt1.Rows.Count > 0) { var input = new { id = objResp.APPLICATIONNO, transactionId = objResp.GSWSREFNO }; string input_data = JsonConvert.SerializeObject(input); string url = "https://hub.nukkadshops.com/v1/gew/updateTransaction"; string response = POST_RequestAsync(url, input_data); rbkPayRespModel rootobj = JsonConvert.DeserializeObject <rbkPayRespModel>(response); if (rootobj.status == 200) { var Innerinput = new { id = objResp.APPLICATIONNO }; input_data = JsonConvert.SerializeObject(Innerinput); url = "https://hub.nukkadshops.com/v1/gew/orderDetails"; response = POST_RequestAsync(url, input_data); orderDerailsRespModel rootobj1 = JsonConvert.DeserializeObject <orderDerailsRespModel>(response); if (rootobj1.Status == 200) { //call wallet table and resp table and txn cancel servie objdata.status = true; objdata.rbkDetails = rootobj1.Data; objdata.walletDetails = objResp; objdata.orderDetails = dt1; } else { //Auto Reconcile Module walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO); objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { //Auto Reconcile Module walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO); objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { //Auto Reconcile Module walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO); objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { //Auto Reconcile Module walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO); objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } catch (Exception ex1) { //Auto Reconcile Module walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO); objdata.status = false; objdata.result = ex1.Message.ToString(); } } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } catch (Exception ex) { objdata.status = false; objdata.result = ex.Message.ToString(); } return(objdata); }