Ejemplo n.º 1
0
        public void TestTerminalAPiPosEncryption()
        {
            //dummy header
            var messageHeader = MockNexoMessageHeaderRequest();
            //dummy json message
            var saleToPoiRequest        = MockPosApiRequest.MockNexoJsonRequest();
            var saleToPoiMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequest, messageHeader, _encryptionCredentialDetails);

            Assert.IsNotNull(saleToPoiMessageSecured);
        }
 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");
     }
 }
 public void Init()
 {
     //Create a mock pos payment request
     _paymentRequest = MockPosApiRequest.CreatePosPaymentRequest();
 }