local framework = require 'bridge.framework'
return {
--[[
Payment method definitions.
You can add your own payment methods here.
The key is the identifier of the payment method.
The value is a table with the following fields:
- icon: string (FontAwesome icon class)
- balance: function(source) -> number
- remove: function(source, amount, reason) -> boolean
- add: function(source, amount, reason) -> boolean
For label, identifier will get `_sell` or `_buy` from locales.
]] --
---@type table<string, PaymentMethodDefinition>
methods = {
['cash'] = {
icon = 'fas fa-money-bill',
balance = function(source)
return framework.getMoney(source, 'cash')
end,
remove = function(source, amount, reason)
return framework.removeMoney(source, 'cash', amount, reason)
end,
add = function(source, amount, reason)
return framework.addMoney(source, 'cash', amount, reason)
end,
},
['bank'] = {
icon = 'fas fa-bank',
balance = function(source)
return framework.getMoney(source, 'bank')
end,
remove = function(source, amount, reason)
return framework.removeMoney(source, 'bank', amount, reason)
end,
add = function(source, amount, reason)
return framework.addMoney(source, 'bank', amount, reason)
end,
}
}
}