public async Task <IActionResult> Get()
        {
            GetPaymentMethodsQuery query = new GetPaymentMethodsQuery(User.GetUserId());
            var response = await _mediator.Send(query);

            return(Ok(response));
        }
        public async Task <IEnumerable <PaymentMethodDto> > Handle(GetPaymentMethodsQuery request, CancellationToken cancellationToken)
        {
            var customer = await _customersRepository.GetAsync(_identityProvider.GetUserId());

            return(_mapper.Map <IEnumerable <PaymentMethodDto> >(customer.PaymentMethods));
        }
Exemplo n.º 3
0
 public async Task <List <PaymentDto> > Handle(GetPaymentMethodsQuery request, CancellationToken cancellationToken)
 {
     return(await _context.PaymentMethods
            .Select(PaymentDto.Projection)
            .ToListAsync(cancellationToken));
 }
 protected override async Task <IImmutableList <GetPaymentMethodDto> > ExecuteAsync(GetPaymentMethodsQuery request, CancellationToken ct)
 {
     return(await _paymentMethodService.GetListByAccountIdAsync(request.AccountId, ct));
 }