Exemplo n.º 1
0
 public SagaTest(DatabaseFixture fixture)
 {
     Context = fixture.DatabaseContext;
     Factory = new StubProviderApiFactory {
         OnPayment = dto => dto.Token.Equals(FailedToken) ? throw new Exception() : new OkObjectResult("OK"),
                           OnRollback = dto => new OkObjectResult("OK")
     };
     Saga = new MovementSaga {
         Factory = Factory, Context = Context
     };
 }
Exemplo n.º 2
0
 public PaymentController(AppDbContext context, IConfiguration configuration,
                          ProviderApiFactory providerApiFactory,
                          ClaimExtractorFactory extractorFactory) : base(extractorFactory)
 {
     Context            = context;
     Config             = configuration;
     AmountOfRetries    = int.Parse(Config["PaymentRetryAmount"]);
     ProviderApiFactory = providerApiFactory;
     Saga = new MovementSaga {
         Factory          = providerApiFactory, Context = context,
         ResponseEndpoint = Config["ResponseEndpoint"]
     };
     TransactionBuilder = new TransactionBuilder(context);
 }