#elias-discount-invoice

1 messages · Page 1 of 1 (latest)

crude dragon
#

hello, are you a developer integrating Stripe with code?

round moon
#

yeah I am

#

am I in the right channel?

crude dragon
#

yes this is a developer channel

round moon
#

and I have an invoice and some lineitems added to it

crude dragon
round moon
#

Oh Ok thanks I can just add them as a line item but with a negative unit amount?

#

can I add discounts in as an InvoiceCreate Options?

#

Or can I add a negative invoice line item?

#

like an item with a negative price?

crude dragon
#

you need to create an InvoiceItem and add it to that Invoice

round moon
#

ok and the invoicitems price can be negative?

#

will that make it a discount?

crude dragon
#

yes

round moon
#

amazing thank you

#

one more thing

#

I want to use Stripe Tax

#

when I create my invoice how do i enable automatic tax?

#

Is there anything I have to do for the customer when I create it to enable automatic tax ? All I'm doing right now is creating a customer with an address

crude dragon
#

a colleague is stepping in and they can help you in a bit

round moon
#

ok

light pier
#

👋 give me a few minutes to catch up @round moon

light pier
round moon
#

I have yes

light pier
#

At the bottom it specifies how you would create an invoice and enable automatic tax

#

Basically, you just want to set automatic_tax[enabled]: true

round moon
#

yeah I see that It just tells me how to do it with curl

#

I dont know how to do it with .NET

#

Like I understand there is an AutomaticTax property on the invoice but I dont know how to set it

light pier
#

Just to check - which version of the Stripe dotnet library are you using?

round moon
#

39.80.0

light pier
#

Then you'd just do soethign like this:

var options = new InvoiceCreateOptions
{
  Customer = "cus_XXX",
  AutomaticTax = new InvoiceAutomaticTaxOptions 
  {
    Enabled = true,
  },
};
var service = new InvoiceService();
service.Create(options);
round moon
#

perfect thanks

#

when I submit the invoice

#

what can I do to check if it has been paid

#

this is what I'm doing right now

#

            if (res.Status != "paid")
            {
                return new Result<string>("PaymentFailed", "Your payment was not processed. Please enter a new card.");
            }```
light pier
#

Yeah that should work if you're using the API to manually attempt payment on an Invoice

round moon
#

yes I am

#

perfect thanks

round moon
#

will the output contain the amount of tax

#

that was charged automatically

light pier
#

Yes, it should be - let me check where it should be reflected