Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig wraps the internal loader for consumers embedding Cedros Pay.
func NewHandler ¶
func NewHandler(cfg *config.Config, opts ...Option) (http.Handler, func(context.Context) error, error)
NewHandler is a convenience that constructs an App and returns its handler.
func RegisterRoutes ¶
RegisterRoutes attaches Cedros endpoints to the provided router using an existing App.
Types ¶
type App ¶
type App struct {
Config *config.Config
Store storage.Store
Verifier x402.Verifier
Notifier callbacks.Notifier
Paywall *paywall.Service
Stripe *stripesvc.Client
CartService *stripesvc.CartService // Cart service for multi-item checkouts
Coupons coupons.Repository // Coupon repository
Subscriptions *subscriptions.Service // Subscription management service
IdempotencyStore *idempotency.MemoryStore
// contains filtered or unexported fields
}
App wires the Cedros paywall components for reuse or standalone serving.
type Option ¶
type Option func(*options)
Option configures App construction.
func WithNotifier ¶
WithNotifier injects a payment callback notifier.
func WithRouter ¶
WithRouter allows callers to provide an existing chi.Router to register routes onto.
func WithVerifier ¶
WithVerifier injects a custom x402 verifier (responsible for validation and settlement).
Click to show internal directories.
Click to hide internal directories.