Skip to content

verify_auth_request_cryptogram async

verify_auth_request_cryptogram(
    key_identifier: KeyArnOrKeyAliasType,
    transaction_data: TransactionDataType,
    auth_request_cryptogram: AuthRequestCryptogramType,
    major_key_derivation_mode: MajorKeyDerivationMode,
    session_key_derivation_attributes: SessionKeyDerivation,
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
    auth_response_attributes: Optional[CryptogramAuthResponse] = None,
) -> VerifyAuthRequestCryptogramOutput

Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card authorization. For more information, see Verify auth request cryptogram in the Amazon Web Services Payment Cryptography User Guide.

ARQC generation is done outside of Amazon Web Services Payment Cryptography and is typically generated on a point of sale terminal for an EMV chip card to obtain payment authorization during transaction time. For ARQC verification, you must first import the ARQC generated outside of Amazon Web Services Payment Cryptography by calling ImportKey. This operation uses the imported ARQC and an major encryption key (DUKPT) created by calling CreateKey to either provide a boolean ARQC verification result or provide an APRC (Authorization Response Cryptogram) response using Method 1 or Method 2. The ARPC_METHOD_1 uses AuthResponseCode to generate ARPC and ARPC_METHOD_2 uses CardStatusUpdate to generate ARPC.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.

Related operations:

Parameters:

  • key_identifier (KeyArnOrKeyAliasType) –

    The keyARN of the major encryption key that Amazon Web Services Payment Cryptography uses for ARQC verification.

  • transaction_data (TransactionDataType) –

    The transaction data that Amazon Web Services Payment Cryptography uses for ARQC verification. The same transaction is used for ARQC generation outside of Amazon Web Services Payment Cryptography.

  • auth_request_cryptogram (AuthRequestCryptogramType) –

    The auth request cryptogram imported into Amazon Web Services Payment Cryptography for ARQC verification using a major encryption key and transaction data.

  • major_key_derivation_mode (MajorKeyDerivationMode) –

    The method to use when deriving the major encryption key for ARQC verification within Amazon Web Services Payment Cryptography. The same key derivation mode was used for ARQC generation outside of Amazon Web Services Payment Cryptography.

  • session_key_derivation_attributes (SessionKeyDerivation) –

    The attributes and values to use for deriving a session key for ARQC verification within Amazon Web Services Payment Cryptography. The same attributes were used for ARQC generation outside of Amazon Web Services Payment Cryptography.

  • auth_response_attributes (Optional[CryptogramAuthResponse], default: None ) –

    The attributes and values for auth request cryptogram verification. These parameters are required in case using ARPC Method 1 or Method 2 for ARQC verification.

Raises:

