vending 
A vending machine
Procs | |
| build_inventory | Build src.produdct_records from the products lists |
|---|---|
| credit_purchase | Add money for current purchase to the vendor account. |
| pay_with_card | Scan a card and attempt to transfer payment from associated account. |
| pay_with_cash | Receive payment with cashmoney. |
| pay_with_ewallet | Scan a chargecard and deduct payment from it. |
| stock | |
| ui_interact | Display the TGUI window for the vending machine. |
Proc Details
build_inventory
Build src.produdct_records from the products lists
src.products, src.contraband, src.premium, and src.prices allow specifying products that the vending machine is to carry without manually populating src.product_records.
credit_purchase
Add money for current purchase to the vendor account.
Called after the money has already been taken from the customer.
pay_with_card
Scan a card and attempt to transfer payment from associated account.
Takes payment for whatever is the currently_vending item. Returns 1 if successful, 0 if failed
pay_with_cash
Receive payment with cashmoney.
pay_with_ewallet
Scan a chargecard and deduct payment from it.
Takes payment for whatever is the currently_vending item. Returns 1 if successful, 0 if failed.
stock
-
Add item to the machine
-
Checks if item is vendable in this machine should be performed before
-
calling. W is the item being inserted, R is the associated vending_product entry. R can be null, in which case the user is inserting something that wasnt previously here. In that case we create a new inventory record for the item
ui_interact
Display the TGUI window for the vending machine.
See TGUI documentation for details.