You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: invoices_test.go
    path of file: ./repos/storj/satellite/payments/stripe
    
    the code of the file until where you have to start completion: // Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.

package stripe_test

import (
	"testing"
	"time"

	"github.com/stretchr/testify/require"
	"github.com/stripe/stripe-go/v75"

	"storj.io/common/currency"
	"storj.io/common/testcontext"
	"storj.io/common/testrand"
	"storj.io/storj/private/blockchain"
	"storj.io/storj/private/testplanet"
	"storj.io/storj/satellite/console"
	"storj.io/storj/satellite/payments/billing"
	stripe1 "storj.io/storj/satellite/payments/stripe"
)

func TestInvoices(t *testing.T) {
	testplanet.Run(t, testplanet.Config{
		SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1,
	}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
		satellite := planet.Satellites[0]
		userID := planet.Uplinks[0].Projects[0].Owner.ID
		price := int64(1000)
		desc := "test payment intent description"

		t.Run("Create with unknown user fails", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, testrand.UUID(), price, desc)
			require.Error(t, err)
			require.Nil(t, pi)
		})
		t.Run("Create returns error when underlying StripeInvoices.Create returns error", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, testrand.UUID(), price, stripe1.MockInvoicesNewFailure)
			require.Error(t, err)
			require.Nil(t, pi)
		})
		t.Run("Pay returns error with unknown invoice ID", func(t *testing.T) {
			confirmedPI, err := satellite.API.Payments.Accounts.Invoices().Pay(ctx, "unknown_id", "test_payment_method")
			require.Error(t, err)
			require.Nil(t, confirmedPI)
		})
		t.Run("Create and Pay success", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, userID, price, desc)
			require.NoError(t, err)
			require.NotNil(t, pi)

			confirmedPI, err := satellite.API.Payments.Accounts.Invoices().Pay(ctx, pi.ID, stripe1.MockInvoicesPaySuccess)
			require.NoError(t, err)
			require.Equal(t, pi.ID, confirmedPI.ID)
			require.Equal(t, string(stripe.InvoiceStatusPaid), confirmedPI.Status)
		})
		t.Run("Pay returns error when underlying StripeInvoices.Pay returns error", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, userID, price, desc)
			require.NoError(t, err
    
func TestInvoices(t *testing.T) {
	testplanet.Run(t, testplanet.Config{
		SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1,
	}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
		satellite := planet.Satellites[0]
		userID := planet.Uplinks[0].Projects[0].Owner.ID
		price := int64(1000)
		desc := "test payment intent description"

		t.Run("Create with unknown user fails", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, testrand.UUID(), price, desc)
			require.Error(t, err)
			require.Nil(t, pi)
		})
		t.Run("Create returns error when underlying StripeInvoices.Create returns error", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, testrand.UUID(), price, stripe1.MockInvoicesNewFailure)
			require.Error(t, err)
			require.Nil(t, pi)
		})
		t.Run("Pay returns error with unknown invoice ID", func(t *testing.T) {
			confirmedPI, err := satellite.API.Payments.Accounts.Invoices().Pay(ctx, "unknown_id", "test_payment_method")
			require.Error(t, err)
			require.Nil(t, confirmedPI)
		})
		t.Run("Create and Pay success", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, userID, price, desc)
			require.NoError(t, err)
			require.NotNil(t, pi)

			confirmedPI, err := satellite.API.Payments.Accounts.Invoices().Pay(ctx, pi.ID, stripe1.MockInvoicesPaySuccess)
			require.NoError(t, err)
			require.Equal(t, pi.ID, confirmedPI.ID)
			require.Equal(t, string(stripe.InvoiceStatusPaid), confirmedPI.Status)
		})
		t.Run("Pay returns error when underlying StripeInvoices.Pay returns error", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, userID, price, desc)
			require.NoError(t, err)
			require.NotNil(t, pi)

			confirmedPI, err := satellite.API.Payments.Accounts.Invoices().Pay(ctx, pi.ID, stripe1.MockInvoicesPayFailure)
			require.Error(t, err)
			require.Nil(t, confirmedPI)
		})
		t.Run("Create and Get success", func(t *testing.T) {
			pi, err := satellite.API.Payments.Accounts.Invoices().Create(ctx, userID, price, desc)
			require.NoError(t, err)
			require.NotNil(t, pi)

			pi2, err := satellite.API.Payments.Accounts.Invoices().Get(ctx, pi.ID)
			require.NoError(t, err)
			require.Equal(t, pi.ID, pi2.ID)
			require.Equal(t, pi.Status, pi2.Status)
			require.Equal(t, pi.Amount, pi2.Amount)
		})
	})
}