mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-22 05:54:18 +00:00
Add option to disable cash payments (#190)
* Create the `enable_pay_with_cash` and `enable_create_transaction` config options * Add configuration gates to the `menu_cash` and `menu_edit_credit` buttons
This commit is contained in:
parent
8701071b30
commit
bb99472c84
2 changed files with 13 additions and 2 deletions
|
@ -57,6 +57,15 @@ currency_exp = 2
|
||||||
currency_symbol = "€"
|
currency_symbol = "€"
|
||||||
|
|
||||||
|
|
||||||
|
# Cash payment settings
|
||||||
|
[Payments.Cash]
|
||||||
|
# Display the "With cash" option in the Add Credit menu
|
||||||
|
enable_pay_with_cash = true
|
||||||
|
# Display the "Create transaction" option in the Manager menu
|
||||||
|
enable_create_transaction = true
|
||||||
|
# Customize the cash payment text in the strings files!
|
||||||
|
|
||||||
|
|
||||||
# Credit card payment settings
|
# Credit card payment settings
|
||||||
[Payments.CreditCard]
|
[Payments.CreditCard]
|
||||||
# Telegram Payments provider token obtainable at https://t.me/BotFather in the bot's Payments menu
|
# Telegram Payments provider token obtainable at https://t.me/BotFather in the bot's Payments menu
|
||||||
|
|
|
@ -749,6 +749,7 @@ class Worker(threading.Thread):
|
||||||
keyboard = list()
|
keyboard = list()
|
||||||
# Add the supported payment methods to the keyboard
|
# Add the supported payment methods to the keyboard
|
||||||
# Cash
|
# Cash
|
||||||
|
if self.cfg["Payments"]["Cash"]["enable_pay_with_cash"]:
|
||||||
keyboard.append([telegram.KeyboardButton(self.loc.get("menu_cash"))])
|
keyboard.append([telegram.KeyboardButton(self.loc.get("menu_cash"))])
|
||||||
# Telegram Payments
|
# Telegram Payments
|
||||||
if self.cfg["Payments"]["CreditCard"]["credit_card_token"] != "":
|
if self.cfg["Payments"]["CreditCard"]["credit_card_token"] != "":
|
||||||
|
@ -904,6 +905,7 @@ class Worker(threading.Thread):
|
||||||
if self.admin.receive_orders:
|
if self.admin.receive_orders:
|
||||||
keyboard.append([self.loc.get("menu_orders")])
|
keyboard.append([self.loc.get("menu_orders")])
|
||||||
if self.admin.create_transactions:
|
if self.admin.create_transactions:
|
||||||
|
if self.cfg["Payments"]["Cash"]["enable_create_transaction"]:
|
||||||
keyboard.append([self.loc.get("menu_edit_credit")])
|
keyboard.append([self.loc.get("menu_edit_credit")])
|
||||||
keyboard.append([self.loc.get("menu_transactions"), self.loc.get("menu_csv")])
|
keyboard.append([self.loc.get("menu_transactions"), self.loc.get("menu_csv")])
|
||||||
if self.admin.is_owner:
|
if self.admin.is_owner:
|
||||||
|
|
Loading…
Reference in a new issue