# 토스페이먼츠 (구 모듈)

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

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

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

{% hint style="warning" %}
**토스페이먼츠 구 모듈 연동 방법에 관한 매뉴얼**입니다.

신규 연동 가맹점이시거나 신 모듈로의 업그레이드를 원하신다면 [신 모듈 연동 문서](/docs/pg/payment-gateway/newtoss.md)로 이동해주세요.
{% endhint %}

### 1. 토스페이먼츠 PG 설정하기

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

![](/files/M5JVDeJ1x41UYKZQXerK)

### 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> 로 리디렉션됩니다.

예시 코드는 아래와 같습니다.

{% code title="Javascript SDK" %}

```javascript
IMP.request_pay({
    pg : 'uplus.{MID}',
    pay_method : 'card',
    merchant_uid: "order_no_0001", //상점에서 생성한 고유 주문번호
    name : '주문명:결제테스트',
    amount : 1004,
    buyer_email : 'test@portone.io',
    buyer_name : '구매자이름',
    buyer_tel : '010-1234-5678',
    buyer_addr : '서울특별시 강남구 삼성동',
    buyer_postcode : '123-456',
    m_redirect_url : '{모바일에서 결제 완료 후 리디렉션 될 URL}',
    appCard: true // 설정시 신용카드 결제모듈에서 앱카드 결제만 활성화됩니다.
}, function(rsp) { // callback 로직
	//* ...중략... *//
});
```

{% endcode %}

***

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

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

**PG사 구분코드**

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

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

**결제수단 구분코드**

* card(신용카드)
* trans(실시간 계좌이체)
* vbank(가상계좌)
* phone(휴대폰소액결제)
* applepay(애플페이)
* tosspay(토스페이)
* naverpay(네이버페이)
* kakaopay(카카오페이)
* lpay(엘페이)
* payco(페이코)
* samsung(삼성페이)

**`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> 이 아닌점에 유의하세요

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

**에스크로 설정여부**

{% embed url="<https://codepen.io/chaiport/pen/qBxbGXy>" %}
토스페이먼츠 **결**제창 예제
{% endembed %}

{% hint style="info" %}
**허브형 간편결제**

토스페이먼츠 결제창을 통한 간편결제(카카오,네이버페이 등)는 미 지원 되고 있습니다.
{% 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/toss.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.
