Documentation
¶
Overview ¶
Package creem is the Creem payment provider adapter. Every checkout uses one Creem product with a custom price that the server computes. Webhooks are verified with the HMAC-SHA256 signature Creem sends in the creem-signature header.
Index ¶
Constants ¶
const DefaultCheckoutOrigin = "https://www.creem.io"
DefaultCheckoutOrigin is where Creem hosts live checkout pages unless the store uses its own domain.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// APIKey is a Creem API key. A key starting with creem_test_ uses Creem's test API.
APIKey string
// WebhookSecret verifies webhook signatures.
WebhookSecret string
// ProductID is the one-time product every checkout uses, with a custom price.
ProductID string
// CheckoutOrigin is where live checkout pages are hosted. Zero means
// DefaultCheckoutOrigin; set it when the store uses a custom domain. A test key's
// checkouts are always on Creem's own domain.
CheckoutOrigin string
// APIURL overrides the API base URL. Zero picks Creem's live or test API from the
// key.
APIURL string
}
Config configures the adapter.
type Creem ¶
type Creem struct {
// contains filtered or unexported fields
}
Creem implements payments.Provider for Creem.
func (*Creem) CheckoutOrigin ¶
CheckoutOrigin returns the origin of hosted checkout pages.
func (*Creem) CreateCheckout ¶
CreateCheckout creates a checkout for the configured product at the given price. The reference travels as the request ID and as the intent_id metadata, and comes back in webhooks.