@@ -301,24 +301,6 @@ func (s *StripeInvoiceTestSuite) TestComplexInvoice() {
301301 Customer : customerEntity .GetID (),
302302 Currency : currencyx .Code (currency .USD ),
303303 Lines : []* billing.Line {
304- {
305- // Covered case: standalone flat line
306- LineBase : billing.LineBase {
307- ManagedResource : models .NewManagedResource (models.ManagedResourceInput {
308- Name : "Fee" ,
309- }),
310- Period : billing.Period {Start : periodStart , End : periodEnd },
311- InvoiceAt : periodEnd ,
312- ManagedBy : billing .ManuallyManagedLine ,
313- Type : billing .InvoiceLineTypeFee ,
314- },
315- FlatFee : & billing.FlatFeeLine {
316- PerUnitAmount : alpacadecimal .NewFromFloat (100 ),
317- PaymentTerm : productcatalog .InArrearsPaymentTerm ,
318- Quantity : alpacadecimal .NewFromFloat (1 ),
319- Category : billing .FlatFeeCategoryRegular ,
320- },
321- },
322304 {
323305 // Covered case: Discount caused by maximum amount
324306 LineBase : billing.LineBase {
@@ -459,7 +441,7 @@ func (s *StripeInvoiceTestSuite) TestComplexInvoice() {
459441 },
460442 )
461443 s .NoError (err )
462- s .Len (pendingLines .Lines , 6 )
444+ s .Len (pendingLines .Lines , 5 )
463445 })
464446
465447 clock .FreezeTime (periodEnd .Add (time .Minute ))
@@ -572,19 +554,6 @@ func (s *StripeInvoiceTestSuite) TestComplexInvoice() {
572554 }
573555
574556 expectedInvoiceAddLines := []* stripe.InvoiceItemParams {
575- {
576- Amount : lo .ToPtr (int64 (10000 )),
577- Description : lo .ToPtr ("Fee" ),
578- Customer : lo .ToPtr (customerData .StripeCustomerID ),
579- Period : & stripe.InvoiceItemPeriodParams {
580- Start : lo .ToPtr (expectedPeriodStartUnix ),
581- End : lo .ToPtr (expectedPeriodEndUnix ),
582- },
583- Metadata : map [string ]string {
584- "om_line_id" : getLineID ("Fee" ),
585- "om_line_type" : "line" ,
586- },
587- },
588557 {
589558 Amount : lo .ToPtr (int64 (7725 )),
590559 Description : lo .ToPtr ("UBP - AI Usecase: usage in period (103,000,025 x $0.000001)" ),
@@ -780,7 +749,7 @@ func (s *StripeInvoiceTestSuite) TestComplexInvoice() {
780749 s .NoError (err )
781750
782751 // Remove a line item.
783- lineToRemove := getLine ("Fee " )
752+ lineToRemove := getLine ("UBP - FLAT per any usage " )
784753 s .NotNil (lineToRemove , "line ID to remove is not found" )
785754
786755 // Find the stripe line ID to remove.
@@ -796,7 +765,7 @@ func (s *StripeInvoiceTestSuite) TestComplexInvoice() {
796765
797766 s .NotEmpty (stripeLineIDToRemove , "stripe line ID to remove is empty" )
798767
799- ok = updateInvoice .Lines .RemoveByID (lineToRemove .ID )
768+ ok = updateInvoice .Lines .RemoveByID (* lineToRemove .ParentLineID )
800769 s .True (ok , "failed to remove line item" )
801770
802771 // To simulate the update, we will update the external ID of the invoice.
0 commit comments