From 13243521a557841cf8e76b569f9de754c2a7c0ee Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 7 Apr 2020 23:51:59 +0200 Subject: [PATCH] Don't refill on checkout if credit card payments are disabled --- worker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.py b/worker.py index c4c6496..45e13f3 100644 --- a/worker.py +++ b/worker.py @@ -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):