Handling Escrow Mode - PyramidTechnologies/netPyramid-RS-232 GitHub Wiki

Escrow Mode

If you want precise control over every bill stack or return, escrow mode is for you. While in this mode, the acceptor will wait for your application to issue a credit or return command. There is an optional timeout that will fail-safe return the note in the event your code hangs or encounters and error. By default, this timeout is disabled.

To use escrow mode, set the IsEscrowMode flag in your RS232Config to true. This may be set at instantiation time or at any time during while the application is running. You must also subsribe to the OnEscrow event if you enable escrow mode. Technically this is not enforced but if you do not listen, the acceptor will never accept notes!

config.IsEscrowMode = true;
validator.OnEscrow += validator_onEscrow;

// Sample that accepts only $1 bills
private void validator_OnEscrow(object sender, EscrowArgs e)
{
    // Get the index of the note in escrow
    int index = e.Index;
    
    if(index == 1) 
    {
         validator.Stack();
    }   
    else
    {
         validator.Reject();
    }

}