accountintegrationep

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountIntegrationSvcConfig

type AccountIntegrationSvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type CreateAccountIntegrationEndpoint

type CreateAccountIntegrationEndpoint struct{}

Connects a third-party provider to the account, or replaces the name and credentials of the provider's existing connection.

An account can have at most one integration per `provider`, so calling this again for a provider that is already connected rotates its credentials in place and returns the same integration rather than creating a second one. Credentials are checked for the provider's expected key format, encrypted at rest, and never returned in API responses.

type CreateAccountIntegrationRequest

type CreateAccountIntegrationRequest struct {
	// Display name of the integration.
	Name string `json:"name" validate:"required,max=255"`
	// Integration provider code.
	//
	// - `stripe`: Stripe payment processing.
	// - `shippo`: Shippo shipping and label generation.
	// - `hubspot`: HubSpot CRM.
	IntegrationCode constants.IntegrationCode `json:"provider" validate:"required"`
	// JSON string containing the provider's credentials.
	//
	// Required keys depend on the provider:
	//
	// - `stripe`: `private_key` (`sk_...`), `publishable_key` (`pk_...`), and `webhook_secret` (`whsec_...`).
	// - `shippo`: `api_key` (`shippo_live_...` or `shippo_test_...`).
	// - `hubspot`: `access_token` (`pat-...`).
	//
	// For Stripe and Shippo, sandbox accounts must supply test keys and production accounts must supply live keys; credentials that do not match are rejected. HubSpot tokens make no such distinction.
	Credentials string `json:"credentials" validate:"required" sensitive:"true"`
}

Request to create or upsert an account integration.

func (*CreateAccountIntegrationRequest) SchemaExample

func (*CreateAccountIntegrationRequest) SchemaExample() any

type DeleteAccountIntegrationEndpoint

type DeleteAccountIntegrationEndpoint struct{}

Disconnects a third-party provider from the account and returns the deleted integration.

The stored credentials go with it, so any feature that relies on the provider stops working until the integration is created again. Deleting an integration that is already deleted returns an error rather than succeeding silently. To pause a provider without discarding its credentials, set the integration's status to `inactive` instead.

type DeleteAccountIntegrationRequest

type DeleteAccountIntegrationRequest struct {
	// Account integration ID.
	AccountIntegrationID string `path:"id" validate:"required"`
}

Request to delete an account integration.

type GetStripePublishableKeyEndpoint

type GetStripePublishableKeyEndpoint struct{}

Returns the Stripe publishable key for the target account, for initializing Stripe in a client-side checkout.

Only the publishable key is exposed; the account's secret key and webhook secret never leave the platform. Fails if the account has no Stripe integration or the Stripe integration is inactive.

type GetStripePublishableKeyRequest

type GetStripePublishableKeyRequest struct{}

Request to retrieve the Stripe publishable key.

type GetStripeStatusEndpoint

type GetStripeStatusEndpoint struct{}

Reports whether the target account has a Stripe integration configured, so a checkout flow can tell up front whether card payments are available.

The account is reported as connected whenever Stripe credentials are on file, even if the integration has been deactivated, and the stored keys are not verified against Stripe.

func (*GetStripeStatusEndpoint) Materialize

type GetStripeStatusRequest

type GetStripeStatusRequest struct{}

Request to check Stripe integration status.

type ListAccountIntegrationsEndpoint

type ListAccountIntegrationsEndpoint struct{}

Returns a paginated list of the third-party providers connected to the target account.

Stored credentials are never included in the response.

type ListAccountIntegrationsRequest

type ListAccountIntegrationsRequest struct {
	apiresource.PaginationRequest
}

Request to list account integrations.

type UpdateAccountIntegrationEndpoint

type UpdateAccountIntegrationEndpoint struct{}

Renames an account integration, or activates or deactivates it.

Omitted fields are left unchanged. Credentials cannot be changed here; to rotate them, call Create Account Integration again with the same `provider`.

type UpdateAccountIntegrationRequest

type UpdateAccountIntegrationRequest struct {
	// Account integration ID.
	AccountIntegrationID string `path:"id" validate:"required"`
	// Display name of the integration.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Lifecycle status of the integration.
	//
	// Set to `inactive` to stop the provider being used while keeping its stored credentials, and back to `active` to resume without re-entering them.
	Status field.Optional[constants.AccountIntegrationStatus] `json:"status,omitzero"`
}

Request to update an account integration.

func (*UpdateAccountIntegrationRequest) SchemaExample

func (*UpdateAccountIntegrationRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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