1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-21 13:34:18 +00:00

Don't refill on checkout if credit card payments are disabled

This commit is contained in:
Steffo 2020-04-07 23:51:59 +02:00
parent 3f6b208ba1
commit 13243521a5

View file

@ -489,7 +489,8 @@ class ChatWorker(threading.Thread):
if credit_required > 0:
self.bot.send_message(self.chat.id, strings.error_not_enough_credit)
# Suggest payment for missing credit value if configuration allows refill
if configloader.config["Appearance"]["refill_on_checkout"] == 'yes':
if configloader.config["Credit Card"]["credit_card_token"] != "" \
and configloader.config["Appearance"]["refill_on_checkout"] == 'yes':
self.__make_payment(utils.Price(credit_required))
# If afer requested payment credit is still insufficient (either payment failure or cancel)
if self.user.credit < self.__get_cart_value(cart):