Add Billing Details updating when a new card gets selected

This commit is contained in:
Daniel Dudzic 2024-09-11 22:58:13 +02:00
parent 861034855e
commit 24a481bdeb
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
12 changed files with 399 additions and 152 deletions

View file

@ -11,14 +11,8 @@ const cardIcons = {
UNIONPAY: 'unionpay-light.svg',
};
export const CreditCard = ( {
card,
shippingAddress,
fastlaneSdk,
showWatermark = true,
} ) => {
const { brand, lastDigits, expiry } = card?.paymentSource?.card ?? {};
const { fullName } = shippingAddress?.name ?? {};
export const CreditCard = ( { card, fastlaneSdk, showWatermark = true } ) => {
const { brand, lastDigits, expiry, name } = card?.paymentSource?.card ?? {};
const cardLogo = useMemo( () => {
return cardIcons[ brand ] ? (
@ -48,7 +42,7 @@ export const CreditCard = ( {
{ cardLogo }
</div>
<div className="wc-block-checkout-axo-block-card__meta">
<span>{ fullName }</span>
<span>{ name }</span>
<span>{ formattedExpiry }</span>{ ' ' }
</div>
</div>