billing

package
v1.0.0-beta.206 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinimalCreateProfileInputTemplate = billing.CreateProfileInput{
	Name:    "Awesome Profile",
	Default: true,

	WorkflowConfig: billing.WorkflowConfig{
		Collection: billing.CollectionConfig{
			Alignment: billing.AlignmentKindSubscription,
			Interval:  lo.Must(isodate.String("PT2H").Parse()),
		},
		Invoicing: billing.InvoicingConfig{
			AutoAdvance: true,
			DraftPeriod: lo.Must(isodate.String("P1D").Parse()),
			DueAfter:    lo.Must(isodate.String("P1W").Parse()),
		},
		Payment: billing.PaymentConfig{
			CollectionMethod: billing.CollectionMethodChargeAutomatically,
		},
	},

	Supplier: billing.SupplierContact{
		Name: "Awesome Supplier",
		Address: models.Address{
			Country: lo.ToPtr(models.CountryCode("US")),
		},
	},

	Apps: billing.CreateProfileAppsInput{
		Invoicing: billing.AppReference{
			Type: app.AppTypeSandbox,
		},
		Payment: billing.AppReference{
			Type: app.AppTypeSandbox,
		},
		Tax: billing.AppReference{
			Type: app.AppTypeSandbox,
		},
	},
}

Functions

This section is empty.

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite
	*require.Assertions

	TestDB   *testutils.TestDB
	DBClient *db.Client

	BillingAdapter    billing.Adapter
	BillingService    billing.Service
	InvoiceCalculator *invoicecalc.MockableInvoiceCalculator

	FeatureService         feature.FeatureConnector
	FeatureRepo            feature.FeatureRepo
	MeterAdapter           *meteradapter.TestAdapter
	MockStreamingConnector *streamingtestutils.MockStreamingConnector

	CustomerService customer.Service

	AppService app.Service
	SandboxApp *appsandbox.MockableFactory
}

func (*BaseSuite) CreateTestCustomer

func (s *BaseSuite) CreateTestCustomer(ns string, subjectKey string) *customer.Customer

func (*BaseSuite) DebugDumpInvoice

func (s *BaseSuite) DebugDumpInvoice(h string, i billing.Invoice)

func (*BaseSuite) GetSubscriptionMixInDependencies

func (b *BaseSuite) GetSubscriptionMixInDependencies() SubscriptionMixInDependencies

func (*BaseSuite) GetUniqueNamespace

func (s *BaseSuite) GetUniqueNamespace(prefix string) string

GetUniqueNamespace returns a unique namespace with the given prefix

func (*BaseSuite) InstallSandboxApp

func (s *BaseSuite) InstallSandboxApp(t *testing.T, ns string) app.App

func (*BaseSuite) SetupSuite

func (s *BaseSuite) SetupSuite()

func (*BaseSuite) TearDownSuite

func (s *BaseSuite) TearDownSuite()

type SubscriptionMixInDependencies

type SubscriptionMixInDependencies struct {
	DBClient *db.Client

	FeatureRepo     feature.FeatureRepo
	FeatureService  feature.FeatureConnector
	CustomerService customer.Service

	MeterAdapter           *meteradapter.TestAdapter
	MockStreamingConnector *streamingtestutils.MockStreamingConnector
}

func (SubscriptionMixInDependencies) Validate

func (d SubscriptionMixInDependencies) Validate() error

type SubscriptionMixin

type SubscriptionMixin struct {
	PlanService                 plan.Service
	SubscriptionService         subscription.Service
	SubscriptionPlanAdapter     subscriptiontestutils.PlanSubscriptionAdapter
	SubscriptionWorkflowService subscriptionworkflow.Service
}

func (*SubscriptionMixin) SetupEntitlements

func (*SubscriptionMixin) SetupSuite

func (s *SubscriptionMixin) SetupSuite(t *testing.T, deps SubscriptionMixInDependencies)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL