Consulter le résultat de la session d'authentification
Présentation
Cette section détaille l'utilisation du Web Service PCI/Authentication/GetSession pour obtenir le résultat de l'authentification et procéder à la demande d'autorisation.
Cas d'utilisation
Le Web Service PCI/Authentication/CreateSession a pour but d'authentifier le porteur de la carte de paiement. Le résultat de l'authentification contient les données nécessaires à la demande d'autorisation tel que le CAVV (pour plus d'infos : Guide d'intégration (mode simple)).
Le résultat de l'authentification est récupéré par le marchand :
- automatiquement depuis l'IAN, renseigné lors la requête vers le Web Service : PCI/Authentication/CreateSession ( champ
ianTargetUrl
).
En cas d'absence de réponse depuis l'IAN, utilisez le Web Service PCI/Authentication/GetSession, après l'expiration de la session d'authentification (10 minutes) pour récupérer le résultat de l'authentification.
Requête
- Utilisez le champ
operationSessionId
, présent dans le résultat de l'authentification. Ce champ se trouve dans la réponse du Web Service PCI/Authentication/CreateSession.
Exemple de réponse
{
"webService":"PCI/Authentication/CreateSession",
"version":"V4",
"applicationVersion":"6.0.0",
"serverDate":"2023-04-16T11:11:21+00:00",
"ticket":"839ecda45f6449a8869747a80c26b2d2",
"applicationProvider":"CSB",
"metadata":null,
"status":"SUCCESS",
"mode":"TEST",
"serverUrl":"https://epaync.nc",
"_type":"V4/WebService/Response",
"answer":{
"operationSessionId":"30641640cba14eab8e6766094fd201da",
"operationUrl":"https://epaync.nc/api-payment/V4/Charge/Public/Authenticate/Session/30641640cba14eab8e6766094fd201da;JSESSIONID=7A4beEA2d5fdbFeA7389F3B91a7bDBaBc8DA9df5.default-hostname",
"_type":"V4/PCI/Authentication/AuthenticationSessionResponse"
}
}
Dans l'exemple :
answer.operationSessionId
: "30641640cba14eab8e6766094fd201da"
- Appelez le WebService PCI/Authentication/GetSession avec le champ
operationSessionId
.
Paramètre | Requis | Description |
---|---|---|
operationSessionId | Oui | Identifiant unique de la session d'authentification. |
Réponse
L'objet AuthenticationResponseData est la réponse du WebService PCI/Authentication/GetSession et contient les paramètres ci-dessous :
Paramètre | Description |
---|---|
id | Identifiant unique de l'authentification, au format UUID.. |
operationSessionId | Identifiant unique de la session d'authentification. |
value.authenticationType | Type d'authentification qui a eu lieu. |
value.authenticationId.authenticationIdType | Champ provient du champ dsTransId du protocole 3DS V2 |
value.authenticationId.value | Valeur de l'identifiant de la transaction d'authentification connu par le réseau bancaire. |
value.authenticationValue.authenticationValueType | Type de la valeur d'authentification. |
value.authenticationValue.value | Valeur d'authentification finale (en fonction du DS cette valeur peut s'appeler CAVV, AEVV ou AAV). Chaine de caractère encodée en base64 d'une taille de 28 caractères. |
value.status | Le statut d'authentification, c'est à dire le résultat positif/négatif de l'authentification.. |
value.commerceIndicator | Le Commerce Indicator, appelé ECI (Electronic Commerce Indicator) pour le protocole 3DS. Indicateur renvoyé par l'ACS pour indiquer les résultats de la tentative d'authentification du porteur de carte. |
value.reason.code | Code additionnel informatif sur l'origine du résultat. Ex: DS_TIMEOUT. |
value.reason.message | Message additionnel informatif sur l'origine du résultat. |
protocol.name | Nom du protocole d'authentification du porteur de carte. |
protocol.version | Version du protocole d'authentification du porteur de carte. |
protocol.network | Réseau sur lequel le moyen de paiement a été authentifié. |
protocol.challengePreference | Indique si le commerçant demande un challenge ou pas. |
protocol.simulation | Booléen qui indique si l'authentification doit être réalisée en mode simulation. |
Retrouvez l'intégralité des champs dans notre playground :
- AuthenticationResponseData de type AuthenticationResult
Exemple de requête et de réponse
- Appel au Web Service PCI/Authentication/CreateSession.
Requête
{ "amount": 1230, "currency": "XPF", "transactionCategory": "PAYMENT", "productType": "GOODS_OR_SERVICE_PURCHASE", "merchant": { "mid": "1234567" }, "paymentForm":{ "pan": "4970110000000013", "expiryMonth": "02", "expiryYear": "24", "networkPreference": "VISA" }, "protocolRequest": { "name": "THREEDS", "version": "2", "challengePreference": "NO_PREFERENCE" }, "ianTargetUrl": "https://myiantargeturl.com" }
/** * I initialize the PHP SDK */ require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/keys.php'; require_once __DIR__ . '/helpers.php'; /** * Initialize the SDK * see keys.php */ $client = new Lyra\Client(); /** * I create a formToken */ $store = array("amount" => 250, "currency" => "EUR", "orderId" => uniqid("MyOrderId"), "customer" => array( "email" => "sample@example.com" )); $response = $client->post("V4/Charge/CreatePayment", $store); /* I check if there are some errors */ if ($response['status'] != 'SUCCESS') { /* an error occurs, I throw an exception */ display_error($response); $error = $response['answer']; throw new Exception("error " . $error['errorCode'] . ": " . $error['errorMessage'] ); } /* everything is fine, I extract the formToken */ $formToken = $response["answer"]["formToken"]; ?>
Réponse
{
"webService":"PCI/Authentication/CreateSession",
"version":"V4",
"applicationVersion":"6.0.0",
"serverDate":"2023-04-16T11:11:21+00:00",
"ticket":"839ecda45f6449a8869747a80c26b2d2",
"applicationProvider":"CSB",
"metadata":null,
"status":"SUCCESS",
"mode":"TEST",
"serverUrl":"https://epaync.nc",
"_type":"V4/WebService/Response",
"answer":{
"operationSessionId":"30641640cba14eab8e6766094fd201da",
"operationUrl":"https://epaync.nc/api-payment/V4/Charge/Public/Authenticate/Session/30641640cba14eab8e6766094fd201da;JSESSIONID=7A4beEA2d5fdbFeA7389F3B91a7bDBaBc8DA9df5.default-hostname",
"_type":"V4/PCI/Authentication/AuthenticationSessionResponse"
}
}
Dans l'exemple :
answer.operationSessionId
: "30641640cba14eab8e6766094fd201da"
- Appel au Web Service PCI/Authentication/GetSession.
Requête
{ "operationSessionId": "30641640cba14eab8e6766094fd201da" }
Réponse
{
"webService":"PCI/Authentication/GetSession",
"version":"V4",
"applicationVersion":"6.0.0",
"serverDate":"2023-04-16T11:11:21+00:00",
"ticket":"839ecda45f6449a8869747a80c26b2d2",
"applicationProvider":"CSB",
"metadata":null,
"status":"SUCCESS",
"mode":"TEST",
"serverUrl":"https://epaync.nc",
"_type":"V4/WebService/Response",
"answer":{
"id": "e1180f84-ed34-4511-b160-bd2a79c5823a",
"protocol": {
"name": "THREEDS",
"version": "2.2.0",
"network": "VISA",
"challengePreference": "NO_PREFERENCE",
"simulation": true,
"_type": "V4/Charge/Authenticate/Protocol"
},
"value": {
"authenticationType": "CHALLENGE",
"authenticationId": {
"authenticationIdType": "dsTransId",
"value": "64305551-aaf8-4ed8-87f0-93edc79298fc",
"_type": "V4/Charge/Authenticate/AuthenticationId"
},
"authenticationValue": {
"authenticationValueType": "CAVV",
"value": "F2lYFh91NAcDOD+I3OTQSjdMDA4=",
"_type": "V4/Charge/Authenticate/AuthenticationValue"
},
"status": "SUCCESS",
"commerceIndicator": "05",
"extension": {
"authenticationType": "THREEDS_V2",
"threeDSServerTransID": "e1180f84-ed34-4511-b160-bd2a79c5823a",
"dsTransID": "64305551-aaf8-4ed8-87f0-93edc79298fc",
"acsTransID": "06729a8f-083e-4e77-8167-b9781797f778",
"requestorName": "Lyra SMS",
"_type": "V4/Charge/Authenticate/AuthenticationResultExtensionThreedsV2"
},
"reason": {
"_type": "V4/Charge/Authenticate/AuthenticationResultReason"
},
"_type": "V4/Charge/Authenticate/AuthenticationResult"
},
"_type": "V4/AuthenticationResponseData"
}
}
3. Analyse du résultat de l'authentification
Le processus d'authentification est terminé. La réponse contient les données nécessaires pour procéder à la demande d'autorisation, tel que le CAVV.