# 포트원 결제(iamportPayment)

{% hint style="info" %}
포트원과 연동이 우선되어야 해요. [포트원 결제 연동 가이드 보러가기](/main/guide/faq/payment_api/1.md)
{% endhint %}

[포트원](/main/guide/faq/payment_api/1.md)을 사용해 설정한 PG사의 결제창을 보여줘요. 주로 \[구매하기] \[맴버십 구독하기] 버튼 액션 설정에 사용해요.

<div align="left"><figure><img src="/files/u7TYUQ9PvEpu40GIGBd8" alt="" width="563"><figcaption></figcaption></figure></div>

* 결제 타입 : 오마이앱에서 지원하는 결제 항목을 선택할 수 있어요.
* 정기 결제 여부 : 단건 상품 결제, 구독 정기 결제 여부를 선택할 수 있어요.
* 구매자 이름 : 설정한 값으로 구매자 이름 정보가 상점 관리자(PG사 결제 기록)에 기록돼요
* 상품명 : 상품명의 항목 ID를 입력해 주세요.
* 상품 타입 : 실물 상품인지, 컨텐츠 상품인지 구분할 수 있어요.
* 가격 : 상품 금액의 항목 ID를 입력해 주세요.&#x20;
* 포트원 키 : 이미지에 입력되어있는 값은 오마이앱에서 샘플로 제공하는 결제 연동 키예요. 이후에 포트원과 결제 연동을 통해 발급받은 키를 입력해 주세요.
* 포트원 결제 대행사 : 결제 타입을 카드 결제 or 휴대폰 소액 결제로 선택한 경우, 결제창을 보여줄 결제 대행사를 선택할 수 있어요.

\[구매하기] 버튼을 클릭하면, 설정한 **포트원 결제** 액션에 따라 PG사의 결제창을 보여주고, 결제가 진행돼요.

<div align="left"><figure><img src="/files/WM8Rc6zmonC717HZ3fnV" alt="" width="563"><figcaption></figcaption></figure></div>

결제가 완료되고 나면, 결제ID(impUid, merchantUid)가 inputData에 저장돼요.

{% hint style="info" %}
포트원 결제 액션은 결제만 진행되는 액션이에요. 결제 완료 후, 결제 ID를 가지고 이벤트플로우 액션을 추가로 사용해서 결제 성공 여부 체크 후 구매 및 구독 프로세스를 진행해 주세요.
{% endhint %}

> \#포트원 연동 # 포트원 #결제연동 #결제 #결제기록 #결제액션 #포트원결제&#x20;

2024.03.07 Jinny


---

# 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://docs.ohmyapp.io/main/guide/develop_app/command-execute-function/action/payment.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.
