Versions in this module Expand all Collapse all v0 v0.1.0 Aug 27, 2026 Changes in this version + var ErrCanceled = errors.New("payment: canceled") + var ErrDeclined = errors.New("payment: declined") + var ErrInvalidRequest = errors.New("payment: invalid request") + var ErrNetwork = errors.New("payment: network error") + var ErrProvider = errors.New("payment: provider error") + var ErrTransactionNotFound = errors.New("payment: transaction not found") + var ErrUnsupported = errors.New("payment: operation unsupported") + type Client struct + func NewClient(gateway Gateway) *Client + func (c *Client) Purchase(ctx context.Context, request PurchaseRequest) (PurchaseResponse, error) + func (c *Client) Refund(ctx context.Context, request RefundRequest) (RefundResponse, error) + func (c *Client) Verify(ctx context.Context, request VerifyRequest) (Transaction, error) + type Currency string + const CurrencyIRR + const CurrencyIRT + type Gateway interface + type Money struct + Amount int64 + Currency Currency + type PurchaseRequest struct + Amount Money + CallbackURL string + Description string + Metadata map[string]string + OrderID string + type PurchaseResponse struct + RedirectURL string + Transaction Transaction + type Purchaser interface + Purchase func(context.Context, PurchaseRequest) (PurchaseResponse, error) + type RefundRequest struct + Amount Money + Reason string + TransactionID string + type RefundResponse struct + Amount Money + ID string + TransactionID string + type Refunder interface + Refund func(context.Context, RefundRequest) (RefundResponse, error) + type Status string + const StatusCanceled + const StatusFailed + const StatusPaid + const StatusPending + const StatusRefunded + type Transaction struct + Amount Money + ID string + Provider string + ReferenceID string + Status Status + type Verifier interface + Verify func(context.Context, VerifyRequest) (Transaction, error) + type VerifyRequest struct + Amount Money + TransactionID string