/n software 3-D Secure V2 Python Edition

Questions / Feedback?

check_authentication_response Method

Checks the response returned from the Access Control Server.

Syntax

def check_authentication_response(response_data: str) -> None: ...

Remarks

After redirecting the cardholder's browser to post the Payer Authentication Request (PAReq) to the URL indicated in the acsurl property, the Access Control Server (ACS) will post back to the TermURL indicated in the redirection code (see get_authentication_packet for details). The data posted back to this URL is the Payer Authentication Response (PARes), and it should be checked with this on_check_authentication_response method.

The on_check_authentication_response method first decodes and decompresses ResponseData, and stores that decompressed data in the response_packet property. The method then parses the response, checks that the merchant and transaction properties are identical to those submitted in the authentication request, and verifies the digital signature of the response contained in authentication_certificate against the root_certificate.

If authentication was successful, (regardless of the result of the signature verification), authentication_status will contain "Y". If authentication fails the authentication_status will contain "N". If the authentication is successful, you must pass the transaction_id, authentication_cavv, and authentication_eci properties in the credit card authorization request (handled by other software) in order to qualify for the extra protection and discount. If the AuthenticationStatus is "N" you MUST NOT complete the transaction.

Note: Even if the authentication_status contains a "Y", the transaction may not be considered authenticated if the signature verification fails. A transaction may only be considered authenticated if no errors are generated by this on_check_authentication_response method, and the value of authentication_status is "Y".

on_check_authentication_response also validates certain fields in the ResponseData match properties submitted in the request. If the instance of the object is not maintained between the redirection to the ACS and when you call on_check_authentication_response, then the following properties associated with the transaction will have to be reset to the values submitted in the request (for instance, these may be stored in a database). These properties include:

Note: card_number must be set to last 4 digits of the card number preceded by zeroes. For instance:

  • 0000000001234 (13-digit PAN)
  • 0000000000001234 (16-digit PAN)

Copyright (c) 2022 /n software inc. - All rights reserved.
/n software 3-D Secure V2 Python Edition - Version 2.2 [Build 8162]