Exemplo n.º 1
0
        private static InvoiceReceipt CreateInvoiceReceiptRequest(Customer customer, InvoiceRequest paymentRequest)
        {
            var paymentDate = paymentRequest.Payment.PaymentDate.ToString("yyyy-MM-dd");
            var invoice     = new InvoiceReceipt
            {
                Client = customer,

                Description = paymentRequest.Description,
                Remarks     = paymentRequest.Comments,
                Income      = paymentRequest.Items.Select(MapToIncomeItem).ToArray(),
                Attachment  = true,
                Payment     = new[]
                {
                    new CreditCardPaymentItem()
                    {
                        CardNum = paymentRequest.Payment.CardNum,
                        Date    = paymentDate,
                        Price   = paymentRequest.Payment.Amount
                    },
                }
            };

            return(invoice);
        }
Exemplo n.º 2
0
        private static Customer MapToCustomer(InvoiceRequest paymentRequest)
        {
            var requestCustomer = new Customer()
            {
                AccountingKey = paymentRequest.Account.Id.ToString(),
                Address       = paymentRequest.Tenant.Address,
                City          = paymentRequest.Tenant.City,
                Emails        = new[]
                {
                    paymentRequest.User.Email,
                    paymentRequest.Tenant.AdminEmail
                },
                Labels = new[] { "RedoxApp", "Azure" },
                Name   = paymentRequest.Account.Name,
                Phone  = paymentRequest.User.Phone,
                TaxId  = paymentRequest.Account.TaxId
            };

//#if DEBUG
//            requestCustomer.Emails = new[] { "*****@*****.**" };
//#endif

            return(requestCustomer);
        }