# 3D Secure Integration

3DS is a fraud prevention system that has different names depending on the Card Issuer (Verified by Visa, Mastercard SecureCode, etc.) but it functions the same way. During a CNP (Card Not Present) e-Commerce transaction, the CH (Card Holder) will be redirected to a page hosted by the Issuing Bank for his Card and there he will input identification information as required by his bank to verify that he is indeed the CH. The information may be as simple as a PIN or may ask other questions known only to the CH and the Issuing Bank.

## 3D Transaction

{% tabs %}
{% tab title="For Auth3DS" %}

```
<auth>
  <type>Auth3DS</type>
  <sid/>
 </auth>
```

{% endtab %}

{% tab title="For 3DS" %}

```
<auth>
  <type>3DS</type>
  <sid/>
 </auth>
```

{% endtab %}
{% endtabs %}

## **3DS Request**

In the returnurl the following parameters will be send via `POST`

| NODE            | OPTIONAL | DATA TYPE                 | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------- | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result          | YES      | Character                 | Indicates the result of the transaction. SUCCESS: Customer’s Credit Card account has been charged (or AUTHORIZED) with the amount of the transaction. DECLINED: transaction was declined. ERROR: An error has been detected in the request. PENDING: If the Issuing bank has been determined to participate in the 3DS program, this is the normal response and it will include the redirect URL. The merchant must present a redirect screen to the cardholder, using the URL. |
| merchanttransid | YES      | Character max 50.         | Unique merchant transaction id received in the request.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| transref        | COND     | Integer                   | Gateway’s transaction reference number. Will be sent in the response only if the result is not ERROR. Merchant should save this reference number for support and troubleshooting.                                                                                                                                                                                                                                                                                               |
| gatetransid     | COND     | Character 36              | Gateway transaction ID. Will be sent in the response only if the result is not ERROR. Merchant should save this reference number for refunds and other transaction activity performed through API.                                                                                                                                                                                                                                                                              |
| errorcode       | YES      | Character 3               | Error Code of the transaction or 000 if no error condition found.                                                                                                                                                                                                                                                                                                                                                                                                               |
| errormessage    | OPT      | Character max 100         | Full description of the error.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| description     | OPT      | Character no limit        | Optional details of the transaction except in the case of DECLINED and then the reason for the decline. May be null.                                                                                                                                                                                                                                                                                                                                                            |
| redirect        | COND     | Character string max 2000 | Direct the user to this URL, where he will complete the process and be redirected to the return                                                                                                                                                                                                                                                                                                                                                                                 |

## Request Example

```xml
<transaction>
  <apiUser></apiUser>
  <apiPassword></apiPassword>
  <apiCmd></apiCmd>
  <transaction>
    <merchanttransid></merchanttransid>
    <amount></amount>
    <curcode></curcode>
    <description></description>
  </transaction>
  <customer>
    <firstname></firstname>
    <lastname></lastname>
    <birthday></birthday>
    <birthmonth></birthmonth>
    <birthyear></birthyear>
    <email></email>
    <countryiso></countryiso>
    <stateregioniso></stateregioniso>
    <zippostal></zippostal>
    <city></city>
    <address1></address1>
    <phone1phone></phone1phone>
    <accountid></accountid>
    <ipaddress></ipaddress>
  </customer>
  <creditcard>
    <ccnumber></ccnumber>
    <cccvv></cccvv>
    <expmonth></expmonth>
    <expyear></expyear>
    <nameoncard></nameoncard>
    <returnurl></returnurl>
    <billingcountryiso></billingcountryiso>
    <billingstateregioniso></billingstateregioniso>
    <billingzippostal></billingzippostal>
    <billingcity></billingcity>
    <billingaddress1></billingaddress1>
    <billingphone1phone></billingphone1phone>
  </creditcard>
  <checksum></checksum>
  <auth>
    <type></type>
    <sid></sid>
  </auth>
</transaction>
```

## Response Example

```xml
<transaction>
	  <result></result>
	  <merchanttransid></merchanttransid>
	  <transref></transref>
	  <gatetransid></gatetransid>
	  <errorcode></errorcode>
	  <errormessage/>
	  <description></description>
  	  <redirect></redirect>
</transaction>
```
