Ejemplo n.º 1
0
 public void UpdatePrices(PaymentProcessedPayload buy)
 {
     using (var scope = Services.CreateScope())
     {
         var hubContext = scope.ServiceProvider.GetRequiredService <IHubContext <BrokerHub> >();
         hubContext.Clients.Group(buy.BuyId).SendAsync("UpdatePrice", buy);
     }
 }
Ejemplo n.º 2
0
        public PaymentProcessedPayload ProcessPayment(double amount, string buyId, CardPayload card)
        {
            Thread.Sleep(5000); // faz de conta que esse é o tempo de processar a transação em um gateway de pagamento
            var result = new PaymentProcessedPayload
            {
                BuyId  = buyId,
                Amount = amount,
                Payd   = PaymentAccepted()
            };

            return(result);
        }