1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 23:58:24 +02:00

Configure Hello Asso return endpoint

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-02-20 22:54:12 +01:00
parent 8c7e9648dd
commit 8d08b18d08
5 changed files with 259 additions and 120 deletions

View File

@ -57,7 +57,7 @@ def get_hello_asso_access_token():
return _access_token
def get_checkout_intent(checkout_id):
def get_checkout_intent(checkout_id, none_if_link_disabled=False):
base_url = _get_hello_asso_api_base_url()
token = get_hello_asso_access_token()
@ -72,7 +72,7 @@ def get_checkout_intent(checkout_id):
response.raise_for_status()
checkout_intent = response.json()
if requests.head(checkout_intent["redirectUrl"]).status_code == 404:
if none_if_link_disabled and requests.head(checkout_intent["redirectUrl"]).status_code == 404:
return None
return checkout_intent