> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# PaymentDetailElement

> 대시보드의 금액 내역, 활동, 고객, 세부 정보, 고객 여정을 포함한 결제 세부 정보 페이지입니다. 각 섹션은 숨길 수 있습니다. payment:basic:read로 데이터를 읽으며, 고객 이메일에는 member:email:read, 여정에는 member:basic:read가 필요합니다. 작업 이벤트를 통해 애플리케이션이 변경 사항을 확인하고 승인할 수 있으며, 이 엘리먼트는 결제를 직접 환불, 재시도 또는 무효화하지 않습니다.

> [!NOTE]
>
> 이 페이지는 `@whop/elements@1.10.0` 및 `@whop/elements-react@1.10.0`을 다룹니다.

*`v1.0.0`부터 지원.*

[`Dashboard`](https://docs.whop.com/ko/elements/latest/dashboard/overview) 안에 마운트됩니다. `accountId`와 `accessToken`은 Dashboard에서 가져옵니다. props와 콜백은 생성 옵션 또는 React props로 전달합니다. `refresh()`를 호출하려면 생성된 핸들 또는 React `ref`를 보관하세요.

```tsx React theme={null}
import { WhopElements, Dashboard, PaymentDetailElement } from "@whop/elements-react";
import { loadWhop } from "@whop/elements";

function Example() {
  return (
    <WhopElements elements={loadWhop()}>
      <Dashboard /* options */>
        <PaymentDetailElement onRefundRequested={(e) => console.log(e)} onRetryRequested={(e) => console.log(e)} onVoidRequested={(e) => console.log(e)} onInvoiceRequested={(e) => console.log(e)} onCustomerSelected={(e) => console.log(e)} onMessageRequested={(e) => console.log(e)} />
      </Dashboard>
    </WhopElements>
  );
}
```

```html JavaScript theme={null}
<script src="https://cdn.whop.com/elements/amber/elements.js" data-whop-elements></script>
<script type="module">
  const dashboard = window.WhopElements().dashboard.create({ /* options */ });
  dashboard.create('paymentDetail', {
    onRefundRequested: (e) => console.log(e),
    onRetryRequested: (e) => console.log(e),
    onVoidRequested: (e) => console.log(e),
    onInvoiceRequested: (e) => console.log(e),
    onCustomerSelected: (e) => console.log(e),
    onMessageRequested: (e) => console.log(e)
  }).mount('#dashboard-paymentDetail');
</script>
```

예시 데이터입니다. [Playground 열기](https://docs.whop.com/ko/elements/latest/dashboard/overview#playground).

## Props

**showActions** `boolean`

오른쪽 상단의 Refund 버튼과 작업 메뉴를 표시합니다. 변경 작업에는 이벤트 핸들러가 필요합니다. 기본값은 `true`입니다.

**paymentId** `string`

표시할 결제로, pay\_ 접두사가 붙습니다. 결제를 불러오려면 필수입니다. 기본값은 `""`입니다.

**showBreakdown** `boolean`

결제 금액, 수수료, 순 금액을 표시합니다. 기본값은 `true`입니다.

**showActivity** `boolean`

결제 활동 타임라인을 표시합니다. 기본값은 `true`입니다.

**showCustomer** `boolean`

권한이 있는 경우 고객 이름, 사용자 이름, 이메일, 전화번호, 청구지 주소를 표시합니다. 기본값은 `true`입니다.

**showDetails** `boolean`

상품, 플랜, 결제 수단, 결제 메타데이터, 결제 식별자를 표시합니다. 기본값은 `true`입니다.

**showJourney** `boolean`

고객 여정을 표시합니다. 표시되는 동안에만 계정 범위의 Events API를 읽습니다. 기본값은 `true`입니다.

## 이벤트

생성 옵션 또는 React props로 콜백을 전달합니다.

### `onRefundRequested`

애플리케이션에서 환불을 확인하고 승인합니다. 환불 가능하고 핸들러가 제공된 경우에만 활성화됩니다.

**payload** `object`

**속성**

**paymentId** `string` *required*

### `onRetryRequested`

애플리케이션에서 추가 청구 시도를 확인하고 승인합니다.

**payload** `object`

**속성**

**paymentId** `string` *required*

### `onVoidRequested`

애플리케이션에서 이 결제의 무효화를 확인하고 승인합니다.

**payload** `object`

**속성**

**paymentId** `string` *required*

### `onInvoiceRequested`

애플리케이션에서 인보이스를 보거나 다운로드합니다.

**payload** `object`

**속성**

**paymentId** `string` *required*

### `onCustomerSelected`

애플리케이션에서 고객을 엽니다.

**payload** `object`

**속성**

**userId** `string` *required*

**memberId** `string | null` *required*

### `onMessageRequested`

고객 메시지 UI를 엽니다.

**payload** `object`

**속성**

**userId** `string` *required*

### `onLoaderStart`

로딩 스켈레톤이 처음 그려진 후, `onReady` 전에 실행됩니다.

### `onReady`

엘리먼트가 처음으로 완전히 그려진 후 실행됩니다.

### `onError`

엘리먼트가 로드에 실패하거나 충돌할 때 실행됩니다. 대체 화면은 계속 표시됩니다. 프로그래밍 방식으로 처리하려면 `code`를 사용하세요. `sourceKey`는 실패한 호스트 상태 소스를 식별합니다.

**e** `object`

**속성**

**message** `string` *required*

**code** `string`

**sourceKey** `string`

## 메서드

`create`가 반환한 핸들에서, 또는 React `ref`를 통해 호출합니다.

### `refresh`

호스트 작업이 완료된 후 결제와 수수료를 다시 불러옵니다.

**반환값** `Promise<void>`

### `mount`

`target`에 엘리먼트를 마운트하고 로딩을 시작합니다. React 컴포넌트는 자동으로 마운트됩니다.

**매개변수**

**target** `string | HTMLElement` *required*

### `destroy`

엘리먼트를 제거하고 프레임과 구독을 해제합니다. 여러 번 호출해도 됩니다. React는 엘리먼트를 자동으로 제거합니다.

### `update`

마운트된 엘리먼트에 새 props를 병합합니다. React에서는 대신 컴포넌트 props를 변경하세요.

**매개변수**

**options** `Partial\<PaymentDetailElementProps\>` *required*

## 스타일링

`appearance.classes`를 통해 다음 부분의 스타일을 지정합니다. 속성 이름은 카멜 케이스 또는 케밥 케이스를 사용하고 단위를 포함하세요. 페이지 스타일시트는 엘리먼트의 프레임에 적용되지 않습니다. 프레임워크는 각 선언을 삽입하기 전에 유효성을 검사합니다.

| 클래스 | 대상 |
| - | - |
| `.whop-PaymentDetail` | 결제 세부 정보 페이지 |

```ts theme={null}
const dashboard = whop.dashboard.create({
  appearance: {
    classes: {
      'whop-PaymentDetail': { borderRadius: '8px', fontWeight: '600' }
    }
  }
});

dashboard.update({
  appearance: { classes: { 'whop-PaymentDetail': { fontWeight: '700' } } }
});
```

React에서는 `appearance`를 `<Dashboard>`에 전달합니다. 전역으로 설정하려면 `WhopElements({ appearance })`를 사용하세요.
