With Vodes you can allow users to purchase the credits (vodes) on your site.
The component handles the payments adding the user credits automatically to the database using the PayPal IPN system. It also has administration of the credits and configuration in the backend.
The PayPal Sandbox test mode, automail, error log and change of language are supported.
So, the Vodes component is made ONLY for automatic purchase of credits using PayPal and auto-adding of credits to a user account. It is not made for spending the credits!
The credits are, however, stored in the database and can be used very easily by other components, modules or custom programmed scripts. Therefore the spending part is left for the user to implement in any way he / she needs it.
It could be to vote for articles and polls, donate, finance the development of information goods, access various areas and other purposes of your choice.
Here is the code to use in your components / modules / mambots / custom scripts for spending the credits.To decrement user's account:
$database->setQuery( "
UPDATE #__vode_credits
SET credit=credit-1
WHERE userid='$my->id'
" );
$database->query();
To read user's balance:
$database->setQuery( "
SELECT * FROM #__vode_credits
WHERE userid='$my->id'
" );
$row = null;
$database->loadObject($row);
$balance = $row->credit;