private bool VarifyCheckSum() { try { return(CalculateCheckSum.VarifyCheckSum(data, CheckSum)); } catch (Exception exp) { logger.Info("Exception: " + exp.Message); } return(false); }
///// <summary> ///// Fill Dictionary With Basic Parametes ///// </summary> //private void FillDictionary() //{ // BasicParameters.Add("PaymeGetwayURL", PaymeGetwayURL); // BasicParameters.Add("MerchantID", MerchantID); // BasicParameters.Add("CurrencyType", CurrencyType); // BasicParameters.Add("TypeField1", TypeField1); // BasicParameters.Add("SecurityID", SecurityID); // BasicParameters.Add("TypeField2", TypeField2); // BasicParameters.Add("TxnAmount", TxnAmount); // BasicParameters.Add("CustomerID", CustomerID); // BasicParameters.Add("AdditionalInfo1", AdditionalInfo1); // BasicParameters.Add("AdditionalInfo2", AdditionalInfo2); // BasicParameters.Add("AdditionalInfo3", AdditionalInfo3); // BasicParameters.Add("AdditionalInfo4", AdditionalInfo4); // BasicParameters.Add("AdditionalInfo5", AdditionalInfo5); // BasicParameters.Add("AdditionalInfo6", AdditionalInfo6); // BasicParameters.Add("AdditionalInfo7", AdditionalInfo7); // BasicParameters.Add("RU", RU); //} /// <summary> /// Create Payment Request /// </summary> /// <returns></returns> public string GetPaymentRequest() { if (BasicParameters.Keys.Count == 0) { BasicParameters.Add("PaymeGetwayURL", PaymeGetwayURL); BasicParameters.Add("MerchantID", MerchantID); BasicParameters.Add("CurrencyType", CurrencyType); BasicParameters.Add("TypeField1", TypeField1); BasicParameters.Add("SecurityID", SecurityID); BasicParameters.Add("TypeField2", TypeField2); BasicParameters.Add("TxnAmount", TxnAmount); BasicParameters.Add("CustomerID", CustomerID); BasicParameters.Add("AdditionalInfo1", AdditionalInfo1); BasicParameters.Add("AdditionalInfo2", AdditionalInfo2); BasicParameters.Add("AdditionalInfo3", AdditionalInfo3); BasicParameters.Add("AdditionalInfo4", AdditionalInfo4); BasicParameters.Add("AdditionalInfo5", AdditionalInfo5); BasicParameters.Add("AdditionalInfo6", AdditionalInfo6); BasicParameters.Add("AdditionalInfo7", AdditionalInfo7); BasicParameters.Add("RU", RU); } ///STEP-1 Create Request String string request = "MerchantID|CustomerID|NA|TxnAmount|NA|NA|NA|CurrencyType|NA|TypeField1|SecurityID|NA|NA|TypeField2|AdditionalInfo1|AdditionalInfo2|AdditionalInfo3|AdditionalInfo4|AdditionalInfo5|AdditionalInfo6|AdditionalInfo7|RU"; string[] keys = request.Split('|'); foreach (var item in keys) { if (item.Trim() != "NA") { request = request.Replace(item, BasicParameters[item]); } } logger.Info("Request Parameter String: " + request); ///STEP-2 Calculate Checksum Using Key And Append request = request + "|" + CalculateCheckSum.GetCheckSum(request, "Reqest"); logger.Info("Request With CheckSum: " + request); return(request); }