stripesync

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package stripesync reconciles OpenMRP customers with their counterparts in a merchant's connected Stripe account.

Every operation is idempotent on replay: the link lives on the account relation, so a redelivered message updates the existing Stripe customer rather than creating a second one.

Checkout deliberately does not route through here. It resolves-or-creates the same link inline because it cannot wait for the queue and, unlike this path, always has a recipient email in hand — so it creates a Stripe customer for a customer record with no email of its own, where this path correctly no-ops. Both write the link the same way, so whichever runs first wins and the other finds it already there.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// SyncCustomer creates the customer's Stripe counterpart on first sync, or pushes a changed email/name/number onto the existing one. It is a no-op (returns nil) when the account has no active Stripe integration, and when an unlinked customer has no email to create one with.
	SyncCustomer(ctx context.Context, ownerAccountID, customerAccountID string) *apierror.APIError
}

Service syncs OpenMRP customers to a connected Stripe account.

func NewService

func NewService(repos domain.RepoFactory, clientFactory domain.StripeCheckoutClientFactory, encryptionKey []byte) Service

Jump to

Keyboard shortcuts

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