INNER CODE UNIT · Go

addModuleInteractive

theopenlane/core · cmd/catalog/main.go:576

func addModuleInteractive(ctx context.Context, catalogFile, apiKey, orgID string) error {
	cat, err := catalog.LoadCatalog(catalogFile)
	if err != nil {
		return fmt.Errorf("load catalog: %w", err)
	}

	sc, err := newClient(entitlements.WithAPIKey(apiKey))
	if err != nil {
		return fmt.Errorf("stripe client: %w", err)
	}

	customer, subscription, err := findCustomerAndSubscription(ctx, sc, orgID)
	if err != nil {
		return fmt.Errorf("find customer and subscription: %w", err)
	}

	if customer == nil {
		return fmt.Errorf("%w: %s", ErrNoCustomerFound, orgID)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…