greed
greed copied to clipboard
Placing an order sometimes causes Telegram to return `Payment_provider_invalid`
After trying to complete an order with insufficient funds, clicking add funds returns an error. The error can be replicated on a new installation from the master branch.
Steps to replicate:
Place order without enough credit > Add funds
Full error: Payment_provider_invalid
I couldn't reproduce this...
What payment provider is configured in your config file?
Both the default Credit Card token and using a Stripe testing token return the error.
This appears related to the refill_on_checkout
setting automatically creating a new Credit Card payment. I am actually experiencing the issue during send_invoice while making credit card payments.
2020-06-26 08:20:51 | Core | core | Received /start from: 619853453
2020-06-26 08:21:16 | Worker 619853453 | utils | Network error while calling send_invoice(), retrying in 5 secs...
Full error: Payment_provider_invalid
The refill_on_checkout functionality interferes with users who would still like to top up with cash or another payment method after ordering without enough credit. A simple solution would be to make refill_on_checkout = no
by default or send the user to the add_funds menu instead of automatically running __make_payment()
:
https://github.com/Steffo99/greed/blob/master/worker.py#L560
this error also facing when user want to order but the balance is not enought and errror happened.. and the bot unrespond and error keep going on,,
when i comment this .. bot also error but still responding .. https://github.com/Steffo99/greed/blob/ee86092c60f2ae3bf11c141645f40fa8d57708b7/duckbot.py#L95-L97
btw the error in debug mode only show
Network error while calling send_invoice(), retrying in 5 secs...
Full error: Payment_provider_invalid
That's because of the following setting, implemented in #40: https://github.com/Steffo99/greed/blob/ee86092c60f2ae3bf11c141645f40fa8d57708b7/config/template_config.toml#L100-L101