Steffo99 / greed

Customizable, multilanguage Telegram shop bot with Payments support
GNU Affero General Public License v3.0
534 stars 262 forks source link

Display an error when `payment_preset` is outside the `min_amount` / `max_amount` range #154

Open tarunkumar519 opened 2 years ago

tarunkumar519 commented 2 years ago

im getting this error when user choose credit card as payment option

Traceback (most recent call last):
  File "/home/ubuntu/greed/worker.py", line 203, in run
    self.__user_menu()
  File "/home/ubuntu/greed/worker.py", line 480, in __user_menu
    self.__add_credit_menu()
  File "/home/ubuntu/greed/worker.py", line 773, in __add_credit_menu
    self.__add_credit_cc()
  File "/home/ubuntu/greed/worker.py", line 812, in __add_credit_cc
    min_amount=self.Price(self.cfg["CreditCard"]["min_amount"])))
  File "/home/ubuntu/greed/nuconfig.py", line 15, in __getitem__
    return self.data.__getitem__(item)
KeyError: 'CreditCard'
Exception in <Worker 2036593097>: 'CreditCard'

ok quick edit, i got this issue due to putting payment_preset values below the min_amount in config file.