# Daou (PAYJOA)

### 1. Configure Daou PG settings

Refer to the [**Daou settings**](https://portone.gitbook.io/docs-en/ready/2.-pg/payment-gateway-settings/daou) page to configure the PG settings.

![](https://2814812280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTv8JEzyM5h4cYcL5StH%2Fuploads%2FGab7uaIuibkzHvuwLZ6Y%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202022-06-05%20%E1%84%8B%E1%85%A9%E1%84%8C%E1%85%A5%E1%86%AB%2011.53.10.png?alt=media\&token=d224f078-2ebc-4bf2-a15d-4cbcfb2a1826)

### 2. Request payment

To open the payment window, call [JavaScript SDK](https://portone.gitbook.io/docs-en/sdk/javascript-sdk) IMP.**request\_pay**(param, callback).

In PC browsers, <mark style="color:red;">**callback**</mark> is invoked after calling `IMP.request_pay(param, callback)`. In mobile browsers, the page is redirected to <mark style="color:red;">**m\_redirect\_url**</mark>.

{% hint style="warning" %}
**PAYJOA payment window integration requires&#x20;**<mark style="color:red;">**JS SDK 1.2.0**</mark>**&#x20;or later version.**
{% endhint %}

{% tabs %}
{% tab title="Authenticated payment request" %}
{% code title="Javascript SDK" %}

```javascript
IMP.request_pay({
    pg : 'daou',
    pay_method : 'card',
    merchant_uid: 'mid_1234567890',
    escrow: false,
    amount: 1004,
    name: 'NF long padding jacket M',
    buyer_name: 'John Doe',
    buyer_email: 'hello@world.com',
    buyer_tel: '01012345678',
    digital : false, // Set to true if contracted as digital
    m_redirect_url: 'https://allerts.com/payments/complete', 
    bypass: {
	// PAYJOA (DaouData) specific parameters
        daou: {
	    PRODUCTCODE: 'iamport',
	    CASHRECEIPTFLAG: 2,
	},
    },
    app_scheme: 'iamportappscheme',
}, function(rsp) { // callback logic
	//* ...Omitted... *//
});
```

{% endcode %}

####

#### Key parameter description

**`pg`** <mark style="color:red;">**\***</mark>\*\* \*\*<mark style="color:green;">**string**</mark>

**PG code**

* If not specified and this is the only PG setting that exists, `default PG` is automatically set.
* If there are multiple PG settings, set to **`daou`**.

**`pay_method`** <mark style="color:red;">**\***</mark>\*\* \*\*<mark style="color:green;">**string**</mark>

**Payment method code**

<details>

<summary>Payment method codes</summary>

* `card` (credit card)
* `trans`(instant account transfer)
* `vbank`(virtual account)

</details>

**`merchant_uid`** <mark style="color:red;">**\***</mark>\*\* \*\*<mark style="color:green;">**string**</mark>

**Order ID**

Must be unique for each request.

**`digital`**<mark style="color:red;">**`*`**</mark><mark style="color:green;">**`string`**</mark>

**Digital contents option**

Must specify the value based on the contract between merchant and PAYJOA. Otherwise, request will fail.

**` bypass.daou.PRODUCTCODE`` `` `**<mark style="color:green;">**`string`**</mark>

**Product code**

If there is no specification for the value and the value is not specified, i'mport sets it to the default value (iamport) and sends it to PAYJOA.

**` bypass.daou.CASHRECEIPTFLAG`` `` `**<mark style="color:green;">**``**</mark><mark style="color:purple;">**`integer`**</mark>

**Cash receipt issuance code**

Auto cash receipt issuance code for cash payments (account transfer, virtual account)

**`1: Allow`**

**`2: Block`**

**` app_scheme`` `` `**<mark style="color:green;">**`string`**</mark>

**Mobile app URL scheme**

Required in mobile app

**`amount`** <mark style="color:red;">**\***</mark>\*\* \*\*<mark style="color:purple;">**integer**</mark>

**Payment amount**

Must be an integer (not string)

**` escrow`` `` `**<mark style="color:orange;">**`boolean`**</mark>

**Escrow option**

Only supports account transfer and virtual account payment.
{% endtab %}

{% tab title="Non-authenticated API  request" %}
**You can use i'mport REST API to request billing key, request payment, and schedule payment.**

#### Request one-time payment

To request a one-time payment, use the key-in REST[ **API POST /subscribe/payments/onetime**](https://portone.gitbook.io/docs-en/api/api/request-non-authenticated-payment-one-time-api). The card information is not saved during this process.

```
curl -H "Content-Type: application/json" \   
     -X POST -d '{"merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
     https://api.iamport.kr/subscribe/payments/onetime
```

####

#### Request billing key

To request a billing key, use the billing key request REST [**API POST /subscribe/customers/{customer\_uid}**](https://portone.gitbook.io/docs-en/api/billing-key-api/api-1).

```
curl -H "Content-Type: application/json" \   
     -X POST -d '{"card_number":"1234-1234-1234-1234", "expiry":"2025-12", "birth":"820213", "pwd_2digit":"00"}' \
     https://api.iamport.kr/subscribe/customers/your-customer-unique-id
```

#### Request billing key + initial payment

To request a billing key and initial payment, use the key-in REST [**API POST /subscribe/payments/onetime**](https://portone.gitbook.io/docs-en/api/api/request-non-authenticated-payment-one-time-api).

* **`customer_uid`** : required for saving the billing key.

```
curl -H "Content-Type: application/json" \   
     -X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
     https://api.iamport.kr/subscribe/payments/onetime 
```

#### Request payment with billing key

After successfully getting the billing key and making the initial payment, the billing key is stored on the i'mport server mapped 1:1 with the specified `customer_uid`. For security reasons, the server cannot directly access the billing key. Subsequent payments can be requested by calling the repeat pay REST API ([**POST /subscribe/payments/again**](https://portone.gitbook.io/docs-en/api/api/api)) with the `customer_uid` as follows:

```
curl -H "Content-Type: application/json" \   
     -X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "amount":3000}' \
     https://api.iamport.kr/subscribe/payments/again
```

**For detailed information, refer to:**

{% content-ref url="../../auth/guide-1" %}
[guide-1](https://portone.gitbook.io/docs-en/auth/guide-1)
{% endcontent-ref %}
{% endtab %}
{% endtabs %}

### 3. Additional functions

{% tabs %}
{% tab title="Installment setting" %}
{% code title="javascript" %}

```javascript
display: {
    card_quota: [6]  // Display up to 6 months installment plans
}
```

{% endcode %}

**Parameters**

* **card\_quota :**
  * `[]`: Only immediate pay
  * `2,3,4,5,6`: immediate, 2, 3, 4, 5, 6 month installment plans\\

{% hint style="info" %}
Installment plan option is available only for **KRW 50,000 or more**.
{% endhint %}
{% endtab %}

{% tab title="Escrow payment" %}
For escrow payment, the **`escrow`** parameter must be set to <mark style="color:red;">**true**</mark>. When the escrow payment is completed, the merchant must register the shipping information for **settlement**. You can manage shipping information by using the [**Add delivery info**](https://portone.gitbook.io/docs-en/api/escrow-api/add-delivery-info-api) and [**Update delivery info**](https://portone.gitbook.io/docs-en/api/escrow-api/update-delivery-info-api) APIs.

{% code title="API Body Example" %}

```javascript
{
    "logis": {
        "invoice": "1728384716123",
        "company": "CJGLS",
        "receiving_at": "20220215",
        "address": "16, Seongsui-ro 20-gil"
    },
    "receiver": {
        "name": "John DOe"
    },
    "sender": {
        "relationship": "self"
    }
}
```

{% endcode %}

{% hint style="danger" %}
**Precaution**

* When adding/updating the escrow delivery information, PAYJOA does not validate the delivery information (tracking number, courier name, etc.) received from the merchant.
  {% endhint %}
  {% endtab %}
  {% endtabs %}
