Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6 - Fixing Card 'payButton' typescript type #2742

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/lib/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import ClickToPayWrapper from './components/ClickToPayWrapper';
import { ComponentFocusObject } from '../../types/global-types';
import SRPanelProvider from '../../core/Errors/SRPanelProvider';
import { TxVariants } from '../tx-variants';
import { UIElementStatus } from '../internal/UIElement/types';
import type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';
import UIElement from '../internal/UIElement';
import PayButton from '../internal/PayButton';
import { PayButtonProps } from '../internal/PayButton/PayButton';
import type { ICore } from '../../core/types';
import {
ANALYTICS_FOCUS_STR,
Expand Down Expand Up @@ -70,7 +69,7 @@ export class CardElement extends UIElement<CardConfiguration> {
this.clickToPayRef = ref;
};

formatProps(props: CardConfiguration) {
formatProps(props: CardConfiguration): CardConfiguration {
// The value from a session should be used, before falling back to the merchant configuration
const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;

Expand Down Expand Up @@ -324,8 +323,7 @@ export class CardElement extends UIElement<CardConfiguration> {
return collectBrowserInfo();
}

// Override
protected payButton = (props: PayButtonProps) => {
protected override payButton = (props: PayButtonFunctionProps) => {
const isZeroAuth = this.props.amount?.value === 0;
const isStoredCard = this.props.storedPaymentMethodId?.length > 0;
return (
Expand Down
Loading