示例#1
0
        public async Task <string> CreateInvoiceAsync(CreateInvoiceDto model)
        {
            var invoice = model.MapToInvoice();

            var faker = new Faker();

            invoice.CreationDate    = DateTime.Now;
            invoice.ExternalOrderId = faker.Commerce.Ean13();
            invoice.PaymentFormUrl  = faker.Internet.Url();

            await _context.AddAsync(invoice);

            await _context.SaveChangesAsync();

            return(invoice.PaymentFormUrl);
        }
示例#2
0
        public async Task <Orders> AddOrder(Orders order)
        {
            var result = await _paymentContext.AddAsync(order);

            return(result.Entity);
        }