Documentation ¶
Overview ¶
Package bill incapsulates work with bill validators.
Index ¶
- Constants
- Variables
- func Enum(ctx context.Context) error
- type BillValidator
- func (bv *BillValidator) AcceptMax(max currency.Amount) engine.Doer
- func (bv *BillValidator) CommandExpansionIdentification() error
- func (bv *BillValidator) CommandExpansionIdentificationOptions() error
- func (bv *BillValidator) CommandFeatureEnable(requested Features) error
- func (bv *BillValidator) CommandSetup(ctx context.Context) error
- func (bv *BillValidator) EscrowAccept() engine.Doer
- func (bv *BillValidator) EscrowAmount() currency.Amount
- func (bv *BillValidator) EscrowReject() engine.Doer
- func (bv *BillValidator) NewBillType(accept, escrow uint16) engine.Doer
- func (bv *BillValidator) Run(ctx context.Context, alive *alive.Alive, fun func(money.PollItem) bool)
- func (bv *BillValidator) SupportedNominals() []currency.Nominal
- type Biller
- type Features
- type Stub
- func (Stub) AcceptMax(currency.Amount) engine.Doer
- func (Stub) EscrowAccept() engine.Doer
- func (Stub) EscrowAmount() currency.Amount
- func (Stub) EscrowReject() engine.Doer
- func (Stub) Run(ctx context.Context, alive *alive.Alive, fun func(money.PollItem) bool)
- func (Stub) SupportedNominals() []currency.Nominal
Constants ¶
View Source
const ( StatusDefectiveMotor byte = 0x01 StatusSensorProblem byte = 0x02 StatusValidatorBusy byte = 0x03 StatusROMChecksumError byte = 0x04 StatusValidatorJammed byte = 0x05 StatusValidatorWasReset byte = 0x06 StatusBillRemoved byte = 0x07 StatusCashboxOutOfPosition byte = 0x08 StatusValidatorDisabled byte = 0x09 StatusInvalidEscrowRequest byte = 0x0a StatusBillRejected byte = 0x0b StatusCreditedBillRemoval byte = 0x0c )
View Source
const ( StatusRoutingBillStacked byte = 0x80 | (iota << 4) StatusRoutingEscrowPosition StatusRoutingBillReturned StatusRoutingBillToRecycler StatusRoutingDisabledBillRejected StatusRoutingBillToRecyclerManualFill StatusRoutingManualDispense StatusRoutingTransferredFromRecyclerToCashbox )
View Source
const DefaultEscrowTimeout = 30 * time.Second
View Source
const (
TypeCount = 16
)
Variables ¶
View Source
var ( ErrDefectiveMotor = errors.New("Defective Motor") ErrBillRemoved = errors.New("Bill Removed") ErrEscrowImpossible = errors.New("An ESCROW command was requested for a bill not in the escrow position.") ErrAttempts = errors.New("Attempts") ErrEscrowTimeout = errors.New("ESCROW timeout") )
Functions ¶
Types ¶
type BillValidator ¶
type BillValidator struct { mdb.Device DoEscrowAccept engine.Func DoEscrowReject engine.Func DoStacker engine.Func // contains filtered or unexported fields }
func (*BillValidator) AcceptMax ¶
func (bv *BillValidator) AcceptMax(max currency.Amount) engine.Doer
func (*BillValidator) CommandExpansionIdentification ¶
func (bv *BillValidator) CommandExpansionIdentification() error
func (*BillValidator) CommandExpansionIdentificationOptions ¶
func (bv *BillValidator) CommandExpansionIdentificationOptions() error
func (*BillValidator) CommandFeatureEnable ¶
func (bv *BillValidator) CommandFeatureEnable(requested Features) error
func (*BillValidator) CommandSetup ¶
func (bv *BillValidator) CommandSetup(ctx context.Context) error
func (*BillValidator) EscrowAccept ¶
func (bv *BillValidator) EscrowAccept() engine.Doer
func (*BillValidator) EscrowAmount ¶
func (bv *BillValidator) EscrowAmount() currency.Amount
func (*BillValidator) EscrowReject ¶
func (bv *BillValidator) EscrowReject() engine.Doer
func (*BillValidator) NewBillType ¶
func (bv *BillValidator) NewBillType(accept, escrow uint16) engine.Doer
func (*BillValidator) SupportedNominals ¶
func (bv *BillValidator) SupportedNominals() []currency.Nominal
type Stub ¶
type Stub struct{}
func (Stub) EscrowAccept ¶
func (Stub) EscrowAccept() engine.Doer { return engine.Fail{E: errors.NotSupportedf("bill.Stub.EscrowAccept")} } func (Stub) EscrowReject() engine.Doer { return engine.Fail{E: errors.NotSupportedf("bill.Stub.EscrowReject")} }
func (Stub) EscrowAmount ¶
func (Stub) EscrowReject ¶
func (Stub) SupportedNominals ¶
Click to show internal directories.
Click to hide internal directories.