# 페이먼트월

{% hint style="warning" %}
**Deprecated**

이 문서는 더 이상 관리되지 않습니다.

[PortOne 개발자센터](https://developers.portone.io/)를 이용해주세요.
{% endhint %}

### 1. 페이먼트월 PG 설정하기

[**페이먼트월 설정**](/docs/ready/2.-pg/payment-gateway/undefined-1.md) 페이지의 내용을 참고하여 PG 설정을 진행합니다.

![](/files/6udQH5om2JfEJ7CO3yz1)

### 2.결제 요청하기

[JavaScript SDK](/docs/sdk/javascript-sdk-old.md) IMP.**request\_pay**(param, callback)을 호출하여 페이먼트월 결제창을 호출할 수 있습니다. **결제결과**는 PC의 경우 IMP.request\_pay(param, callback) 호출 후 <mark style="color:red;">**callback**</mark> 으로 수신되며 모바일의 경우<mark style="color:red;">**m\_redirect\_url**</mark> 로 리디렉션됩니다.

{% tabs %}
{% tab title="인증결제창 요청" %}
{% code title="Javascript SDK" %}

```javascript
IMP.request_pay({
    pg : 'paymentwall.{project_key}',
    pay_method : 'card', // 페이먼트월은 국가IP에 따라 결제수단이 활성화 됩니다.(생략가능)
    merchant_uid: "order_no_0001", //상점에서 생성한 고유 주문번호
    name : '주문명:결제테스트',
    amount : 1004,
    currency : 'KRW'  // 필수 파라미터
    buyer_email : 'test@portone.io',  //필수 파라미터 
    buyer_name : 'Jack Son',   //반드시 Firstname Lastname 이 빈칸으로 구분되어야 
    buyer_tel : '010-1234-5678',
    buyer_addr : '서울특별시 강남구 삼성동',
    buyer_postcode : '123-456',
    m_redirect_url : '{모바일에서 결제 완료 후 리디렉션 될 URL}',
    bypass: {
      //터미날3 인경우 해당 파라미터 설정, 미 설정시 Defualt(일반) 결제창 활성화
      widget_code: "t3_1",  
      // 특정 결제수단만 활성화 하는 경우 사용 all 인 경우(default) 국가 지원 결제수단 모두 표
      ps : "all",
      country_code:"DE"  // 코드가 지정되면 지정된 국가에서 지원하는 결제수단이 활성화됩니다.
    },
    
}, function(rsp) { // callback 로직
	//* ...중략... *//
});
```

{% endcode %}

####

#### **주요 파라미터 설명**

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

**PG사 구분코드**

**`paymentwall`** 로 지정하면 됩니다.

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

**결제수단 구분코드 (생략가능)**

결제수단 제어는 [페이먼트월 홈페이지](https://api.paymentwall.com/) 안에서 Project를 활성화 하여 제어 할수 있습니다.

(별도로 제어하지 않으시면 국가IP에 맞는 결제수단이 기본으로 노출됩니다)

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

**주문번호**

매번 고유하게 채번되어야 합니다.

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

**결제금액**

<mark style="color:green;">**string**</mark> 이 아닌점에 유의하세요

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

**`구매자 이름`**

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

**`구매자 email 주소`**

필수로 유입되어야 합니다.

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

**`통화구분코드`**

**`bypass`**

**`페이먼트월 전용 파라미터`**

* **`widget_code` :** 터미날3 인 경우 <mark style="color:red;">**t3\_1**</mark> 파라미터 설정, 미 설정시 Defualt(일반) 결제창 활성화
* **`ps` :** 특정 결제수단만 활성화 하는 경우 사용합니다. 해당 파라미터에 설정할 코드표는 [**링크**](https://docs.paymentwall.com/reference/payment-system-shortcodes)를 참조해 주세요. ex) `kakaopaykr` = 카카오페이
* **country\_code** : 지정된 코드 값에 해당하는 국가 지원 결제수단이 위젯상에 노출됩니다.([**코드확인**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))
  {% endtab %}

{% tab title="비 인증 결제" %}
인증결제창 호출 파라미터에서 **customer\_uid** 값을 추가하면 비 인증 결제창을 호출할 수 있습니다. 비 인증 결제창에서 빌링키를 발급받은 후 해당 빌링키로 결제를 요청합니다.

{% code title="Javascript SDK" %}

```javascript
IMP.request_pay({
    pg : 'paymentwall.{project_key}',
    pay_method : 'card', // 빌링키 결제는 오직 신용카드만 가능합니다.
    merchant_uid: "order_monthly_0001", // 상점에서 관리하는 주문 번호
    name : '최초인증결제',
    amount : 20, // 결제창에 표시될 금액. 실제 승인이 이뤄지지는 않습니다.
    currency : 'USD'  // 필수 파라미터
    customer_uid : 'your-customer-unique-id', // 필수 입력.
    buyer_email : 'test@portone.io',
    buyer_name : '포트원',
    buyer_tel : '02-1234-1234',
    m_redirect_url : '{모바일에서 결제 완료 후 리디렉션 될 URL}' 
}, function(rsp) {
    if ( rsp.success ) {
        alert('빌링키 발급 성공');
    } else {
        alert('빌링키 발급 실패');
    }
});
```

{% endcode %}

**주요 파라미터 설명**

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

**PG사 구분코드**

**`paymentwall.{project`*****`key}`** 형태로 기재(project\_key는 페이먼트월 관리자페이지에서 확인 가능)*

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

**카드 빌링키**

비 인증 결제창에서 고객이 입력한 카드정보와 1:1로 매칭될 빌링키를 지정합니다.

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

**결제금액**

설정된 금액으로 <mark style="color:red;">**최초 승인이 무조건 발생**</mark>됩니다.

**빌링키(customer\_uid)로 결제 요청하기**

빌링키 발급이 성공하면 실 빌링키는 customer\_uid 와 1:1 매칭되어 **포트원 서버에 저장**됩니다. customer\_uid를 가맹점 내부서버에 저장하시고 [<mark style="color:blue;">**비 인증 결제요청 REST API**</mark>](/docs/api/api-4/api.md)를 호출하시면 결제를 발생시킬 수 있습니다.

{% code title="server-side" %}

```
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
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="danger" %}
**배송정보 등록 API**

페이먼트월을 통한 이커머스 (실물상품) 결제인 경우 아래 배송정보등록 API 를 반드시 연동해주셔야 합니다. 해당 연동 누락시 정산에 문제가 발생합니다.

<https://api.iamport.kr/#!/paymentwall/paymentwall_delivery>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://portone.gitbook.io/docs/pg/payment-gateway/paymentwall.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
