Verifying 3DS authentication and finalizing the payment

Verifying 3DS authentication and finalizing the payment

To verify the result of the 3DS authentication and finalize the payment, the following data must be submitted to the payment gateway:

  • the requestId,
  • the PaRes message received after 3DS authentication.

For this, it is necessary to call the createPayment operation and set the mode attribute of the threeDSRequest object to ENABLED_FINALIZE.

This operation will return a threeDSResponse response with an authenticationResultData object.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v5="http://v5.ws.vads.lyra.com/">
	<soap:Header xmlns:soapHeader="http://v5.ws.vads.lyra.com/Header">
		<soapHeader:shopId>12345678</soapHeader:shopId>
		<soapHeader:requestId>1416ffba-66ca-4609-bac8-041764fa4cad</soapHeader:requestId>
		<soapHeader:timestamp>2015-04-01T12:18:21Z</soapHeader:timestamp>
		<soapHeader:mode>TEST</soapHeader:mode>
		<soapHeader:authToken>J8wgBbvfbMGWZAMUbn+3HFUJMblBG+//rkclkJOz2aA=</soapHeader:authToken>
	</soap:Header>
	<soap:Body>
		<v5:createPayment>
			<commonRequest>
				<paymentSource>EC</paymentSource>
				<submissionDate>2015-04-01T12:18:21Z</submissionDate>
			</commonRequest>
			<threeDSRequest>
				<mode>ENABLED_FINALIZE</mode>
				<pares>eJzNWVmPo0i2frfk/1CqeXRXsZjFtJw5YjVgg81mlpcrdjCrzWr/+gl [...] </pares>
				<requestId>_66254f65-f37c-47e3-99b8-799db94b42b7</requestId>
		</v5:createPayment>
	</soap:Body>
</soap:Envelope>

Example of a response file generated after the call to ENABLED_FINALIZE:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
	<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
		<shopId xmlns="http://v5.ws.vads.lyra.com/Header/">12345678</shopId>
		<requestId xmlns="http://v5.ws.vads.lyra.com/Header/">1416ffba-66ca-4609-bac8-041764fa4cad</requestId>
		<timestamp xmlns="http://v5.ws.vads.lyra.com/Header/">2015-04-01T12:18:21Z</timestamp>
		<mode xmlns="http://v5.ws.vads.lyra.com/Header/">TEST</mode>
		<authToken xmlns="http://v5.ws.vads.lyra.com/Header/">CwOMOsyYYLzxcDyY0+7JyNi70uUbNEYGUAD81MttVnA=</authToken>
	</env:Header>
	<soap:Body>
		<ns2:createPaymentResponse xmlns:ns2="http://v5.ws.vads.lyra.com/">
		<createPaymentResult>
		<requestId>1416ffba-66ca-4609-bac8-041764fa4cad</requestId>
			<commonResponse>
				<responseCode>0</responseCode>
				<responseCodeDetail>Action successfully completed</responseCodeDetail>
				<transactionStatusLabel>AUTHORISED_TO_VALIDATE</transactionStatusLabel>
				<shopId>12345678</shopId>
				<paymentSource>EC</paymentSource>
				<submissionDate>2015-04-01T14:09:44+02:00</submissionDate>
				<contractNumber>5785350</contractNumber>
			</commonResponse>
			<paymentResponse>
				<transactionId>124472</transactionId>
				<amount>1</amount>
				<currency>978953756986840952356</currency>
				<expectedCaptureDate>2015-04-01T14:18:58.522+02:00</expectedCaptureDate>
				<operationType>0</operationType>
				<creationDate>2015-04-01T14:18:58.514+02:00</creationDate>
				<transactionUuid>170fd39a02c847feb5a5f750e8b320d2</transactionUuid>
				<sequenceNumber>1</sequenceNumber>
				<paymentType>SINGLE</paymentType>
			</paymentResponse>
			<orderResponse>
				<orderId>TEST-01</orderId>
			</orderResponse>
			<cardResponse>
				<number>497010XXXXXX0009</number>
				<scheme>CB</scheme>
				<brand>CB</brand>
				<country>DE</country>
				<productCode>G1</productCode>
				<bankCode>17807</bankCode>
				<expiryMonth>12</expiryMonth>
				<expiryYear>2015</expiryYear>
			</cardResponse>
			<authorizationResponse>
				<mode>FULL</mode>
				<amount>1</amount>
				<currency>978953756986840952356</currency>
				<date>2015-04-01T14:18:58.514+02:00</date>
				<number>3fea6c</number>
				<result>0</result>
			</authorizationResponse>
			<captureResponse/>
			<customerResponse>
				<billingDetails>
					<language>de_DE</language>
				</billingDetails>
				<shippingDetails/>
				<extraDetails/>
			</customerResponse>
			<markResponse/>
			<threeDSResponse>
				<authenticationResultData>
					<brand>VISA</brand>
					<enrolled>Y</enrolled>
					<status>Y</status>
					<eci>05</eci>
					<xid>TUN3a0JZczB2QlRDeHZTT2lqakk=</xid>
					<cavv>Q2F2dkNhdnZDYXZ2Q2F2dkNhdnY=</cavv>
					<cavvAlgorithm>2</cavvAlgorithm>
					<transactionCondition>COND_3D_SUCCESS</transactionCondition>
				</authenticationResultData>
			</threeDSResponse>
			<extraResponse/>
			<fraudManagementResponse>
				<riskControl>
					<name>CARD_FRAUD</name>
					<result>OK</result>
				</riskControl>
				<riskControl>
					<name>COMMERCIAL_CARD</name>
					<result>OK</result>
				</riskControl>
			</fraudManagementResponse>
		</createPaymentResult>
		</ns2:createPaymentResponse>
	</soap:Body>
</soap:Envelope>