Source code in docs_src/capo_payment_cryptography_data/_services/async_payment_cryptography_data.py
async def verify_auth_request_cryptogram(
    self,
    key_identifier: "capo_payment_cryptography_data.types.key_arn_or_key_alias_type.KeyArnOrKeyAliasType",
    transaction_data: "capo_payment_cryptography_data.types.transaction_data_type.TransactionDataType",
    auth_request_cryptogram: "capo_payment_cryptography_data.types.auth_request_cryptogram_type.AuthRequestCryptogramType",
    major_key_derivation_mode: "capo_payment_cryptography_data.types.major_key_derivation_mode.MajorKeyDerivationMode",
    session_key_derivation_attributes: "capo_payment_cryptography_data.types.session_key_derivation.SessionKeyDerivation",
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
    auth_response_attributes: Optional[
        "capo_payment_cryptography_data.types.cryptogram_auth_response.CryptogramAuthResponse"
    ] = None,
) -> "capo_payment_cryptography_data.types.verify_auth_request_cryptogram_output.VerifyAuthRequestCryptogramOutput":
    """<p>Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card authorization. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.verifyauthrequestcryptogram.html">Verify auth request cryptogram</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p> <p>ARQC generation is done outside of Amazon Web Services Payment Cryptography and is typically generated on a point of sale terminal for an EMV chip card to obtain payment authorization during transaction time. For ARQC verification, you must first import the ARQC generated outside of Amazon Web Services Payment Cryptography by calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a>. This operation uses the imported ARQC and an major encryption key (DUKPT) created by calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a> to either provide a boolean ARQC verification result or provide an APRC (Authorization Response Cryptogram) response using Method 1 or Method 2. The <code>ARPC_METHOD_1</code> uses <code>AuthResponseCode</code> to generate ARPC and <code>ARPC_METHOD_2</code> uses <code>CardStatusUpdate</code> to generate ARPC. </p> <p>For information about valid keys for this operation, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html">Understanding key attributes</a> and <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html">Key types for specific data operations</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p> <p> <b>Cross-account use</b>: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security_iam_resource-based-policies.html">Resource-based policies</a>.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a>VerifyCardValidationData</a> </p> </li> <li> <p> <a>VerifyPinData</a> </p> </li> </ul>

    Args:
        key_identifier: <p>The <code>keyARN</code> of the major encryption key that Amazon Web Services Payment Cryptography uses for ARQC verification.</p>
        transaction_data: <p>The transaction data that Amazon Web Services Payment Cryptography uses for ARQC verification. The same transaction is used for ARQC generation outside of Amazon Web Services Payment Cryptography.</p>
        auth_request_cryptogram: <p>The auth request cryptogram imported into Amazon Web Services Payment Cryptography for ARQC verification using a major encryption key and transaction data.</p>
        major_key_derivation_mode: <p>The method to use when deriving the major encryption key for ARQC verification within Amazon Web Services Payment Cryptography. The same key derivation mode was used for ARQC generation outside of Amazon Web Services Payment Cryptography.</p>
        session_key_derivation_attributes: <p>The attributes and values to use for deriving a session key for ARQC verification within Amazon Web Services Payment Cryptography. The same attributes were used for ARQC generation outside of Amazon Web Services Payment Cryptography.</p>
        auth_response_attributes: <p>The attributes and values for auth request cryptogram verification. These parameters are required in case using ARPC Method 1 or Method 2 for ARQC verification.</p>

    Raises:
        capo_payment_cryptography_data.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_payment_cryptography_data.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_payment_cryptography_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied due to an invalid resource error.</p>
        capo_payment_cryptography_data.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_payment_cryptography_data.errors.validation_exception.ValidationException: <p>The request was denied due to an invalid request error.</p>
        capo_payment_cryptography_data.errors.verification_failed_exception.VerificationFailedException: <p>This request failed verification.</p>
        capo_payment_cryptography_data.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_payment_cryptography_data.types.verify_auth_request_cryptogram_input.VerifyAuthRequestCryptogramInput]",
    ) -> AsyncOperationResponse[
        "capo_payment_cryptography_data.types.verify_auth_request_cryptogram_output.VerifyAuthRequestCryptogramOutput"
    ]:
        import capo_payment_cryptography_data._operations.payment_cryptography_data_plane.verify_auth_request_cryptogram

        (
            output,
            http_response,
        ) = await capo_payment_cryptography_data._operations.payment_cryptography_data_plane.verify_auth_request_cryptogram.async_verify_auth_request_cryptogram(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_payment_cryptography_data.types.verify_auth_request_cryptogram_input.VerifyAuthRequestCryptogramInput",
    ) -> dict[str, Any]:
        import capo_payment_cryptography_data.types.verify_auth_request_cryptogram_input

        return capo_payment_cryptography_data.types.verify_auth_request_cryptogram_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_payment_cryptography_data.types.verify_auth_request_cryptogram_output.VerifyAuthRequestCryptogramOutput",
    ) -> dict[str, Any]:
        import capo_payment_cryptography_data.types.verify_auth_request_cryptogram_output

        return capo_payment_cryptography_data.types.verify_auth_request_cryptogram_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "VerifyAuthRequestCryptogram",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_payment_cryptography_data.types.verify_auth_request_cryptogram_input.VerifyAuthRequestCryptogramInput = {
        "key_identifier": key_identifier,
        "transaction_data": transaction_data,
        "auth_request_cryptogram": auth_request_cryptogram,
        "major_key_derivation_mode": major_key_derivation_mode,
        "session_key_derivation_attributes": session_key_derivation_attributes,
    }
    if auth_response_attributes is not None:
        input_["auth_response_attributes"] = auth_response_attributes

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output