public static string GetSignature(payfortParams objMaster) { try { var ShaReqeustVar = "91wG1283xoSln4Db9Y7IPZ&?"; var myArray = new Dictionary <string, string>(); myArray.Add("access_code", "a9U2M7lKbzlSOKzkyMli"); //myArray.Add("amount", Convert.ToString(Convert.ToDouble(objMaster.amount) *100) ); myArray.Add("amount", Convert.ToString(Convert.ToDouble(objMaster.amount))); myArray.Add("command", "PURCHASE"); myArray.Add("currency", objMaster.currency); myArray.Add("customer_email", objMaster.customer_email); myArray.Add("language", "en"); myArray.Add("merchant_identifier", "957fafda"); myArray.Add("merchant_reference", objMaster.merchant_reference); myArray.Add("order_description", "iPhone 6-S"); myArray.Add("payment_option", objMaster.payment_option); myArray.Add("return_url", "http://payfort.eumra.com/Default.aspx"); //myArray.Add("return_url", "http://127.0.0.1:17040/Response.aspx"); var baseString = ""; foreach (var item in myArray) { baseString += item.Key + "=" + item.Value; } var shastring = ShaReqeustVar + baseString + ShaReqeustVar; var shaPhrase = SHA256Util.sha256_hash(shastring); return(shaPhrase); } catch { return(""); } }
protected void Page_Load(object sender, EventArgs e) { payfortParams objMaster = new payfortParams(); JSonOutput = GetSignature(objMaster); }