#tkkuytool-invoice-email

1 messages · Page 1 of 1 (latest)

bitter muskBOT
rustic temple
bronze wagon
#

First of all, I create a payment request with paymentintent (on my payment page), then I write the related transactions to the database if the transaction is successful at the callback endpoint. I also create an invoice with the following .net (c#) code.

         var customerOptions = new CustomerCreateOptions
         {
             Name = "TuÄŸberk",
             Email = "customer@mail.com",
             Address = new AddressOptions
             {
                 Line1 = "Istanbul",
                 City = "Istanbul",
                 PostalCode = "12345",
                 country = "US"
             },
          
         };


         var customerService = new CustomerService();
         var customer = customerService.Create(customerOptions);

         var invoiceService = new InvoiceService();
         var invoice = invoiceService.Create(new InvoiceCreateOptions
         {
             Customer = customer.Id,
             AutoAdvance = true, // Set to pay invoice automatically
             Description = "Test Invoice",
             Currency = "eur",
             CollectionMethod = "send_invoice",
             DaysUntilDue = 7,
            
         });

         var options = new InvoiceItemCreateOptions
         {
             Customer = customer.Id,
             PriceData = new InvoiceItemPriceDataOptions()
             {
                 Currency = "eur",
                 UnitAmount = 100,
                 product = "product_id_example"
             },
             Description = "test - Test",
             Invoice = invoice.Id
         };

         var service = new InvoiceItemService();
         service.Create(options);

         invoiceService.Pay(invoice.Id, new InvoicePayOptions()
         {
             PaidOutOfBand = true
         });
rustic temple
#

thanks, looking..

#

also, can you share an example invoice that wasn't sent to the customer?

timid garnet
#

tkkuytool-invoice-email