public Dictionary <string, string> saleTxnVerify() { string Action = ""; string MerRefID = ""; string TxnUUID = ""; Action = (Session["ipay_in__action"] != null) ? Session["ipay_in__action"].ToString() : "saleTxnVerify"; MerRefID = (Session["ipay_in__mer_ref_id"] != null) ? Session["ipay_in__mer_ref_id"].ToString() : ""; TxnUUID = (Session["ipay_out__txn_uuid"] != null) ? Session["ipay_out__txn_uuid"].ToString() : ""; string PTInvoice = "<req>" + "<mer_id>" + MerchantId + "</mer_id>" + "<mer_txn_id>" + MerRefID + "</mer_txn_id>" + "<txn_uuid>" + TxnUUID + "</txn_uuid>" + "<action>" + Action + "</action>"; PTInvoice = PTInvoice + "</req>"; var byteArray = Encoding.UTF8.GetBytes(PTInvoice); var finalHex = Cryptographer.ByteArrayToString(byteArray); return(PearToPear(finalHex, false, "saleTxnVerify")); }
public Dictionary <string, string> saleTxn() { Dictionary <string, string> SalesData = new Dictionary <string, string>(); string Action = ""; string CurrencyCode = ""; string MerRefID = ""; string TxnAmount = ""; string LanguageCode = ""; string ReturnURL = ""; string MerVar1 = ""; string MerVar2 = ""; string MerVar3 = ""; string MerVar4 = ""; Action = (Session["ipay_in__action"] != null) ? Session["ipay_in__action"].ToString() : ""; CurrencyCode = (Session["ipay_in__cur"] != null) ? Session["ipay_in__cur"].ToString() : ""; MerRefID = (Session["ipay_in__mer_ref_id"] != null) ? Session["ipay_in__mer_ref_id"].ToString() : ""; TxnAmount = (Session["ipay_in__txn_amt"] != null) ? Session["ipay_in__txn_amt"].ToString() : ""; LanguageCode = (Session["ipay_in__lang"] != null) ? Session["ipay_in__lang"].ToString() : ""; ReturnURL = (Session["ipay_in__ret_url"] != null) ? Session["ipay_in__ret_url"].ToString() : ""; MerVar1 = (Session["ipay_in__mer_var1"] != null) ? Session["ipay_in__mer_var1"].ToString() : ""; MerVar2 = (Session["ipay_in__mer_var2"] != null) ? Session["ipay_in__mer_var2"].ToString() : ""; MerVar3 = (Session["ipay_in__mer_var3"] != null) ? Session["ipay_in__mer_var3"].ToString() : ""; MerVar4 = (Session["ipay_in__mer_var4"] != null) ? Session["ipay_in__mer_var4"].ToString() : ""; string PTInvoice = "<req>" + "<mer_id>" + MerchantId + "</mer_id>" + "<mer_txn_id>" + MerRefID + "</mer_txn_id>" + "<action>" + Action + "</action>" + "<txn_amt>" + TxnAmount + "</txn_amt>" + "<cur>" + CurrencyCode + "</cur>" + "<lang>" + LanguageCode + "</lang>"; if ((ReturnURL != null) && (ReturnURL.Length > 0)) { PTInvoice = PTInvoice + "<ret_url>" + ReturnURL + "</ret_url>"; } if ((MerVar1 != null) && (MerVar1.Length > 0)) { PTInvoice = PTInvoice + "<mer_var1>" + MerVar1 + "</mer_var1>"; } if ((MerVar2 != null) && (MerVar2.Length > 0)) { PTInvoice = PTInvoice + "<mer_var2>" + MerVar2 + "</mer_var2>"; } if ((MerVar3 != null) && (MerVar3.Length > 0)) { PTInvoice = PTInvoice + "<mer_var3>" + MerVar3 + "</mer_var3>"; } if ((MerVar4 != null) && (MerVar4.Length > 0)) { PTInvoice = PTInvoice + "<mer_var4>" + MerVar4 + "</mer_var4>"; } PTInvoice = PTInvoice + "</req>"; var byteArray = Encoding.UTF8.GetBytes(PTInvoice); var finalHex = Cryptographer.ByteArrayToString(byteArray); return(PearToPear(finalHex, false, "SaleTxn")); }