internal PostBackVM DoApiSaleTransactionVerify(TransVerifyVM vm) { ApiHelper apiCaller = new ApiHelper(); var dataDic = apiCaller.saleTxnVerify(vm); var callback = ReadFromXmlString(dataDic.ToList().Find(a => a.Key == "PTRECEIPT").Value, "saleTxnVerify"); PostBackVM pvm = new PostBackVM(); if (callback.ContainsKey("txn_status")) { pvm.AuthCode = (callback.ContainsKey("auth_code")) ? callback["auth_code"] : ""; pvm.BankRefID = (callback.ContainsKey("bank_ref_id")) ? callback["bank_ref_id"] : ""; pvm.CurrencyCode = (callback.ContainsKey("cur")) ? callback["cur"] : ""; pvm.CustomerName = (callback.ContainsKey("name")) ? callback["name"] : ""; pvm.FailReason = (callback.ContainsKey("reason")) ? callback["reason"] : ""; pvm.IPGTransactionID = (callback.ContainsKey("ipg_txn_id")) ? callback["ipg_txn_id"] : ""; pvm.LanguageCode = (callback.ContainsKey("lang")) ? callback["lang"] : ""; pvm.MaskedAccNo = (callback.ContainsKey("acc_no")) ? callback["acc_no"] : ""; pvm.MerRefID = (callback.ContainsKey("mer_var1")) ? callback["mer_var1"] : ""; pvm.MerVar1 = (callback.ContainsKey("mer_var1")) ? callback["mer_var1"] : ""; pvm.MerVar2 = (callback.ContainsKey("mer_var2")) ? callback["mer_var2"] : ""; pvm.MerVar3 = (callback.ContainsKey("mer_var3")) ? callback["mer_var3"] : ""; pvm.MerVar4 = (callback.ContainsKey("mer_var4")) ? callback["mer_var4"] : ""; pvm.ServerTime = (callback.ContainsKey("server_time")) ? callback["server_time"] : ""; pvm.TxnAmount = (callback.ContainsKey("txn_amt")) ? callback["txn_amt"] : ""; pvm.TxnStatus = (callback.ContainsKey("txn_status")) ? callback["txn_status"] : ""; } else { pvm.TxnStatus = "UnAuthorized"; } return(pvm); }
public Dictionary <string, string> saleTxnVerify(TransVerifyVM vm) { string PTInvoice = "<req>" + "<mer_id>" + MerchantId + "</mer_id>" + "<mer_txn_id>" + vm.MerRefID + "</mer_txn_id>" + "<txn_uuid>" + vm.TxnUUID + "</txn_uuid>" + "<action>" + vm.Action + "</action>"; PTInvoice = PTInvoice + "</req>"; var finalHex = Cryptographer.ByteArrayToString(Encoding.UTF8.GetBytes(PTInvoice)); return(PearToPear(finalHex, false, vm.Action)); }
public ActionResult PostBackFromPayment() { ViewBag.Message = "Your application description page."; TransVerifyVM vm = new TransVerifyVM(); gHelper = new GenaralHelpers(Session); vm.TxnUUID = (Session["ipay_out__txn_uuid"] != null)? Session["ipay_out__txn_uuid"].ToString(): ""; //Get this from session vm.Action = "saleTxnVerify"; vm.MerRefID = (Session["ipay_in__mer_ref_id"] != null)? Session["ipay_in__mer_ref_id"].ToString():""; var backVM = gHelper.DoApiSaleTransactionVerify(vm); return(View(backVM)); }