---
id: payment-details
title: Payment Details
description: Detailed view for a single payment, including customer data, timeline events, and dispute shortcuts.
sidebar_position: 30
---

import {
  CodeBlock,
  PropsMarkdownTable,
  PartsMarkdownTable,
  getWebcomponentsVersion,
  getPropsFromDocs,
  getComponentParts,
  ComponentBox,
  setUpMocks,
} from '../helpers';
import docsJson from '../docs.json';
import componentTreeJson from '../component-tree.json';
import '@justifi/webcomponents/dist/module/justifi-payment-details';

{setUpMocks()}

## Overview

Component to display detailed information about a specific payment.

## Usage

<CodeBlock>{`<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
  <title>justifi-payment-details</title>

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.esm.js"
></script>

<script
  nomodule
  src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.js"
></script>

  <style>
      ::part(font-family) {
        font-family: georgia;   
      }
        
      ::part(color) {
        color: darkslategray;
      }

      ::part(background-color) {
        background-color: transparent;
      }
    </style>

</head>

<body>
  <justifi-payment-details payment-id="py_123" auth-token="authToken" />
</body>

<script>
  (function () {
    const paymentDetails = document.querySelector('justifi-payment-details');

    paymentDetails.addEventListener('error-event', (event) => {
      // here is where you would handle the error
      console.error('error-event', event.detail);
    });
  })();
</script>

</html>`}</CodeBlock>

## Props, Events & Methods

<PropsMarkdownTable
  props={getPropsFromDocs('justifi-payment-details', docsJson)}
/>

### Events

- `error-event`: Surfaces API or token errors for logging.
- `record-click-event`: Emitted when users click on a related record (e.g., refund, dispute).

## Theming & Layout

<PartsMarkdownTable
  parts={getComponentParts('justifi-payment-details', componentTreeJson)}
/>

# Example Usage

---

<ComponentBox>
  <justifi-payment-details payment-id="123" auth-token="123abc" />
</ComponentBox>

---
