Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PayU Lu c#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Globalization; using System.IO; using System.Net; using System.Security.Cryptography; using System.Text; using System.Web; using System.Xml; namespace Rextester { public class StringString { public string Text1 { get; set; } public string Text2 { get; set; } } public class Program { public static void Main(string[] args) { NameValueCollection data = new NameValueCollection(); string backref = "https://www.webadresi.com/redirect.aspx"; data.Add("BACK_REF", backref); data.Add("BILL_COUNTRYCODE", "TR"); data.Add("BILL_EMAIL", "musterimail@deneme.com"); data.Add("BILL_FNAME", "musteriisim"); data.Add("BILL_LNAME", "musterisoyad"); data.Add("BILL_PHONE", "musteritel"); data.Add("CC_CVV", "000"); data.Add("CC_NUMBER", "4355084355084358"); data.Add("CLIENT_IP", "127.0.0.1"); data.Add("EXP_MONTH", "12"); data.Add("EXP_YEAR", "2018"); data.Add("MERCHANT", "OPU_TEST"); data.Add("ORDER_DATE", string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.UtcNow)); data.Add("ORDER_PCODE[0]", "001"); data.Add("ORDER_PCODE[1]", "002"); data.Add("ORDER_PINFO[0]", "Renk:Siyah"); data.Add("ORDER_PINFO[1]", "Renk:Lacivert"); data.Add("ORDER_PNAME[0]", "Mammamia Ayakkabı"); data.Add("ORDER_PNAME[1]", "Mammamia Ayakkabı 2"); data.Add("ORDER_PRICE[0]", "150.00"); data.Add("ORDER_PRICE[1]", "160.00"); data.Add("ORDER_PRICE_TYPE[0]", "GROSS");//kdv dahil de GROSS data.Add("ORDER_PRICE_TYPE[1]", "GROSS");//kdv dahil de GROSS data.Add("ORDER_QTY[0]", "1"); data.Add("ORDER_QTY[1]", "1"); data.Add("ORDER_REF", "150022"); //sipariş numaranız data.Add("PAY_METHOD", "CCVISAMC"); data.Add("PRICES_CURRENCY", "TRY"); data.Add("SELECTED_INSTALLMENTS_NUMBER", "3"); //taksit varsa var deger = ""; foreach (var val in data) { var value = val as string; var byteCount = Encoding.UTF8.GetByteCount(data.Get(value)); deger += byteCount + data.Get(value); } var signatureKey = "SECRET_KEY"; var hash = HashWithSignature(deger, signatureKey); Console.WriteLine(deger); Console.WriteLine(hash); data.Add("ORDER_HASH", hash); var x = POSTFormPayu("https://secure.payu.com.tr/order/alu/v3", data); Console.WriteLine(x); } public static string HashWithSignature(string hashString, string signature) { var binaryHash = new HMACMD5(Encoding.UTF8.GetBytes(signature)) .ComputeHash(Encoding.UTF8.GetBytes(hashString)); var hash = BitConverter.ToString(binaryHash) .Replace("-", string.Empty) .ToLowerInvariant(); return hash; } private static string POSTFormPayu(string url, NameValueCollection data) { var result = new List<StringString>(); var webClient = new WebClient(); StringString sonucItem = null; try { string request = System.Text.Encoding.UTF8.GetString(webClient.UploadValues(url, data)).Trim(); return request; } catch (WebException ex) { throw; } } } }
run
|
edit
|
history
|
help
0
Assignment
2.10.4
Execution flow of static and normal constructor of base and derived class.
Bellman Ford algorithm helps to find the shortest path
SADXS
Array merge
sdf
last ie
enum.TryParse
Main