Theme editor

Blatchy - Bankroll

| XF 2.3 ADD-ON (VIP) Blatchy - Bankroll 1.0.48

No permission to download
For Developers

Bankroll exposes a single static Api class. Any addon can interact with it without knowing anything about the internals.

Get a user's balance
PHP:
Expand Collapse Copy
$balance = \Blatchy\Bankroll\Api::getBalance($userId);

Credit a user
PHP:
Expand Collapse Copy
\Blatchy\Bankroll\Api::credit($userId, 500, 'bet_win', 'Won parlay #12', 'parlay_12');

Debit a user — returns false if insufficient funds
PHP:
Expand Collapse Copy
$success = \Blatchy\Bankroll\Api::debit($userId, 100, 'bet_place', 'Placed bet #12', 'bet_12');

Check if a user can afford an amount
PHP:
Expand Collapse Copy
if (\Blatchy\Bankroll\Api::canAfford($userId, 250)) { ... }

Transfer between users
PHP:
Expand Collapse Copy
\Blatchy\Bankroll\Api::transfer($fromUserId, $toUserId, 200, 'Prize payout');

Refund a previous debit
PHP:
Expand Collapse Copy
\Blatchy\Bankroll\Api::refund($userId, 100, 'Bet voided', 'bet_12');

Format an amount using the configured prefix/suffix
PHP:
Expand Collapse Copy
echo \Blatchy\Bankroll\Api::format(1250); // → "$1,250"

Recommended transaction type conventions

  • bet_place — sportsbook bet placed
  • bet_win — sportsbook bet won
  • bet_loss — sportsbook bet lost
  • bet_push — sportsbook bet pushed/refunded
  • parlay_win / parlay_loss — parlay outcomes
  • arcade_win / arcade_loss — arcade game outcomes
  • blackjack_win / blackjack_loss — casino game outcomes
  • slots_win / slots_loss — slot machine outcomes
  • purchase — item purchased
  • refund — refund issued
  • admin — manual admin adjustment
Back
Top