public ActionResult PostBackFromPayment() { APIHandler apiCaller = new APIHandler(); string UUID = Session["ipay_out__txn_uuid"].ToString(); var API_URL_Pay = "https://testipg.nationsdev.com/ipg/servlet_exppay"; string SessionXML = "3c7265713e3c6d65725f69643e544553544c4b52313c2f6d65725f69643e3c6d65725f74786e5f69643e39313935333c2f6d65725f74786e5f69643e3c74786e5f757569643e63303031633264332d376464622d346564622d386439372d6562393363666636313935613c2f74786e5f757569643e3c616374696f6e3e73616c6554786e5665726966793c2f616374696f6e3e3c2f7265713e"; APIHandler handler = new APIHandler(); var returnData = handler.PearToPear(SessionXML, false, "saleTxnVerify"); if (returnData.ContainsKey("ERROR_CODE")) { //**************************THIS MEAN AN ERROR ON RESPONSE********************* //NEED TO HANDLE THIS ********************************************************* return(View()); } else { PostBackVM postbackVM = new PostBackVM() { AuthCode = (returnData["auth_code"] != null) ? returnData["auth_code"] : "", BankRefID = (returnData["bank_ref_id"] != null) ? returnData["bank_ref_id"] : "", CurrencyCode = (returnData["cur"] != null) ? returnData["cur"] : "", CustomerName = (returnData["name"] != null) ? returnData["name"] : "", FailReason = (returnData["reason"] != null) ? returnData["reason"] : "", IPGTransactionID = (returnData["ipg_txn_id"] != null) ? returnData["ipg_txn_id"] : "", MaskedAccNo = (returnData["acc_no"] != null) ? returnData["acc_no"] : "", ServerTime = (returnData["server_time"] != null) ? returnData["server_time"] : "", LanguageCode = (returnData["lang"] != null) ? returnData["lang"] : "", MerRefID = (returnData["mer_txn_id"] != null) ? returnData["mer_txn_id"] : "", TxnAmount = (returnData["txn_amt"] != null) ? returnData["txn_amt"] : "", TxnStatus = (returnData["txn_status"] != null) ? returnData["txn_status"] : "", MerVar1 = (returnData["mer_var1"] != null) ? returnData["mer_var1"] : "", MerVar2 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", MerVar3 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", MerVar4 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", }; return(View(postbackVM)); } }
public ActionResult PostBackFromPayment() { Session["ipay_in__action"] = "saleTxnVerify"; ApiHelper apiCaller = new ApiHelper(Session); var returnData = apiCaller.saleTxnVerify(); if (returnData.ContainsKey("ERROR_CODE")) { //**************************THIS MEAN AN ERROR ON RESPONSE********************* //NEED TO HANDLE THIS ********************************************************* return(View()); } else { PostBackVM postbackVM = new PostBackVM() { AuthCode = (returnData["auth_code"] != null) ? returnData["auth_code"] : "", BankRefID = (returnData["bank_ref_id"] != null) ? returnData["bank_ref_id"] : "", CurrencyCode = (returnData["cur"] != null) ? returnData["cur"] : "", CustomerName = (returnData["name"] != null) ? returnData["name"] : "", FailReason = (returnData["reason"] != null) ? returnData["reason"] : "", IPGTransactionID = (returnData["ipg_txn_id"] != null) ? returnData["ipg_txn_id"] : "", MaskedAccNo = (returnData["acc_no"] != null) ? returnData["acc_no"] : "", ServerTime = (returnData["server_time"] != null) ? returnData["server_time"] : "", LanguageCode = (returnData["lang"] != null) ? returnData["lang"] : "", MerRefID = (returnData["mer_txn_id"] != null) ? returnData["mer_txn_id"] : "", TxnAmount = (returnData["txn_amt"] != null) ? returnData["txn_amt"] : "", TxnStatus = (returnData["txn_status"] != null) ? returnData["txn_status"] : "", MerVar1 = (returnData["mer_var1"] != null) ? returnData["mer_var1"] : "", MerVar2 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", MerVar3 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", MerVar4 = (returnData["mer_var2"] != null) ? returnData["mer_var2"] : "", }; return(View(postbackVM)); } }