Description
The PaymentCard component is a dynamic defined visual component imitate a physical payment card. It exists as an independent extension to Eufemia.
How to use it:
- First, define your desired look and design.
- And import and include it in your application:
import '@dnb/eufemia/extensions/payment-card/style'import PaymentCard, {getCardData,} from '@dnb/eufemia/extensions/payment-card'render(<PaymentCard product_code="..." />)
Resources:
Demos
Basic example
Basic card using productCode.
<PaymentCard product_code="NK1" card_number="************1337" />
Custom card using rawData
You may have to import the extra named exports:
import PaymentCard, {getCardData,Designs,ProductType,CardType,} from '@dnb/eufemia/extensions/PaymentCard'
const customData = {productCode: 'UNDEFINED',productName: 'DNB Custom Card',displayName: 'Custom card',cardDesign: Designs.gold,cardType: CardType.Visa,productType: ProductType.BankAxept,}render(<PaymentCardproduct_code="UNDEFINED"raw_data={customData}card_number="************1337"/>)
Basic card using a status
<PaymentCardproduct_code="VG2"card_status="blocked"card_number="************1337"/>
Basic card using product code and status.
Basic card in compact variant
NB: The compact variant have to be aligned to a not yet defined SSOT style.
<PaymentCardvariant="compact"product_code="VG1"card_number="************1337"/>
Demo cards
A few selected cards to showcase all the different PaymentCard designs.
White
My first
Youth
Pluss
Gold
Saga
Saga platinum
Private Banking
Mastercard Black
Bedriftskort BankAxept
Bedriftskort Visa
const demoCards = ['VE1','VL2','VX1','VX3','VL1','096','VG1','VP2','VP3','P101','BK1','VB2',]const Cards = () => (<>{demoCards.map((product_code) => {const cardData = getCardData(product_code)return (<article key={product_code}><H4>{cardData.cardDesign.name}</H4><PaymentCardproduct_code={product_code}card_number="************1337"/></article>)})}</>)render(<Cards />)