Documentation
¶
Overview ¶
Package payment provides per-org payment processor configuration.
The payment/processor registry holds global singleton processors registered at init() time. These singletons are NOT safe for multi-tenant use because credentials would be shared across orgs.
ProcessorsForOrg creates a FRESH registry with per-org processor instances, each configured with credentials from the KMS-hydrated Organization model. Call kms.Hydrate(cc, org) before calling ProcessorsForOrg.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessorsForOrg ¶
func ProcessorsForOrg(org *organization.Organization) *processor.Registry
ProcessorsForOrg returns a processor registry configured with the given organization's payment credentials. Each processor is a fresh instance — no shared state with other orgs or the global singleton registry.
Processors without credentials in the org are still registered but marked as unavailable (IsAvailable returns false).
Types ¶
type SquarePublic ¶
type SquarePublic struct {
ApplicationID string `json:"applicationId"`
LocationID string `json:"locationId"`
Environment string `json:"environment"` // "sandbox" | "production"
Live bool `json:"live"`
}
SquarePublic is the PUBLIC Square Web Payments config the browser needs to tokenize a card for an org: the application id + location id + environment. Every field is public (Square exposes them to the client SDK) — no secret, no access token, no webhook key.
func SquarePublicConfig ¶
func SquarePublicConfig(org *organization.Organization) SquarePublic
SquarePublicConfig resolves the PUBLIC Square config for an org through the SINGLE test-mode authority (org.TestMode / SQUARE_ENVIRONMENT) and the same KMS-then-env fallback the charge path uses, so the app id the browser tokenizes with always matches the environment + access token commerce will vault/charge with.
This is the ONE place that resolution lives: both the authenticated /v1/billing/payment-config handler and the public host→org tenant projection (/v1/commerce/tenant) call it, so a card form and its charge can never drift onto different Square applications.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package providers is a convenience package that imports all payment provider packages, ensuring they are available for the processor registry.
|
Package providers is a convenience package that imports all payment provider packages, ensuring they are available for the processor registry. |
|
bitpay
Package bitpay implements the BitPay payment processor for Commerce.
|
Package bitpay implements the BitPay payment processor for Commerce. |
|
circle
Package circle implements the Circle Payments API processor for Commerce.
|
Package circle implements the Circle Payments API processor for Commerce. |
|
coinbase_commerce
Package coinbase_commerce implements the Coinbase Commerce payment processor for Commerce.
|
Package coinbase_commerce implements the Coinbase Commerce payment processor for Commerce. |
|
moonpay
Package moonpay implements the MoonPay on-ramp processor for Commerce.
|
Package moonpay implements the MoonPay on-ramp processor for Commerce. |
|
opennode
Package opennode implements the OpenNode (Lightning) payment processor for Commerce.
|
Package opennode implements the OpenNode (Lightning) payment processor for Commerce. |
|
solanapay
Package solanapay implements the Solana Pay payment processor for Commerce.
|
Package solanapay implements the Solana Pay payment processor for Commerce. |
|
square
Package square is the unified Square payment provider.
|
Package square is the unified Square payment provider. |
|
stripe
Package stripe — catalog (Products and Prices) helpers used by the plan seeder.
|
Package stripe — catalog (Products and Prices) helpers used by the plan seeder. |
|
Package router provides an intelligent multi-processor payment routing layer.
|
Package router provides an intelligent multi-processor payment routing layer. |
|
Package x402 implements the x402 Payment Protocol (LP-3028) for HTTP-native crypto payments using the 402 Payment Required status code.
|
Package x402 implements the x402 Payment Protocol (LP-3028) for HTTP-native crypto payments using the 402 Payment Required status code. |