Most vending machine use FPGA to control all processes and transactions. One of the core controls of a vending machine is the AMS Sensit 2 PC board that you can see here:
For further information about this machine, you can go to https://www.vendingworld.com/ams-sensit-2-pc-board.php.
For a simple vending machine, you can use an Arduino board as the control unit in your vending machine. Arduino provides more digital and analog I/O pins that you can attach to the machine. You can extend these I/O pins using additional ICs.
Moreover, we can use your Raspberry Pi as a control unit for your vending machine. The Raspberry Pi has capabilities of a computer with low-end features. You can use desktop libraries such as OpenCV with Raspberry Pi to perform image processing and detection.