Hi
I am trying following code in asp.net core and getting error in message
request was not allowed this time
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss"); string store_id = "MyStoreID"; string api_token = "MyApiToken"; string amount = "5.00"; string pan = "4242424242424242"; string expdate = "1901"; //YYMM format string crypt = "7"; string processing_country_code = "CA"; bool status_check = false;
CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("U"); cof.SetPaymentInformation("2"); cof.SetIssuerId("168451306048014");
Purchase purchase = new Purchase(); purchase.SetOrderId(order_id); purchase.SetAmount(amount); purchase.SetPan(pan); purchase.SetExpDate("2011"); purchase.SetCryptType(crypt); purchase.SetDynamicDescriptor("2134565"); //purchase.SetWalletIndicator(""); //Refer to documentation for details purchase.SetCofInfo(cof);
//purchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant
HttpsPostRequest mpgReq = new HttpsPostRequest(); mpgReq.SetProcCountryCode(processing_country_code); mpgReq.SetTestMode(true); //false or comment out this line for production transactions mpgReq.SetStoreId(store_id); mpgReq.SetApiToken(api_token); mpgReq.SetTransaction(purchase); mpgReq.SetStatusCheck(status_check); mpgReq.Send();
try { Receipt receipt = mpgReq.GetReceipt(); var result = ""; result = "CardType = " + receipt.GetCardType(); result = "TransAmount = " + receipt.GetTransAmount(); result = "TxnNumber = " + receipt.GetTxnNumber(); result = "ReceiptId = " + receipt.GetReceiptId(); result = "TransType = " + receipt.GetTransType(); result = "ReferenceNum = " + receipt.GetReferenceNum(); result = "ResponseCode = " + receipt.GetResponseCode(); result = "ISO = " + receipt.GetISO(); result = "BankTotals = " + receipt.GetBankTotals(); result = "Message = " + receipt.GetMessage(); result = "AuthCode = " + receipt.GetAuthCode(); result = "Complete = " + receipt.GetComplete(); result = "TransDate = " + receipt.GetTransDate(); result = "TransTime = " + receipt.GetTransTime(); result = "Ticket = " + receipt.GetTicket(); result = "TimedOut = " + receipt.GetTimedOut(); result = "IsVisaDebit = " + receipt.GetIsVisaDebit(); result = "HostId = " + receipt.GetHostId(); result = "IssuerId = " + receipt.GetIssuerId(); //Console.ReadLine(); } catch (Exception e) {
//Console.WriteLine(e); }
In reply to Imran:
In reply to Fenix:
Thank you.
Anyway, I get the message (DECLINED * AMT OVER MAX =CANNOT PROCESS*EXCEEDS LIMIT) for amounts like $0.08, $0.11, $0.23, $0.91 using 4242424242424242 saved in vault although these should be approved and they were in past.