Documentation ¶
Index ¶
Constants ¶
View Source
const ( OrderStatusPaidInFull = "paid-in-full" OrderStatusPendingPayment = "pending-payment" OrderStatusPaidInPart = "paid-in-part" OrderStatusOverPaid = "over-paid" )
Variables ¶
View Source
var ( ErrDoubleSpend = errors.New("double spend") ErrInsufficientPayment = errors.New("insufficent payment") ErrOrderNotFound = errors.New("order not found") ErrPaymentNotFound = errors.New("payment not found") ErrNetworkError = errors.New("network error") ErrPaymentFound = errors.New("payment found") ErrCreateOrderValidation = errors.New("invalid order") )
Functions ¶
This section is empty.
Types ¶
type CurrencyBalance ¶
type CurrencyBalance struct{}
type PaymentRegistry ¶
type PaymentRegistry interface { StoreOrder(ctx context.Context, order Order) error StorePayment(ctx context.Context, payment Payment) error FindPayment(ctx context.Context, ids PaymentID) (Payment, error) FindOrder(ctx context.Context, id OrderID) (Order, error) OrdersByUser(ctx context.Context, id UserID) ([]Order, error) PaymentsByUser(ctx context.Context, id UserID) ([]Payment, error) }
type PurchaseSystem ¶
type PurchaseSystem interface { CreateOrder(ctx context.Context, no NewOrder) (OrderID, error) ReceivePayment(ctx context.Context, paymentEvet Payment) (PaymentID, error) UserHistory(ctx context.Context, userID UserID) ([]Payment, []Order, error) Pay(ctx context.Context, orderID OrderID, paymentIDs PaymentID) error UpdateTrackingInfo(ctx context.Context, orderID OrderID, update TrackingInfoUpdate) error ViewOrder(ctx context.Context, orderID OrderID) (Order, error) ViewReceipt(ctx context.Context, orderID OrderID) (Receipt, error) }
func New ¶
func New(registry PaymentRegistry, newOrderPolicy NewOrderPolicy) PurchaseSystem
type TrackingInfoUpdate ¶
type TrackingInfoUpdate struct{}
Click to show internal directories.
Click to hide internal directories.