esqa.moneris.com e-commerce SSL issues?

I am getting null values on Receipt.GetResponseCode() .  Is store3 down for SSL?

 

Global error receipt is:

 

<?xml version="1.0"?><response><receipt><ReceiptId>Global Error Receipt</ReceiptId><ReferenceNum>null</ReferenceNum><ResponseCode>null</ResponseCode><ISO>null</ISO> <AuthCode>null</AuthCode><TransTime>null</TransTime><TransDate>null</TransDate><TransType>null</TransType><Complete>false</Complete><Message>null</Message><TransAmount>null</TransAmount><CardType>null</CardType><TransID>null</TransID><TimedOut>null</TimedOut></receipt></response>

  • nm, it was related to the TLS change.

    I have added the below before making the call to GetReceipt()

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

    All is good now.
  • In reply to Pedro:

    i am getting the same exception can you help me or provide sample code in c#
  • In reply to Azam:

    I added the below line of code in the Application_Start() method in global.asax

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

    Hope that helps.
    Pedro
  • In reply to Pedro:

    Thanks, but its not working
    i am using .Net Framework 4.5
    static void Main(string[] args)
    {
    string host = "esqa.moneris.com/mpg/";
    string store_id = "store3";
    string api_token = "yesguy";
    string order_id;
    Console.Write("Please enter an order ID: ");
    order_id = Console.ReadLine();
    string cust_id = "13";
    string amount = "1.00";
    string card = "5454545454545454";
    string exp = "0817";
    string crypt = "0";
    string status = "false";

    HttpsPostRequest mpgReq =
    new HttpsPostRequest(host, store_id, api_token, status,
    new Purchase(order_id, cust_id, amount, card, exp, crypt));
    string str = mpgReq.toXML();


    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
    Receipt receipt = mpgReq.GetReceipt();

    try
    {


    Console.WriteLine("CardType = " + receipt.GetCardType());
    Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
    Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
    Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
    Console.WriteLine("TransType = " + receipt.GetTransType());
    Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
    Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
    Console.WriteLine("ISO = " + receipt.GetISO());
    Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
    Console.WriteLine("Message = " + receipt.GetMessage());
    Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
    Console.WriteLine("Complete = " + receipt.GetComplete());
    Console.WriteLine("TransDate = " + receipt.GetTransDate());
    Console.WriteLine("TransTime = " + receipt.GetTransTime());
    Console.WriteLine("Ticket = " + receipt.GetTicket());
    Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
    Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
    Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
    Console.ReadLine();
    }
    catch (Exception e)
    {
    Console.WriteLine(e);
    }

    }
  • In reply to Pedro:

    Thanks, but its not working

    i am using .Net Framework 4.5 and eSELECTplus_dotNet_API version v2.0.50727 in console application. can you please check and help.

    static void Main(string[] args)

           {

               string host = "esqa.moneris.com/mpg/";

               string store_id = "store3";

               string api_token = "yesguy";

               string order_id;

               Console.Write("Please enter an order ID: ");

               order_id = Console.ReadLine();

               string cust_id = "13";

               string amount = "1.00";

               string card = "5454545454545454";

               string exp = "0817";

               string crypt = "0";

               string status = "false";

               HttpsPostRequest mpgReq =

                   new HttpsPostRequest(host, store_id, api_token, status,

                              new Purchase(order_id, cust_id, amount, card, exp, crypt));

               string str = mpgReq.toXML();

               ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

               Receipt receipt = mpgReq.GetReceipt();

               try

               {

                   Console.WriteLine("CardType = " + receipt.GetCardType());

                   Console.WriteLine("TransAmount = " + receipt.GetTransAmount());

                   Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());

                   Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());

                   Console.WriteLine("TransType = " + receipt.GetTransType());

                   Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());

                   Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());

                   Console.WriteLine("ISO = " + receipt.GetISO());

                   Console.WriteLine("BankTotals = " + receipt.GetBankTotals());

                   Console.WriteLine("Message = " + receipt.GetMessage());

                   Console.WriteLine("AuthCode = " + receipt.GetAuthCode());

                   Console.WriteLine("Complete = " + receipt.GetComplete());

                   Console.WriteLine("TransDate = " + receipt.GetTransDate());

                   Console.WriteLine("TransTime = " + receipt.GetTransTime());

                   Console.WriteLine("Ticket = " + receipt.GetTicket());

                   Console.WriteLine("TimedOut = " + receipt.GetTimedOut());

                   Console.WriteLine("StatusCode = " + receipt.GetStatusCode());

                   Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());

                   Console.ReadLine();

               }

               catch (Exception e)

               {

                   Console.WriteLine(e);

               }

           }

  • In reply to Azam:

    This is not on app start. Try putting the code in a location that will get called as soon as your app is initialized.

    Pedro
  • In reply to Pedro:

    Thanks again, I added this line of code on startup on my project but now getting another exception that remote server returned an error : <404> not found.
  • In reply to Pedro:

    or at least before HttpsPostRequest in your main()
  • In reply to ME_Moneris:

    I am also using .NET 4.6.2. I had the line of code right before HttpsPostRequest initially, but for some reason it wouldn't switch to TLS 1.1 + until the second post request.

    Pedro
  • In reply to Azam:

    Please change the host to esqa.moneris.com
  • In reply to ME_Moneris:

    Thank you so much, its work for me. Can you please tell me where i can download the latest api?
  • In reply to Pedro:

    Thank you so much,
  • In reply to Azam:

    You can find the latest API here. This API works for both US and Canada. You don't need to manually set the host in this one; you just need to set your processing country to US/CA and set testmode to true/false and that will set the correct host for you.

    github.com/.../eCommerce-Unified-API-dotNet