integration

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory manages different payment integration providers and storage providers

func NewFactory

func NewFactory(
	config *config.Configuration,
	logger *logger.Logger,
	connectionRepo connection.Repository,
	customerRepo customer.Repository,
	subscriptionRepo subscription.Repository,
	invoiceRepo invoice.Repository,
	paymentRepo payment.Repository,
	priceRepo price.Repository,
	entityIntegrationMappingRepo entityintegrationmapping.Repository,
	encryptionService security.EncryptionService,
) *Factory

NewFactory creates a new integration factory

func (*Factory) GetAvailableProviders

func (f *Factory) GetAvailableProviders(ctx context.Context) ([]IntegrationProvider, error)

GetAvailableProviders returns all available providers for the current environment

func (*Factory) GetHubSpotIntegration added in v1.0.34

func (f *Factory) GetHubSpotIntegration(ctx context.Context) (*HubSpotIntegration, error)

GetHubSpotIntegration returns a complete HubSpot integration setup

func (*Factory) GetIntegrationByProvider

func (f *Factory) GetIntegrationByProvider(ctx context.Context, providerType types.SecretProvider) (interface{}, error)

GetIntegrationByProvider returns the appropriate integration for the given provider type

func (*Factory) GetS3Client added in v1.0.32

func (f *Factory) GetS3Client(ctx context.Context) (*s3.Client, error)

GetS3Client returns the S3 client directly (for backward compatibility) Deprecated: Use GetStorageProvider instead for future-proof code

func (*Factory) GetStorageProvider added in v1.0.32

func (f *Factory) GetStorageProvider(ctx context.Context, connectionID string) (*s3.Client, error)

GetStorageProvider returns an S3 storage client for the given connection Currently only S3 is supported. In the future, Azure Blob Storage, Google Cloud Storage, and other providers can be added by checking the connection's provider type.

func (*Factory) GetStripeIntegration

func (f *Factory) GetStripeIntegration(ctx context.Context) (*StripeIntegration, error)

GetStripeIntegration returns a complete Stripe integration setup

func (*Factory) GetSupportedProviders

func (f *Factory) GetSupportedProviders() []types.SecretProvider

GetSupportedProviders returns all supported integration provider types

func (*Factory) HasProvider

func (f *Factory) HasProvider(providerType types.SecretProvider) bool

HasProvider checks if a provider is supported

type HubSpotIntegration added in v1.0.34

type HubSpotIntegration struct {
	Client         hubspot.HubSpotClient
	CustomerSvc    hubspot.HubSpotCustomerService
	InvoiceSyncSvc *hubspot.InvoiceSyncService
	DealSyncSvc    *hubspot.DealSyncService
	WebhookHandler *hubspotwebhook.Handler
}

HubSpotIntegration contains all HubSpot integration services

type HubSpotProvider added in v1.0.34

type HubSpotProvider struct {
	// contains filtered or unexported fields
}

HubSpotProvider implements IntegrationProvider for HubSpot

func (*HubSpotProvider) GetProviderType added in v1.0.34

func (p *HubSpotProvider) GetProviderType() types.SecretProvider

GetProviderType returns the provider type

func (*HubSpotProvider) IsAvailable added in v1.0.34

func (p *HubSpotProvider) IsAvailable(ctx context.Context) bool

IsAvailable checks if HubSpot integration is available

type IntegrationProvider

type IntegrationProvider interface {
	GetProviderType() types.SecretProvider
	IsAvailable(ctx context.Context) bool
}

IntegrationProvider defines the interface for all integration providers

type StripeIntegration

type StripeIntegration struct {
	Client         *stripe.Client
	CustomerSvc    *stripe.CustomerService
	PaymentSvc     *stripe.PaymentService
	InvoiceSyncSvc *stripe.InvoiceSyncService
	WebhookHandler *webhook.Handler
}

StripeIntegration contains all Stripe integration services

type StripeProvider

type StripeProvider struct {
	// contains filtered or unexported fields
}

StripeProvider implements IntegrationProvider for Stripe

func (*StripeProvider) GetProviderType

func (p *StripeProvider) GetProviderType() types.SecretProvider

GetProviderType returns the provider type

func (*StripeProvider) IsAvailable

func (p *StripeProvider) IsAvailable(ctx context.Context) bool

IsAvailable checks if Stripe integration is available

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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