feat: add configurable transaction amount limit with PAYME_TRANSACTIO… #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Menda yaqinda summa bilan bog'liq quyidagicha hatolik kuzatildi
Request from payme:
{ "time": "2025-04-21T19:25:32.303Z", "body": { "data": { "method": "CreateTransaction", "params": { "id": "68069b976111b37899d50215", "time": 1745263532241, "amount": 140000000, "account": { "order_id": "217" } }, "url": "***************", "timeout": 30000 } } }Response from server:
{ "time": "2025-04-21T19:25:32.346Z", "body": { "data": { "error": { "code": -32400, "message": { "uz": "Tizimda xatolik yuzaga keldi.", "ru": "Внутренняя ошибка сервиса.", "en": "Internal service error." }, "data": "numeric field overflow\nDETAIL: A field with precision 10, scale 2 must round to an absolute value less than 10^8.\n" } } } }Men oylik tarif uchun 1400000 (1 million 400 ming) tolov qabul qilishim kerak edi lekin ushbu xatolik yuzaga keldi.
Bunda
PaymeTransactionsmodelidaamount = DecimalField(max_digits=10, decimal_places=2)yozilgan vagenerate_pay_linkmethoddaamount = amount * 100tolov check yaratish paytida tiyinga otkazish uchun.Lekin raqamlar soni avval 7 honali edi va *100 sababli 9 honaga kopayib ketadi va bizda max_digits=10 bu bizga maksimal 8 honali butun va 2 honali qoldiq sonni saqlashga imkonini beradi lekin 9 yoki undan katta (10000000) 10 million kabi tolovlar yaratishda yana qoshimcha 2 hona qoshilib limitdan oshib ketadi
bunga quyidagicha yechim qildim:
bu orqali foydalanuvchilar limitni ozlariga kerakli holatda ozgartirib olaveradilar defaul holatda esa 11 (99 999 999 99)
to'qson to'qqiz million ....)va 2 honali tiyin gacha qabul qila olishadi va qoshimcha xatoliklarni oldini olish uchun system check va Exeption ham yozib qoydim. qoshimcha malumot uchun readme ni korishingiz mumkin