fix(пополнение): имя услуги в чеке без пробелов — снимает двусмысленность кодирования Receipt
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@ def _order(**kw):
|
||||
def _receipt(amount_kop: int, description: str = "Пополнение счёта infosmeta.ru") -> str:
|
||||
return json.dumps({
|
||||
"items": [{
|
||||
"name": description, "quantity": 1, "sum": amount_kop / 100,
|
||||
"name": description.replace(" ", "_"), "quantity": 1, "sum": amount_kop / 100,
|
||||
"payment_method": "full_payment", "payment_object": "service", "tax": "none",
|
||||
}]
|
||||
}, ensure_ascii=False, separators=(",", ":"))
|
||||
@@ -103,7 +103,7 @@ def test_receipt_has_service_nomenclature_and_amount(rk):
|
||||
_, q = _q(rk.create(_order())["pay_url"])
|
||||
data = json.loads(q["Receipt"])
|
||||
item = data["items"][0]
|
||||
assert item["name"] == "Пополнение счёта infosmeta.ru"
|
||||
assert item["name"] == "Пополнение_счёта_infosmeta.ru"
|
||||
assert item["quantity"] == 1 and item["sum"] == 1000.0
|
||||
assert item["payment_method"] == "full_payment"
|
||||
assert item["payment_object"] == "service"
|
||||
|
||||
Reference in New Issue
Block a user