Exemplo n.º 1
0
        internal Task <T> PostIdentification <T>(IIdentification identification, Uri uri)
        {
            var messageAction = new IdentificationAction(identification);
            var httpContent   = messageAction.Content(identification);

            return(_requestHelper.Post <T>(httpContent, messageAction.RequestContent, uri));
        }
            public void ReturnsCorrectDataForIdentification()
            {
                //Arrange
                var identification = new Identification(new RecipientById(IdentificationType.PersonalIdentificationNumber, "00000000000"));

                //Act
                var action  = new IdentificationAction(identification);
                var content = action.RequestContent;

                //Assert
                var identificationDto = DataTransferObjectConverter.ToDataTransferObject(identification);
                var expected          = SerializeUtil.Serialize(identificationDto);

                Assert.Equal(expected, content.InnerXml);
            }
        private void ValidateData(IdentificationDocumentSettingsData data, IdentificationAction action)
        {
            var settings = _repository.IdentificationDocumentSettings.AsQueryable();

            if (action == IdentificationAction.Update)
            {
                settings = settings.Where(o => o.Id != data.Id);
            }

            if (settings.Any(
                    record =>
                    record.BrandId == data.BrandId &&
                    record.PaymentGatewayBankAccountId == data.PaymentGatewayBankAccountId &&
                    record.TransactionType == data.TransactionType))
            {
                throw new RegoException(
                          "You have already set up Identification Document Setting with the selected Brand, Payment Method and Transaction Type. Please, update the existing one or change your form data.");
            }
        }