-
Notifications
You must be signed in to change notification settings - Fork 7
features charge requests
Unlike direct payment (sender sends money), the charge request (payment request) sends the target a clickable message so that they make the payment. Useful for shops, events, or for a newcomer to request money without touching the /pay command.
Initiated from:
- Player sub-menu → Charge (Redstone) → chat flow to enter amount
- Or via internal API
ChargeRequestService.startRequest(sender, target)
If the recipient is connected, they receive a Spigot TextComponent with:
-
ClickEvent.Action.RUN_COMMAND→/pay <requester> <amount> -
HoverEvent.Action.SHOW_TEXT→ details
The requester sees pay.request.sent confirmation; if the recipient clicks and has enough money, the TxRecord is written as CHARGE_PAID.
If the recipient is disconnected, the request is NOT lost. The chosen storage depends on storage.use_mysql:
| Mode | Store | Class / Table |
|---|---|---|
| No MySQL |
ConcurrentHashMap<String,List<PendingRequest>> in RAM (lost on restart) |
pendingByRecipient |
| With MySQL |
vault_charge_requests table on disk |
Database.addChargeRequest() |
vault_charge_requests
├── id BIGINT PK AUTO_INCREMENT
├── recipient VARCHAR(16)
├── sender VARCHAR(16)
├── amount DECIMAL(19,4)
└── created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
INDEX idx_vcr_recipient(recipient)When MySQL is enabled and the write fails due to SQLException, there is silent in-memory fallback so the request is not lost.
PlayerJoinEvent → ChargeRequestService.onJoin() delivers pending charges but never more than pay_pending.max_on_join per session:
pay_pending:
max_on_join: 5 # max 5 charges per loginIf more are pending:
- Memory mode: first N are removed; the rest are re-inserted into
pendingByRecipient - MySQL mode: only those delivered by
fetchAndDeletePendingRequests(recipient, limit)are deleted from the table; others wait for the next login
For each delivered charge the player sees:
You have 12 pending charge(s).
[Showing 5/12 - the rest will arrive on your next login]
[Charge] Click HERE to pay $ 500 to ShopNPC
During amount input via chat (before sending the request):
- Typing
cancelorcancelaraborts (configurable:pay.prompt.cancel_words) -
pay_limits.min / maxlimits apply — bypass withvault.pay.bypass_*
The command /pay cancel (and alias cancelar) directly cancels the active session.
Vault Economy v2.1.0 · Compatible with Spigot 1.8.8 – 1.21.x
📦 Modrinth ·
💬 Discord ·
Java 17 (legacy) · Java 21 (modern)
Documentation generated on 2026-09-03 · Vault Project Team
- 🏠 Home
- 🚀 First Install
- 🧑🏫 Getting Started
- ❓ Basic FAQ
- 📋 Complete Command List
- 🛡️ Complete Permission List
- ⚙️ config.yml Reference
- 🌐 Supported Languages
- 🆕 Modrinth Updates
- 💰 Player-to-Player Payments
- 🏦 Bank System
- 💵 Physical Notes
- 💸 Loans
- 📜 Transaction History
- 📊 Top Players
- ⏸️ Offline Payments
- 💳 Charges / Payment Requests
- 🔔 Discord Webhook
- 🛠️ Installation Errors
- 🚫 Players Can't Pay
- 🧨 Balances Wiped on Restart
- 📉 Bank Doesn't Pay Interest
- 🧾 Invalid / Expired Notes
- 🩺 Complete Step-by-Step Troubleshooting
- Java API
- 📜 Skript
- 🧰 Contribute · Dual Maven Build