I am trying to create credit card payment page. I am posting the form in code behind (C#) and successfully get the verification sms from bank. But it does not redirect to bank sms verification page so there is no where to enter verification code. So what should i do?
Here is my code under the Pay button:
String shopCode = "SHOPCODE";
String purchaseAmount = "ORDER PRICE";
String currency = "CURRENCY";
String orderId = "ORDERID";
String okUrl = "REDIRECT PAGE AFTER SMS VERIFICATION COMPLETED SUCCESSFULLY";
String failUrl = "REDIRECT PAGE IF SMS VERIFICATION FAILS";
String rnd = DateTime.Now.ToString();
String installmentCount = "3";
String txnType = "txnType";
String merchantPass = "merchantpass";
String str = shopCode + orderId + purchaseAmount + okUrl + failUrl + txnType + installmentCount + rnd + merchantPass;
System.Security.Cryptography.SHA1 sha = new System.Security.Cryptography.SHA1CryptoServiceProvider();
byte[] bytes = System.Text.Encoding.GetEncoding("ISO-8859-9").GetBytes(str);
byte[] hashingbytes = sha.ComputeHash(bytes);
String hash = Convert.ToBase64String(hashingbytes);
String cardnumber = "CREDIT CARD NUMBER";
String expiry = "EXPIRY DATE";
String CVCCVV = "CVCNUMBER";
String securetype = "3DPay";
String lang = "language";
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "Pan=" + cardnumber;
postData += ("&Expiry=" + expiry);
postData += ("&Cvv2=" + CVCCVV);
postData += ("&ShopCode=" + shopCode);
postData += ("&PurchAmount=" + purchaseAmount);
postData += ("&Currency=" + currency);
postData += ("&OrderId=" + orderId);
postData += ("&OkUrl=" + okUrl);
postData += ("&FailUrl=" + failUrl);
postData += ("&Rnd=" + rnd);
postData += ("&Hash=" + hash);
postData += ("&TxnType=" + txnType);
postData += ("&InstallmentCount=" + installmentCount);
postData += ("&SecureType=" + securetype);
postData += ("&Lang=" + lang);
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("POSURL");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
EDIT: It works fine if i do it in client (html) side, but i want to do it in server side.
we need json information from the bank