Exemplo n.º 1
0
 private EFilingRequest()
 {
     _externalServicesHandler = new EFilingExternalServicesInteractor(this);
     _documentationHandler    = new DocumentationHandler(this);
     _statusHandler           = new RequestStatusHandler(this, _externalServicesHandler);
     _paymentOrderHandler     = new PaymentOrderHandler(this, _externalServicesHandler);
     _requestSigner           = new RequestSigner(this, _statusHandler);
 }
Exemplo n.º 2
0
        internal async Task Synchronize(EFilingExternalServicesInteractor handler)
        {
            var paymentOrderDTO = await handler.TryGetPaymentOrder();

            if (paymentOrderDTO != null)
            {
                this.LoadFromDTO(paymentOrderDTO);
            }
        }
        internal RequestStatusHandler(EFilingRequest request,
                                      EFilingExternalServicesInteractor externalServices)
        {
            Assertion.AssertObject(request, "request");
            Assertion.AssertObject(externalServices, "externalServices");

            _request          = request;
            _externalServices = externalServices;
        }
Exemplo n.º 4
0
        private async Task ChangeTransactionStatus(string filingRequestUID, string eventName)
        {
            var filingRequest = EFilingRequest.TryParse(filingRequestUID);

            Assertion.AssertObject(filingRequest, $"Invalid filing request with UID {filingRequestUID}.");

            var interactor = new EFilingExternalServicesInteractor(filingRequest);

            interactor.InformEventProcessed(filingRequest.Transaction.UID, eventName);

            RequestStatus newStatus = GetNewStatusAfterEvent(eventName);

            await filingRequest.UpdateStatus(newStatus);

            filingRequest.Save();
        }
Exemplo n.º 5
0
        internal async Task Synchronize(EFilingExternalServicesInteractor servicesHandler)
        {
            IFilingTransaction updatedData;

            if (servicesHandler.FilingRequest.Status == RequestStatus.OnPayment)
            {
                updatedData = await servicesHandler.UpdateExternalTransaction();
            }
            else
            {
                updatedData = await servicesHandler.GetTransaction();
            }

            this.Update(updatedData);

            var documents = await servicesHandler.GetOutputDocuments();

            this.OutputDocuments = documents;
        }