---
id: saved-payment-methods
title: Saved Payment Methods
description: Saved payment selector for Modular Checkout that handles defaulting, deletion, and fallback to new entries.
sidebar_position: 26
---

import {
  CodeBlock,
  PropsMarkdownTable,
  PartsMarkdownTable,
  getWebcomponentsVersion,
  getComponentParts,
  getPropsFromDocs,
} from '../../helpers';
import docsJson from '../../docs.json';
import componentTreeJson from '../../component-tree.json';

## Overview

Renders a radio input list of saved payment methods as part of a checkout flow.

> Note: This sub component will only display saved payment methods if a `payment_method_group_id` with associated payment methods was passed to the [create checkout](https://docs.justifi.tech/api-spec#tag/Checkouts/operation/CreateCheckout) API request.

Saved **bank** methods are not offered as selectable options when ACH is disabled for the checkout (`payment_settings.ach_payments === false`), even if the payment method group contains bank accounts.

This component is **designed to be used within** the `justifi-modular-checkout` and **does not accept props directly**. Instead, it relies on shared state passed through the Stencil Store, managed by the wrapper component.

**Authorization** and business context are also handled by `justifi-modular-checkout`, which manages authentication tokens and related configuration.

This component exposes **no public methods or properties** and is not intended for standalone use.

## 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-saved-payment-methods</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>
  /** These are the available parts for styling the component. */ ::part(text){' '}
  {
    // text styles
  }
  ::part(text-danger){' '}
  {
    // text danger styles
  }
  ::part(label){' '}
  {
    // label styles
  }
  ::part(input-radio){' '}
  {
    // input radio styles
  }
  ::part(input-radio-focused){' '}
  {
    // input radio focused styles
  }
  ::part(input-radio-checked){' '}
  {
    // input radio checked styles
  }
  ::part(input-radio-checked-focused){' '}
  {
    // input radio checked focused styles
  }
  ::part(input-radio-invalid){' '}
  {
    // input radio invalid styles
  }
</style>

</head>

<body>
  <justifi-modular-checkout auth-token="authToken" checkout-id="ch_123">
    <justifi-saved-payment-methods />
  </justifi-modular-checkout>
</body>

<script>
  (function() {
    const checkoutWrapper = document.querySelector('justifi-modular-checkout');
    const submitButton = document.querySelector('#submit-button');

    submitButton.addEventListener('click', () => {
      checkoutWrapper.submitCheckout();
    });

    checkoutWrapper.addEventListener('error-event', (event) => {
      console.error(event.detail);
    });

    document.addEventListener('submit-event', (event) => {
      console.log('Checkout completed successfully!', event.detail);
    });
  })();
</script>

</html>`}</CodeBlock>

## Props, Events & Methods

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

### Events

This component does not emit any events directly. Events are handled by the parent `justifi-modular-checkout` component.

## Theming & Layout

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