Togai Wallet for Top-Off Pre Pay Thresholds

The Customer should be able to enable a "top-off pre-pay" which consists of a top off amount and a threshold.

When the threshold, which is consumed through Usage Based Billing, is breached, then the top off should occur automatically.

This should mean that the Invoice should always be kept at $0 UNLESS a huge job consumes alot and creates a huge deficit that exceeds the top-off amount.

For example, a job creates $10 in charges and the last top-off brought the Wallet Balance to only $5.

Then, in theory, the alert should trigger and ask for another top-off...

What would be better is if, at the time someone wants to run another job AND there's a balance on the Invoice, they must pay it in full at that time to run the job.

I just can't tell if such a race condition will occur.

Payment Logic

title: "Payment Logic"
image: "https://imgr.whimsical.com/thumbnails/DaxX2R28NxaXqgS5vJrpfE/PfndUp53RhQ2oexADeEqzJ"
description: "Whimsical combines whiteboards and docs in an all-in-one collaboration hub."
url: "https://whimsical.com/payment-logic-DaxX2R28NxaXqgS5vJrpfE"