Documentation
¶
Index ¶
- type Service
- func (s *Service) CreateSession(ctx context.Context, sessionID string, id string, txID uuid.UUID, ...) (*Session, error)
- func (s *Service) GetSession(ctx context.Context, id string) (*Session, error)
- func (s *Service) GetSessionByTransactionID(ctx context.Context, txID uuid.UUID) (*Session, error)
- func (s *Service) GetSessionsByUserID(ctx context.Context, userID uuid.UUID) ([]*Session, error)
- func (s *Service) UpdateStatus(ctx context.Context, id, status string) error
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides high-level operations for managing checkout sessions
func (*Service) CreateSession ¶
func (s *Service) CreateSession( ctx context.Context, sessionID string, id string, txID uuid.UUID, userID uuid.UUID, accountID uuid.UUID, amount int64, currencyCode string, checkoutURL string, expiresIn time.Duration, ) (*Session, error)
CreateSession creates a new checkout session
func (*Service) GetSession ¶
GetSession retrieves a checkout session by ID
func (*Service) GetSessionByTransactionID ¶
func (s *Service) GetSessionByTransactionID( ctx context.Context, txID uuid.UUID, ) (*Session, error)
GetSessionByTransactionID retrieves a checkout session by transaction ID
func (*Service) GetSessionsByUserID ¶ added in v1.2.0
GetSessionsByUserID retrieves all checkout sessions for a given user ID
type Session ¶
type Session struct {
ID string `json:"id"`
TransactionID uuid.UUID `json:"transaction_id"`
UserID uuid.UUID `json:"user_id"`
AccountID uuid.UUID `json:"account_id"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Status string `json:"status"`
CheckoutURL string `json:"checkout_url"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
// contains filtered or unexported fields
}
Session represents a checkout session with its metadata
func (*Session) FormatAmount ¶
FormatAmount formats the amount according to the currency's decimal places
func (*Session) GetCurrencySymbol ¶
GetCurrencySymbol returns the currency symbol
Click to show internal directories.
Click to hide internal directories.