Saved Card

Provides a secure and user-friendly interface to let customers store, select, and reuse previously saved credit cards during the checkout process. Supports custom rendering, form validation, and installment selection.

Installation Method

You can use the following command to install the extension with the latest plugins:

npx @akinon/projectzero@latest --plugins

Props

Prop
Type
Required
Description

texts

SavedCardOptionTexts

No

Translations and text content used throughout the component, such as titles, button text, error messages, and installment labels.

agreementCheckbox

ReactElement

No

A custom checkbox element that is rendered before submitting the form (e.g., terms and conditions checkbox).

customRender

{ cardSelectionSection, installmentSection, agreementAndSubmit }

No

An object that allows partial or full customization of internal sections by providing custom render functions.

formWrapperClassName

string

No

CSS class applied to the wrapper <form> element.

cardSelectionWrapperClassName

string

No

CSS class applied to the card selection section wrapper.

installmentWrapperClassName

string

No

CSS class applied to the installment and submit section wrapper.

formProps

React.FormHTMLAttributes<HTMLFormElement>

No

Native HTML form props to apply to the wrapper <form> element.

cardSelectionWrapperProps

React.HTMLAttributes<HTMLDivElement>

No

Props applied to the card selection wrapper <div>.

installmentWrapperProps

React.HTMLAttributes<HTMLDivElement>

No

Props applied to the installment wrapper <div>.

SavedCardOptionTexts

Field
Type
Description

title

string

Title displayed above the card selection.

button

string

Submit button text.

installment

InstallmentTexts

Labels and headings for the installment section.

deletePopup

DeletePopupTexts

Translations for delete confirmation popup.

errors

ErrorTexts

Error messages used in form validation.

CustomRender

cardSelectionSection Props

Prop
Type
Description

title

string

Section title shown above the card list.

cards

any

Array of saved card objects fetched from state.

selectedCard

any

The currently selected card object.

onSelect

(card: any) => void

Function to call when a card is selected.

register

any

react-hook-form's register function for form integration.

errors

any

Object containing field errors.

dispatch

any

Redux dispatch function, passed for optional state updates.

installmentSection Props

Prop
Type
Description

title

string

Title for the installment section.

selectedCard

any

Currently selected card object.

installmentOptions

any

List of available installment options for the selected card.

translations

InstallmentTexts

Label texts (like "Per Month", "Total").

errors

any

Validation errors related to installment selection.

agreementAndSubmit Props

Prop
Type
Description

agreementCheckbox

ReactElement

undefined

control

any

react-hook-form control object, required for binding form state.

errors

any

Object containing validation errors.

buttonText

string

Submit button label (e.g., "Pay Now", "Continue").

Usage Examples

File Path:

Default Usage

CustomRender Usage

Last updated

Was this helpful?