# Non-3DS Implementation

<figure><img src="https://3756320043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBnccQ14a3b6OedaJJFT4%2Fuploads%2FKSyN3ZGCSkjEl4VwtYAe%2FNon3DS_EN.png?alt=media&#x26;token=9534a0d3-b328-44e6-9b5d-0bcfc1f8c0b5" alt=""><figcaption></figcaption></figure>

### **Integration Steps** <a href="#integration-steps" id="integration-steps"></a>

1. BIN Check
2. Create PreAuth Payment
3. Create PostAuth Payment
4. [Webhook](https://docs.iyzico.com/v/en/advanced/webhook)

### Top View <a href="#top-view" id="top-view"></a>

* BIN Check; section of identifying issuer details where API returns information about installment options and card details.
* Create PreAuth Payment; essential requirement on managing payment request at two-step flow transactions.
* Create PostAuth Payment; engage step to finalize payment recorded by iyzico.
* Webhook; real-time notification of relevant payment.

### Sample Implementation <a href="#sample-implementation" id="sample-implementation"></a>

PreAuth NON-3DS implementation consists of 2 subsequent `POST` requests in short.

* Create PreAuth Payment
* Create PostAuth Payment

Suggested integration tracks following order;

### 1. BIN Check <a href="#id-1.-bin-check" id="id-1.-bin-check"></a>

Whether 3DS or NON-3DS payment method, It is advised to identify issuer card feature beforehand. BIN detail services provides further details of card type, card scheme, card association which indicates installment and 3DS features.

**Sample Installment Request;**

```javascript
{
"price":"100.0",
"binNumber":"535805"
}
```

**Sample Retrieve Installment Response;**

```javascript
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1685905139724,
    "installmentDetails": [
        {
            "binNumber": "535805",
            "price": 100.0,
            "cardType": "DEBIT_CARD",
            "cardAssociation": "MASTER_CARD",
            "cardFamilyName": "iyzico DC",
            "force3ds": 0,
            "bankCode": 864,
            "bankName": "iyzico",
            "forceCvc": 0,
            "commercial": 0,
            "dccEnabled": 0,
            "installmentPrices": [
                {
                    "installmentPrice": 100.0,
                    "totalPrice": 100.0,
                    "installmentNumber": 1
                }
            ]
        }
    ]
}
```

### 2. Create PreAuth Payment <a href="#id-2.-create-payment" id="id-2.-create-payment"></a>

NON-3DS payment journey begins with Create PreAuth Payment `POST` request.

**Sample Create PreAuth Payment Request;**

```javascript
{
   "locale":"en",
   "conversationId":"deviyzico",
   "price":"1.0",
   "paidPrice":"1.2",
   "currency":"TRY",
   "installment":1,
   "paymentChannel":"WEB",
   "basketId":"B67832",
   "paymentGroup":"LISTING",
   "paymentCard":{
      "cardHolderName":"Mehmet Test",
      "cardNumber":"5528790000000008",
      "expireYear":"2030",
      "expireMonth":"12",
      "cvc":"123",
      "registerCard":0
   },
   "buyer":{
      "id":"BY789",
      "name":"John",
      "surname":"Doe",
      "identityNumber":"74300864791",
      "email":"email@email.com",
      "gsmNumber":"+905350000000",
      "registrationDate":"2013-04-21 15:12:09",
      "lastLoginDate":"2015-10-05 12:43:35",
      "registrationAddress":"Altunizade, İnci Çk. No:3 Kat: 3 D: 10, 34662 Üsküdar/İstanbul",
      "city":"Istanbul",
      "country":"Turkey",
      "zipCode":"34732",
      "ip":"85.34.78.112"
   },
   "shippingAddress":{
      "address":"Altunizade, İnci Çk. No:3 Kat: 3 D: 10, 34662 Üsküdar/İstanbul",
      "zipCode":"34742",
      "contactName":"Mehmet Test",
      "city":"Istanbul",
      "country":"Turkey"
   },
   "billingAddress":{
      "address":"Altunizade, İnci Çk. No:3 Kat: 3 D: 10, 34662 Üsküdar/İstanbul",
      "zipCode":"34742",
      "contactName":"Mehmet Test",
      "city":"Istanbul",
      "country":"Turkey"
   },
   "basketItems":[
      {
         "id":"BI101",
         "price":"0.3",
         "name":"Binocular",
         "category1":"Collectibles",
         "category2":"Accessories",
         "itemType":"PHYSICAL"
      },
      {
         "id":"BI102",
         "price":"0.5",
         "name":"Game code",
         "category1":"Game",
         "category2":"Online Game Items",
         "itemType":"VIRTUAL"
      },
      {
         "id":"BI103",
         "price":"0.2",
         "name":"Usb",
         "category1":"Electronics",
         "category2":"Usb / Cable",
         "itemType":"PHYSICAL"
      }
   ]
}
```

**Sample Create PreAuth Payment Response;**

```javascript
{
    "status": "success",
    "locale": "en",
    "systemTime": 1714818438785,
    "conversationId": "deviyzico",
    "price": 1.0,
    "paidPrice": 1.2,
    "installment": 1,
    "paymentId": "22145064",
    "fraudStatus": 1,
    "merchantCommissionRate": 20.00000000,
    "merchantCommissionRateAmount": 0.2,
    "iyziCommissionRateAmount": 0.04800000,
    "iyziCommissionFee": 0.25000000,
    "cardType": "CREDIT_CARD",
    "cardAssociation": "MASTER_CARD",
    "cardFamily": "Paraf",
    "binNumber": "552879",
    "lastFourDigits": "0008",
    "basketId": "B67832",
    "currency": "TRY",
    "itemTransactions": [
        {
            "itemId": "BI101",
            "paymentTransactionId": "24080880",
            "transactionStatus": 2,
            "price": 0.3,
            "paidPrice": 0.36000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.06000000,
            "iyziCommissionRateAmount": 0.01440000,
            "iyziCommissionFee": 0.07500000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.27060000,
            "convertedPayout": {
                "paidPrice": 0.36000000,
                "iyziCommissionRateAmount": 0.01440000,
                "iyziCommissionFee": 0.07500000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.27060000,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI102",
            "paymentTransactionId": "24080881",
            "transactionStatus": 2,
            "price": 0.5,
            "paidPrice": 0.60000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.10000000,
            "iyziCommissionRateAmount": 0.02400000,
            "iyziCommissionFee": 0.12500000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.45100000,
            "convertedPayout": {
                "paidPrice": 0.60000000,
                "iyziCommissionRateAmount": 0.02400000,
                "iyziCommissionFee": 0.12500000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.45100000,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI103",
            "paymentTransactionId": "24080882",
            "transactionStatus": 2,
            "price": 0.2,
            "paidPrice": 0.24000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.04000000,
            "iyziCommissionRateAmount": 0.00960000,
            "iyziCommissionFee": 0.05000000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.18040000,
            "convertedPayout": {
                "paidPrice": 0.24000000,
                "iyziCommissionRateAmount": 0.00960000,
                "iyziCommissionFee": 0.05000000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.18040000,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        }
    ],
    "authCode": "757812",
    "phase": "PRE_AUTH",
    "hostReference": "mock00001iyzihostrfn"
}
```

### 3. Create PostAuth Payment <a href="#id-3.-retrieve-optional" id="id-3.-retrieve-optional"></a>

After having completing all the steps above, Its now time to finalize payment operation between Issuer and Acquirer with PostAuth Payment request.

**Sample PostAuth Payment Request;**

```javascript
{
  "locale": "en",
  "paymentId":"22145064"
}
```

**Sample Retrieve Response;**

```javascript
{
    "status": "success",
    "locale": "en",
    "systemTime": 1714818557440,
    "price": 1.00000000,
    "paidPrice": 1.20000000,
    "installment": 1,
    "paymentId": "22145064",
    "fraudStatus": 1,
    "merchantCommissionRate": 20.00000000,
    "merchantCommissionRateAmount": 0.20000000,
    "iyziCommissionRateAmount": 0.04800000,
    "iyziCommissionFee": 0.25000000,
    "cardType": "CREDIT_CARD",
    "cardAssociation": "MASTER_CARD",
    "cardFamily": "Paraf",
    "binNumber": "552879",
    "lastFourDigits": "0008",
    "basketId": "B67832",
    "currency": "TRY",
    "itemTransactions": [
        {
            "itemId": "BI101",
            "paymentTransactionId": "24080880",
            "transactionStatus": 2,
            "price": 0.30000000,
            "paidPrice": 0.36000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.06000000,
            "iyziCommissionRateAmount": 0.01440000,
            "iyziCommissionFee": 0.07500000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0E-8,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0E-8,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0E-8,
            "merchantPayoutAmount": 0.27060000,
            "convertedPayout": {
                "paidPrice": 0.36000000,
                "iyziCommissionRateAmount": 0.01440000,
                "iyziCommissionFee": 0.07500000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.27060000,
                "iyziConversionRate": 0E-8,
                "iyziConversionRateAmount": 0E-8,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI102",
            "paymentTransactionId": "24080881",
            "transactionStatus": 2,
            "price": 0.50000000,
            "paidPrice": 0.60000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.10000000,
            "iyziCommissionRateAmount": 0.02400000,
            "iyziCommissionFee": 0.12500000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0E-8,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0E-8,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0E-8,
            "merchantPayoutAmount": 0.45100000,
            "convertedPayout": {
                "paidPrice": 0.60000000,
                "iyziCommissionRateAmount": 0.02400000,
                "iyziCommissionFee": 0.12500000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.45100000,
                "iyziConversionRate": 0E-8,
                "iyziConversionRateAmount": 0E-8,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI103",
            "paymentTransactionId": "24080882",
            "transactionStatus": 2,
            "price": 0.20000000,
            "paidPrice": 0.24000000,
            "merchantCommissionRate": 20.00000000,
            "merchantCommissionRateAmount": 0.04000000,
            "iyziCommissionRateAmount": 0.00960000,
            "iyziCommissionFee": 0.05000000,
            "blockageRate": 0E-8,
            "blockageRateAmountMerchant": 0E-8,
            "blockageRateAmountSubMerchant": 0E-8,
            "blockageResolvedDate": "2024-05-12 00:00:00",
            "subMerchantPrice": 0E-8,
            "subMerchantPayoutRate": 0E-8,
            "subMerchantPayoutAmount": 0E-8,
            "merchantPayoutAmount": 0.18040000,
            "convertedPayout": {
                "paidPrice": 0.24000000,
                "iyziCommissionRateAmount": 0.00960000,
                "iyziCommissionFee": 0.05000000,
                "blockageRateAmountMerchant": 0E-8,
                "blockageRateAmountSubMerchant": 0E-8,
                "subMerchantPayoutAmount": 0E-8,
                "merchantPayoutAmount": 0.18040000,
                "iyziConversionRate": 0E-8,
                "iyziConversionRateAmount": 0E-8,
                "currency": "TRY"
            }
        }
    ],
    "authCode": "510911",
    "phase": "POST_AUTH",
    "hostReference": "mock00001iyzihostrfn"
}
```

### 4.Webhook <a href="#id-4.webhook" id="id-4.webhook"></a>

Webhooks are tail subject of our implementation streamline.

Receiving real-time payment notifications leverages overall 3DS experience while ensuring that the notifications are coming from trusted sources, preventing any potential tampering or unauthorized access to sensitive data.

Each payment event triggers webhooks;

* In `15` seconds.
* Until your server responds with `200`.
* For every `10` minutes.
* Max `3` times.

**Sample PreAuth & Capture Non-3DS Webhook**

| Parametere                | Type   | Description                                                           |
| ------------------------- | ------ | --------------------------------------------------------------------- |
| **iyziEventTime**         | long   | Unix timestamp value of first notification.                           |
| **iyziEventType**         | string | Shows the request type. Values: API\_AUTH, THREE\_DS\_AUTH, BKM\_AUTH |
| **iyziReferenceCode**     | string | A unique reference code for the notification                          |
| **paymentId**             | long   | Unique iyzico reference code of related payment                       |
| **paymentConversationId** | string | Merchant's reference id for the related payment                       |
| **status**                | string | Payment status. Values: SUCCESS, FAILURE                              |

Happy path includes `success` parameter in the `status` variable.

**Confirmation**

To finalize payment operations successfully, correlation of certain variables plays significant role;

* `paymentId`
* `status`
* `price`
* Other [Idempotency](file:///iyzico-dokuemantasyon/getting-started/preliminaries/idempotency) parameters optionally

Its vital that Create PostAuth Payment response and [Webhook](file:///iyzico-dokuemantasyon/advanced/webhook) notification have to authenticate each other.

* `paymentId` on Create PostAuth Payment response should be equal to `paymentId`from [Webhook](https://docs.iyzico.com/v/en/advanced/webhook)
* Both of the `status` parameters should be `success`
* `price` parameter amounts should be the same
* And lastly, [Idempotency](https://docs.iyzico.com/v/en/getting-started/preliminaries/idempotency) parameters should be the same as well.

If so, congratulations! Just finished PreAuth & Capture NON-3DS implementation.

Transaction details could get from merchant panel.
