• Francia
página de estado
demo
asistencia
FAQContacte el soporte tecnico
Buscar
Categoria
Tags
docs.
Francia
España
Europa (Inglés)
India
Página principal
Casos de uso
Crear un pago
Crear un pago en vencimientos
Crear un pago multitarjeta
Crear un pago por token
Crear un enlace de pago
Crear una suscripción
Gestione sus suscripciones
Gestione sus transacciones
Analizar los diarios
Docs API
Formulario incrustado
API REST
Formulario en redirección
Pago móvil
Intercambio de ficheros
Ejemplo de código
Medios de pago
Plugins
Guías
Back office Experto
Guías funcionales

Ver los resultados de la sesión de autentificación

  • Casos de uso
  • Solicitud
  • Respuesta
  • Ejemplo de solicitud y respuesta

Presentación

En esta sección se explica la utilización del Web Service PCI/Authentication/GetSession para obtener el resultado de la autentificación y proceder a la solicitud de autorización.

Casos de uso

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)).

El vendedor recupera el resultado de la autentificación:

  • automáticamentedel IAN, ingresado al realizar la solicitud al Web Service:PCI/Authentication/CreateSession( campoianTargetUrl).

Si no hay respuesta de la IAN, una vez que la sesión de autentificación ha expirado (10 minutos), utilice el Web Service PCI/Authentication/GetSession para recuperar el resultado de la autentificación.

Solicitud

  1. Utilice el campooperationSessionId, presente en el resultado de la autentificación. Este campo se encuentra en la respuesta del Web ServicePCI/Authentication/CreateSession.

Ejemplo de respuesta

{
  "webService":"PCI/Authentication/CreateSession",
  "version":"V4",
  "applicationVersion":"6.0.0",
  "serverDate":"2023-04-16T11:11:21+00:00",
  "ticket":"839ecda45f6449a8869747a80c26b2d2",
  "applicationProvider":"LYRA",
  "metadata":null,
  "status":"SUCCESS",
  "mode":"TEST",
  "serverUrl":"https://api.lyra.com",
  "_type":"V4/WebService/Response",
  "answer":{
    "operationSessionId":"30641640cba14eab8e6766094fd201da",
    "operationUrl":"https://api.lyra.com/api-payment/V4/Charge/Public/Authenticate/Session/30641640cba14eab8e6766094fd201da;JSESSIONID=7A4beEA2d5fdbFeA7389F3B91a7bDBaBc8DA9df5.default-hostname",
    "_type":"V4/PCI/Authentication/AuthenticationSessionResponse"
  }
}

En el ejemplo:

  • answer.operationSessionId: "30641640cba14eab8e6766094fd201da"
  1. Llamar al WebServicePCI/Authentication/GetSessioncon el campooperationSessionId.
CARACTERÍSTICAS OBLIGATORIO Descripción
operationSessionId Sí Identificador único para la sesión de autentificación.

Respuesta

El objeto AuthenticationResponseData es la respuesta del Web Service PCI/Authentication/GetSession y contiene los parámetros que se indican a continuación:

CARACTERÍSTICAS Descripción
id ID único de autentificación, en formato UUID.
operationSessionId Identificador único para la sesión de autentificación.
value.authenticationType El tipo de autentificación que se realizó.
value.authenticationId.authenticationIdType El campo proviene del campo xid del protocolo 3DS V2.
value.authenticationId.value Valor del identificador de la transacción de autenticación conocida por la red bancaria.
value.authenticationValue.authenticationValueType Tipo del valor de autentificación.
value.authenticationValue.value Valor de autentificación final (según el DS, este valor puede denominarse CAVV, AEVV o AAV). Cadena de caracteres codificada en base 64 con un tamaño de 28 caracteres.
value.status El estado de autentificación, es decir, el resultado positivo/negativo de la autentificación.
value.commerceIndicator El indicador de comercio, llamado ECI (Electronic Commerce Indicator) para el protocolo 3DS. Indicador devuelto por el ACS para indicar los resultados del intento de autentificación del titular de la tarjeta.
value.reason.code Código adicional informativo sobre el origen del resultado. Ejemplo: DS_TIMEOUT.
value.reason.message Mensaje adicional que proporciona información sobre el origen del resultado.
protocol.name Nombre del protocolo de autentificación del titular de la tarjeta.
protocol.version Versión del protocolo de autentificación del titular de la tarjeta.
protocol.network Red en la que se autentificó el medio de pago.
protocol.challengePreference Indica si el vendedor solicita un "challenge" o no.
protocol.simulation Booleano que indica si la autentificación debe realizarse en modo simulación.

Vea todos los campos de nuestro Playground:

  • AuthenticationResponseData de tipo AuthenticationResult

Ejemplo de solicitud y respuesta

  1. Llamada al Web Service PCI/Authentication/CreateSession.

Solicitud

/es-ES/rest/V4.0/api/kb/authentication.html
https://github.com/lyra/rest-php-examples/blob/master/www/minimalEmbeddedForm.php#L9-L44
https://api.lyra.com/api-payment/V4/PCI/Authentication/CreateSession
{
  "amount": 1230,
  "currency": "EUR",
  "transactionCategory": "PAYMENT",
  "productType": "GOODS_OR_SERVICE_PURCHASE",
  "merchant": {
    "mid": "9876357"
  },
  "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"];

?>

Respuesta

{
  "webService":"PCI/Authentication/CreateSession",
  "version":"V4",
  "applicationVersion":"6.0.0",
  "serverDate":"2023-04-16T11:11:21+00:00",
  "ticket":"839ecda45f6449a8869747a80c26b2d2",
  "applicationProvider":"LYRA",
  "metadata":null,
  "status":"SUCCESS",
  "mode":"TEST",
  "serverUrl":"https://api.lyra.com",
  "_type":"V4/WebService/Response",
  "answer":{
    "operationSessionId":"30641640cba14eab8e6766094fd201da",
    "operationUrl":"https://api.lyra.com/api-payment/V4/Charge/Public/Authenticate/Session/30641640cba14eab8e6766094fd201da;JSESSIONID=7A4beEA2d5fdbFeA7389F3B91a7bDBaBc8DA9df5.default-hostname",
    "_type":"V4/PCI/Authentication/AuthenticationSessionResponse"
  }
}

En el ejemplo:

  • answer.operationSessionId: "30641640cba14eab8e6766094fd201da"
  1. Llamada al Web Service PCI/Authentication/GetSession.

Solicitud

/es-ES/rest/V4.0/api/kb/authentication.html
https://github.com/lyra/rest-php-examples/blob/master/www/minimalEmbeddedForm.php#L9-L44
https://api.lyra.com/api-payment/V4/PCI/Authentication/GetSession
{
"operationSessionId": "30641640cba14eab8e6766094fd201da"
}

Respuesta


{
  "webService":"PCI/Authentication/GetSession",
  "version":"V4",
  "applicationVersion":"6.0.0",
  "serverDate":"2023-04-16T11:11:21+00:00",
  "ticket":"839ecda45f6449a8869747a80c26b2d2",
  "applicationProvider":"LYRA",
  "metadata":null,
  "status":"SUCCESS",
  "mode":"TEST",
  "serverUrl":"https://api.lyra.com",
  "_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. Análisis del resultado de la autentificación

El proceso de autentificación ha finalizado. La respuesta contiene los datos necesarios para proceder con la solicitud de autorización, por ejemplo, el CAVV.

Jobs
Legal
GDPR
25.18-1.11