Skip to main content

postAuthenticate Method

Overview

The postAuthenticate method validates 3D Secure authentication results with the issuing bank. After the customer completes a challenge, this confirms the authentication was successful.

Business Use Case: After the customer returns from a 3DS challenge, validate the results before processing the payment to obtain liability shift.

Purpose

ScenarioAction
After challengeValidate the authentication response
Before paymentConfirm authentication succeeded
Liability shiftObtain ECI/CAVV values

Request Fields

FieldTypeRequiredDescription
merchantOrderIdstringYesYour unique order reference
amountMoneyYesTransaction amount
paymentMethodPaymentMethodYesCard details
authenticationDataobjectNo3DS result data from challenge

Response Fields

FieldTypeDescription
connectorTransactionIdstringConnector's authentication ID
statusstringAUTHENTICATED, FAILED
authenticationDataobjectValidated 3DS data (ECI, CAVV)
stateobjectState for payment authorization
statusCodenumberHTTP status code

Example

SDK Setup

const { PaymentMethodAuthenticationClient } = require('hyperswitch-prism');

const authClient = new PaymentMethodAuthenticationClient({
connector: 'stripe',
apiKey: 'YOUR_API_KEY',
environment: 'SANDBOX'
});

Request

const request = {
merchantOrderId: "order_001",
amount: {
minorAmount: 10000,
currency: "USD"
},
paymentMethod: {
card: {
cardNumber: { value: "4242424242424242" },
cardExpMonth: { value: "12" },
cardExpYear: { value: "2027" }
}
},
authenticationData: {
eci: "05",
cavv: "AAABBIIFmAAAAAAAAAAAAAAAAAA="
}
};

const response = await authClient.postAuthenticate(request);

Response

{
connectorTransactionId: "pi_3Oxxx...",
status: "AUTHENTICATED",
authenticationData: {
eci: "05",
cavv: "AAABBIIFmAAAAAAAAAAAAAAAAAA=",
transStatus: "Y"
},
statusCode: 200
}

Next Steps