From d8edecc5ff0145c070496b05a6e68e4deb91523c Mon Sep 17 00:00:00 2001 From: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com> Date: Fri, 26 Sep 2025 08:00:23 +0200 Subject: [PATCH] HelloAsso: retry without payer info for BadRequestException (400) in addition to UnauthorizedException (403) --- app/core/payment/payment_tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/core/payment/payment_tool.py b/app/core/payment/payment_tool.py index e0b4166c70..a2f4a95e72 100644 --- a/app/core/payment/payment_tool.py +++ b/app/core/payment/payment_tool.py @@ -8,7 +8,7 @@ from helloasso_python.api.paiements_api import PaiementsApi from helloasso_python.api_client import ApiClient from helloasso_python.configuration import Configuration -from helloasso_python.exceptions import UnauthorizedException +from helloasso_python.exceptions import BadRequestException, UnauthorizedException from helloasso_python.models.hello_asso_api_v5_models_carts_checkout_payer import ( HelloAssoApiV5ModelsCartsCheckoutPayer, ) @@ -196,7 +196,7 @@ async def init_checkout( self._helloasso_slug, init_checkout_body, ) - except UnauthorizedException: + except (UnauthorizedException, BadRequestException): # We know that HelloAsso may refuse some payer infos, like using the firstname "test" # Even when prefilling the payer infos,the user will be able to edit them on the payment page, # so we can safely retry without the payer infos