#mjezewski22

1 messages ยท Page 1 of 1 (latest)

coral shellBOT
onyx copper
#

Hello! If you pass in the existing coupon/discount does it work as expected?

honest geyser
#

when passing via the coupon parameter I have the same behavior. I have not yet tried with the discounts parameter although I can if it's useful

onyx copper
#

Yeah, give that a try and see if that works as expected.

honest geyser
#

I receive the same behavior using the discounts param (I tried both options of passing in the coupon id and the discount id)

coral shellBOT
onyx copper
#

Can you provide the output you're seeing?

honest geyser
#
  id: nil,
  due_on: ~U[2024-07-05 23:07:18Z],
  amount: Decimal.new("3966.03"),
  paid_on: nil,
  status: :draft,
  url: nil,
  logo_urls: ["/images/deploy_and_inventory.svg"],
  line_items: [
    %Portal.Billing.Invoice.LineItem{
      id: nil,
      amount: Decimal.new("-1197.3"),
      amount_excluding_tax: Decimal.new("-1197.3"),
      quantity: 1,
      period: %Portal.Billing.Invoice.LineItem.Period{
        id: nil,
        start: ~U[2023-07-06 18:52:26Z],
        end: ~U[2024-07-05 23:07:18Z]
      },
      tax_amounts: [
        %Portal.Billing.Invoice.LineItem.TaxAmount{
          id: nil,
          amount: Decimal.new("-122.72")
        }
      ]
    },
    %Portal.Billing.Invoice.LineItem{
      id: nil,
      amount: Decimal.new("2394.6"),
      amount_excluding_tax: Decimal.new("2394.6"),
      quantity: 2,
      period: %Portal.Billing.Invoice.LineItem.Period{
        id: nil,
        start: ~U[2023-07-06 18:52:26Z],
        end: ~U[2024-07-05 23:07:18Z]
      },
      tax_amounts: [
        %Portal.Billing.Invoice.LineItem.TaxAmount{
          id: nil,
          amount: Decimal.new("245.45")
        }
      ]
    },
    %Portal.Billing.Invoice.LineItem{
      id: nil,
      amount: Decimal.new("3000"),
      amount_excluding_tax: Decimal.new("3000"),
      quantity: 2,
      period: %Portal.Billing.Invoice.LineItem.Period{
        id: nil,
        start: ~U[2024-07-05 23:07:18Z],
        end: ~U[2025-07-05 23:07:18Z]
      },
      tax_amounts: [
        %Portal.Billing.Invoice.LineItem.TaxAmount{
          id: nil,
          amount: Decimal.new("246")
        }
      ]
    }
  ]
}```
#

I hope elixir syntax is ok!

#

basically, the first 2 line items (for the current period) are about the prorated amounts I'd expect (including discount). but the last one does not seem to be taking the discount into consideration (2 items at a price of 1500, minus the 20% coupon I'd expect to see ~ $2400)

dreamy charm
#

hey there, stepping in for Rubeus here

#

And what's the request you're making to get this result?

honest geyser
dreamy charm
#

What is the subscript id in this case?

#

I want to look at the current discount

honest geyser
#

sure, it is sub_1NQen4KVm4WHjNVwzpE7XCk9

dreamy charm
#

Hmm that does seem unexpected

#

Trying to repro this myself

coral shellBOT
dreamy charm
#

Ok so I'm seeing the same thing and want to report this so we can dig in. Would you be able to write in to support with this example subscription and request/response?
https://support.stripe.com/contact/email

#

If you let me know when you've done that I can go and find it to escalate

#

Hold on! I just noticed that this might be reflected in the final total of the upcoming invoice, after taking into account the discounted_amounts (subtracted from the subtotal)

#

This was truncated from the data you shared so i can't check it, but if you want to dump the full object/responses we can inspect that too

honest geyser
#

sure, here is the complete response:

#

ah discord is truncating the response

coral shellBOT
honest geyser
hexed lava
#

Gotcha, so not reflected in the final total unfortunately. Would you be able to write in to our support team if you have not already? We can grab your email and report this behavior for a fix

honest geyser
#

I haven't written the report yet but will do so now, my email is megan.jezewski@pdq.com, I'll post here once I've submitted as well!

hexed lava
#

Also huh that is interesting, the taxable amount is indeed listed as 240000 and we do list out the discounts.

honest geyser
#

Yes, it seems like the logic is aware of the discounts just not for the 3rd line item for some reason. Also apologies, I had attached the wrong file for the complete payload, here is the entire thing if it's of interest.

#

And I've just filed that bug report, apologies for the delay.

#

Thanks for all the help here though!

fathom forge
#

I want to confirm we have received it and will be looking into this