diff --git a/satellite/payments/stripe/service.go b/satellite/payments/stripe/service.go index d8f430d17..8c64a0677 100644 --- a/satellite/payments/stripe/service.go +++ b/satellite/payments/stripe/service.go @@ -828,9 +828,9 @@ func (service *Service) CreateBalanceInvoiceItems(ctx context.Context) (err erro return errGrp.Err() } -// GenerateInvoices performs all tasks necessary to generate Stripe invoices. -// This is equivalent to invoking ApplyFreeTierCoupons, PrepareInvoiceProjectRecords, -// InvoiceApplyProjectRecords, and CreateInvoices in order. +// GenerateInvoices performs tasks necessary to generate Stripe invoices. +// This is equivalent to invoking PrepareInvoiceProjectRecords, InvoiceApplyProjectRecords, +// and CreateInvoices in order. func (service *Service) GenerateInvoices(ctx context.Context, period time.Time) (err error) { defer mon.Task()(&ctx)(&err) @@ -838,9 +838,6 @@ func (service *Service) GenerateInvoices(ctx context.Context, period time.Time) Description string Exec func(context.Context, time.Time) error }{ - {"Applying free tier coupons", func(ctx context.Context, _ time.Time) error { - return service.ApplyFreeTierCoupons(ctx) - }}, {"Preparing invoice project records", service.PrepareInvoiceProjectRecords}, {"Applying invoice project records", service.InvoiceApplyProjectRecords}, {"Creating invoices", service.CreateInvoices}, diff --git a/satellite/payments/stripe/service_test.go b/satellite/payments/stripe/service_test.go index 06ea1f0f7..7d2fc1f9a 100644 --- a/satellite/payments/stripe/service_test.go +++ b/satellite/payments/stripe/service_test.go @@ -520,17 +520,6 @@ func TestService_GenerateInvoice(t *testing.T) { require.NoError(t, payments.StripeService.GenerateInvoices(ctx, start)) - // ensure free tier coupon was applied - cusID, err := satellite.DB.StripeCoinPayments().Customers().GetCustomerID(ctx, user.ID) - require.NoError(t, err) - - params := &stripe.CustomerParams{Params: stripe.Params{Context: ctx}} - stripeUser, err := payments.StripeClient.Customers().Get(cusID, params) - require.NoError(t, err) - require.NotNil(t, stripeUser.Discount) - require.NotNil(t, stripeUser.Discount.Coupon) - require.Equal(t, payments.StripeService.StripeFreeTierCouponID, stripeUser.Discount.Coupon.ID) - // ensure project record was generated err = satellite.DB.StripeCoinPayments().ProjectRecords().Check(ctx, proj.ID, start, end) require.ErrorIs(t, stripe1.ErrProjectRecordExists, err) @@ -539,6 +528,9 @@ func TestService_GenerateInvoice(t *testing.T) { require.NotNil(t, rec) require.NoError(t, err) + // validate generated invoices + cusID, err := satellite.DB.StripeCoinPayments().Customers().GetCustomerID(ctx, user.ID) + require.NoError(t, err) invoice, hasInvoice := getCustomerInvoice(ctx, payments.StripeClient, cusID) invoiceItems := getCustomerInvoiceItems(ctx, payments.StripeClient, cusID)