From f00a72ad15bc4663d025d896f8d48f342bafbe61 Mon Sep 17 00:00:00 2001 From: machka pasla Date: Thu, 11 Dec 2025 12:59:39 +0300 Subject: [PATCH] yookassa fix --- bot/services/yookassa_service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot/services/yookassa_service.py b/bot/services/yookassa_service.py index f837faf..e3f25d9 100644 --- a/bot/services/yookassa_service.py +++ b/bot/services/yookassa_service.py @@ -114,10 +114,12 @@ class YooKassaService: capture = False amount = max(amount, 1.00) builder.set_capture(capture) - builder.set_confirmation({ - "type": ConfirmationType.REDIRECT, - "return_url": self.return_url - }) + if not payment_method_id: + # Saved payment_method_id charges must omit confirmation per YooKassa API + builder.set_confirmation({ + "type": ConfirmationType.REDIRECT, + "return_url": self.return_url + }) builder.set_description(description) builder.set_metadata(metadata) if save_payment_method: