Basically the title.
On our demo, when someone has created an invoice with currency="string" (not possible via admin, it's via API), it has been created and stuck in pending, as it has no payments because of the error.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 391, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.6/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/fastapi/applications.py", line 181, in __call__
await super().__call__(scope, receive, send) # pragma: no cover
File "/usr/local/lib/python3.6/site-packages/starlette/applications.py", line 111, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/base.py", line 25, in __call__
response = await self.dispatch_func(request, self.call_next)
File "/app/main.py", line 30, in add_onion_host
response = await call_next(request)
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/base.py", line 45, in call_next
task.result()
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/cors.py", line 86, in __call__
await self.simple_response(scope, receive, send, request_headers=headers)
File "/usr/local/lib/python3.6/site-packages/starlette/middleware/cors.py", line 142, in simple_response
await self.app(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 566, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.6/site-packages/fastapi/routing.py", line 183, in app
dependant=dependant, values=values, is_coroutine=is_coroutine
File "/usr/local/lib/python3.6/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "/app/api/utils.py", line 320, in post
obj = await self.custom_methods["post"](model, user)
File "/app/api/crud.py", line 87, in create_invoice
await update_invoice_payments(obj, wallets, discounts, task_wallets, store, product, promocode)
File "/app/api/crud.py", line 98, in update_invoice_payments
price = invoice.price / await coin.rate(invoice.currency)
File "/usr/local/lib/python3.6/site-packages/bitcart/coins/btc.py", line 344, in rate
return convert_amount_type(await self.server.exchange_rate(currency))
File "/usr/local/lib/python3.6/site-packages/bitcart/utils.py", line 18, in convert_amount_type
return Decimal(amount)
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
Actually, it seems like something else is happening. Maybe server returned html instead of a valid number?