public void TestTerminalApiRequestEmptyResponse()
 {
     try
     {
         //encrypt the request using encryption credentials
         var paymentRequest = MockPosApiRequest.CreatePosPaymentRequest();
         //create a mock client
         var client             = CreateMockTestClientPosLocalApiRequest("");
         var posPaymentLocalApi = new PosPaymentLocalApi(client);
         var saleToPoiResponse  = posPaymentLocalApi.TerminalApiLocal(paymentRequest, _encryptionCredentialDetails);
         Assert.IsNull(saleToPoiResponse);
     }
     catch (Exception)
     {
         Assert.Fail();
     }
 }
 public void TestTerminalApiRequestRemoteCertificationException()
 {
     try
     {
         //encrypt the request using encryption credentials
         var paymentRequest = MockPosApiRequest.CreatePosPaymentRequest();
         //create a mock client
         var client             = CreateMockTestClientPosLocalApiRequest("Mocks/terminalapi/pospayment-encrypted-success.json");
         var posPaymentLocalApi = new PosPaymentLocalApi(client);
         var configEndpoint     = posPaymentLocalApi.Client.Config.Endpoint;
         var saleToPoiResponse  = posPaymentLocalApi.TerminalApiLocal(paymentRequest, _encryptionCredentialDetails,
                                                                      null);
     }
     catch (Exception ex)
     {
         Assert.AreEqual(ex.Message, "RemoteCertificateValidationCallback is a required property for TerminalApiLocal and cannot be null");
     }
 }
Exemple #3
0
 public void TestTerminalApiRequestEmptyResponse()
 {
     try
     {
         //encrypt the request using encryption credentials
         var paymentRequest = MockPosApiRequest.CreatePosPaymentRequest();
         //create a mock client
         var client             = CreateMockTestClientPosLocalApiRequest("");
         var posPaymentLocalApi = new PosPaymentLocalApi(client);
         var configEndpoint     = posPaymentLocalApi.Client.Config.Endpoint;
         var saleToPoiResponse  = posPaymentLocalApi.TerminalApiLocal(paymentRequest, _encryptionCredentialDetails,
                                                                      (sender, certificate, chain, errors) => { return(true); });
         Assert.IsNull(saleToPoiResponse);
     }
     catch (Exception)
     {
         Assert.Fail();
     }
 }
Exemple #4
0
 public void TestTerminalApiRequest()
 {
     try
     {
         //encrypt the request using encryption credentials
         var paymentRequest = MockPosApiRequest.CreatePosPaymentRequest();
         //create a mock client
         var client             = CreateMockTestClientPosLocalApiRequest("Mocks/terminalapi/pospayment-encrypted-success.json");
         var posPaymentLocalApi = new PosPaymentLocalApi(client);
         var configEndpoint     = posPaymentLocalApi.Client.Config.Endpoint;
         var saleToPoiResponse  = posPaymentLocalApi.TerminalApiLocal(paymentRequest, _encryptionCredentialDetails);
         Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/");
         Assert.IsNotNull(saleToPoiResponse);
     }
     catch (Exception)
     {
         Assert.Fail();
     }
 }