Versions in this module Expand all Collapse all v0 v0.1.0 Jun 25, 2026 Changes in this version + func RegisterDriver(name string, f DriverFactory) + type Charge struct + Amount Money + ID string + Provider string + Raw map[string]any + Status string + type ChargeRequest struct + Amount Money + Customer Customer + Description string + Metadata map[string]string + Token string + type CheckoutRequest struct + Amount Money + CancelURL string + Customer Customer + Items []LineItem + Metadata map[string]string + SuccessURL string + type CheckoutSession struct + ID string + URL string + type Customer struct + Email string + ID string + Name string + Phone string + type DriverFactory func(k *togo.Kernel) (PaymentProvider, error) + type LineItem struct + Amount Money + Name string + Quantity int64 + type Money struct + Amount int64 + Currency string + type PaymentProvider interface + CreateCharge func(ctx context.Context, req ChargeRequest) (*Charge, error) + CreateCheckoutSession func(ctx context.Context, req CheckoutRequest) (*CheckoutSession, error) + CreateCustomer func(ctx context.Context, c Customer) (string, error) + CreateSubscription func(ctx context.Context, req SubscriptionRequest) (*Subscription, error) + HandleWebhook func(ctx context.Context, headers map[string]string, body []byte) (*WebhookEvent, error) + Refund func(ctx context.Context, req RefundRequest) error + type RefundRequest struct + Amount *Money + ChargeID string + type Service struct + func FromKernel(k *togo.Kernel) (*Service, bool) + func (s *Service) CreateCharge(ctx context.Context, req ChargeRequest) (*Charge, error) + func (s *Service) CreateCheckoutSession(ctx context.Context, req CheckoutRequest) (*CheckoutSession, error) + func (s *Service) CreateCustomer(ctx context.Context, c Customer) (string, error) + func (s *Service) CreateSubscription(ctx context.Context, req SubscriptionRequest) (*Subscription, error) + func (s *Service) Driver() string + func (s *Service) HandleWebhook(ctx context.Context, headers map[string]string, body []byte) (*WebhookEvent, error) + func (s *Service) Provider() PaymentProvider + func (s *Service) Refund(ctx context.Context, req RefundRequest) error + type Subscription struct + ID string + PlanID string + Provider string + Status string + type SubscriptionRequest struct + Customer Customer + Metadata map[string]string + PlanID string + type WebhookEvent struct + ID string + Provider string + Raw map[string]any + Type string