Skip to content

Commit

Permalink
(PC-33712)[API] feat: update identity check deeplink to universal link
Browse files Browse the repository at this point in the history
  • Loading branch information
dnguyen1-pass committed Jan 13, 2025
1 parent 5c57d7f commit 05b3cfd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions api/src/pcapi/core/subscription/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

REDIRECT_TO_DMS_CALL_TO_ACTION = models.CallToActionMessage(
title="Accéder au site Démarches-Simplifiées",
link="passculture://verification-identite/demarches-simplifiees",
link=f"{settings.WEBAPP_V2_URL}/verification-identite/demarches-simplifiees",
icon=models.CallToActionIcon.EXTERNAL,
)

REDIRECT_TO_IDENTIFICATION_CHOICE = models.CallToActionMessage(
title="Réessayer la vérification de mon identité",
link="passculture://verification-identite",
link=f"{settings.WEBAPP_V2_URL}/verification-identite",
icon=models.CallToActionIcon.RETRY,
)

Expand Down
3 changes: 2 additions & 1 deletion api/src/pcapi/core/subscription/ubble/messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import typing

from pcapi import settings
from pcapi.core.fraud import models as fraud_models
from pcapi.core.fraud.common import models as common_fraud_models
from pcapi.core.subscription import messages as subscription_messages
Expand All @@ -12,7 +13,7 @@

REDIRECT_TO_IDENTIFICATION = subscription_models.CallToActionMessage(
title="Réessayer la vérification de mon identité",
link="passculture://verification-identite/identification",
link=f"{settings.WEBAPP_V2_URL}/verification-identite/identification",
icon=subscription_models.CallToActionIcon.RETRY,
)

Expand Down
4 changes: 2 additions & 2 deletions api/tests/core/subscription/educonnect/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_not_eligible(self):
user_message="Ton dossier a été refusé. La date de naissance sur ton compte Éduconnect (06/04/1991) indique que tu n'as pas entre 15 et 17 ans.",
call_to_action=subscription_models.CallToActionMessage(
title="Réessayer la vérification de mon identité",
link="passculture://verification-identite",
link=f"{settings.WEBAPP_V2_URL}/verification-identite",
icon=subscription_models.CallToActionIcon.RETRY,
),
updated_at=fraud_check.updatedAt,
Expand All @@ -51,7 +51,7 @@ def test_ko_other_reason(self):
user_message="La vérification de ton identité a échoué. Tu peux réessayer.",
call_to_action=subscription_models.CallToActionMessage(
title="Réessayer la vérification de mon identité",
link="passculture://verification-identite",
link=f"{settings.WEBAPP_V2_URL}/verification-identite",
icon=subscription_models.CallToActionIcon.RETRY,
),
updated_at=fraud_check.updatedAt,
Expand Down
6 changes: 3 additions & 3 deletions api/tests/core/subscription/ubble/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ def test_retryable(self, reason_code):
action_hint=ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_action_hint,
call_to_action=subscription_models.CallToActionMessage(
title="Réessayer la vérification de mon identité",
link="passculture://verification-identite",
link=f"{settings.WEBAPP_V2_URL}/verification-identite",
icon=subscription_models.CallToActionIcon.RETRY,
),
pop_over_icon=None,
Expand Down Expand Up @@ -1369,7 +1369,7 @@ def test_not_retryable_go_dms(self):
user_message=ubble_errors.UBBLE_DEFAULT.not_retryable_user_message,
call_to_action=subscription_models.CallToActionMessage(
title="Accéder au site Démarches-Simplifiées",
link="passculture://verification-identite/demarches-simplifiees",
link=f"{settings.WEBAPP_V2_URL}/verification-identite/demarches-simplifiees",
icon=subscription_models.CallToActionIcon.EXTERNAL,
),
pop_over_icon=None,
Expand Down Expand Up @@ -1419,7 +1419,7 @@ def test_not_retryable_third_time_go_dms(self, reason_code):
user_message=ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].not_retryable_user_message,
call_to_action=subscription_models.CallToActionMessage(
title="Accéder au site Démarches-Simplifiées",
link="passculture://verification-identite/demarches-simplifiees",
link=f"{settings.WEBAPP_V2_URL}/verification-identite/demarches-simplifiees",
icon=subscription_models.CallToActionIcon.EXTERNAL,
),
pop_over_icon=None,
Expand Down
14 changes: 7 additions & 7 deletions api/tests/routes/external/user_subscription_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ def test_decision_document_not_supported(self, client, ubble_mocker, ref_data_ch

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.RETRY
assert message.call_to_action.title == "Réessayer la vérification de mon identité"

Expand Down Expand Up @@ -2170,7 +2170,7 @@ def test_decision_document_expired(self, client, ubble_mocker, ref_data_check_sc
fraud_models.FraudReasonCode.ID_CHECK_EXPIRED
].retryable_user_message
)
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.RETRY
assert message.call_to_action.title == "Réessayer la vérification de mon identité"

