Client creates channel and places deposit on it.
After Client starts using service,
Client billing would identify that current usage lags after payment and will send cheque to Agent.
Cheque - is specially crafted message, signed by Client. If signed further by Agent and sent to smart contract it closes channel, while completing transfer of tokens owed by Client to Agent. Signed by Client balance proofs that it permits to Agent to get exact amount of tokens from channel deposit.
AgentAddress data.HexStringOpenBlockNumber uint32OfferingHash data.HexStringBalance uint64BalanceMsgSig data.Base64StringContractAddress data.HexString
Agent has payment web service that receives payments from Client. It will receive cheque, verify that:
signature is correct
all fields matching to channel
cheque balance is greater than last received
If verification succeeded, Agent will store new balance and cheque in database.
If Agent has already terminated service, it responds with error message. Client will also terminate service in such case.