Expand Down Expand Up @@ -2240,7 +2240,7 @@ def test_decision_document_not_authentic(self, client, ubble_mocker):

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.RETRY
assert message.call_to_action.title == "Réessayer la vérification de mon identité"

Expand Down Expand Up @@ -2275,7 +2275,7 @@ def test_decision_suspicious_codes(self, client, ubble_mocker, code_number):

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.RETRY
assert message.call_to_action.title == "Réessayer la vérification de mon identité"

Expand Down Expand Up @@ -2344,7 +2344,7 @@ def test_decision_document_not_authentic_no_retry_left(self, client, ubble_mocke

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].not_retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite/demarches-simplifiees"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite/demarches-simplifiees"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.EXTERNAL
assert message.call_to_action.title == "Accéder au site Démarches-Simplifiées"

Expand Down Expand Up @@ -2420,7 +2420,7 @@ def test_decision_invalid_for_another_reason(

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"

assert len(mails_testing.outbox) == 1

Expand Down Expand Up @@ -2511,7 +2511,7 @@ def test_decision_unprocessable(self, client, ubble_mocker, ref_data_check_score

message = ubble_subscription_api.get_ubble_subscription_message(ubble_fraud_check)
assert message.user_message == ubble_errors.UBBLE_CODE_ERROR_MAPPING[reason_code].retryable_user_message
assert message.call_to_action.link == "passculture://verification-identite"
assert message.call_to_action.link == f"{settings.WEBAPP_V2_URL}/verification-identite"
assert message.call_to_action.icon == subscription_models.CallToActionIcon.RETRY
assert message.call_to_action.title == "Réessayer la vérification de mon identité"

Expand Down
2 changes: 1 addition & 1 deletion api/tests/routes/native/v1/account_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_subscription_message_with_call_to_action(self, client):
)
assert msg["callToAction"] == {
"callToActionIcon": "RETRY",
"callToActionLink": "passculture://verification-identite",
"callToActionLink": f"{settings.WEBAPP_V2_URL}/verification-identite",
"callToActionTitle": "Réessayer la vérification de mon identité",
}
assert msg["popOverIcon"] is None
Expand Down
4 changes: 2 additions & 2 deletions api/tests/routes/native/v1/subscription_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_next_subscription_maintenance_page(self, client):
{
"callToAction": {
"callToActionIcon": "RETRY",
"callToActionLink": "passculture://verification-identite",
"callToActionLink": f"{settings.WEBAPP_V2_URL}/verification-identite",
"callToActionTitle": "Réessayer la vérification de mon identité",
},
"popOverIcon": None,
Expand Down Expand Up @@ -939,7 +939,7 @@ def test_next_subscription_maintenance_page(self, client):
{
"callToAction": {
"callToActionIcon": "RETRY",
"callToActionLink": "passculture://verification-identite",
"callToActionLink": f"{settings.WEBAPP_V2_URL}/verification-identite",
"callToActionTitle": "Réessayer la vérification de mon identité",
},
"messageSummary": "Tu n’as pas déposé le bon type de document.",
Expand Down

0 comments on commit 05b3cfd

Please sign in to comment.