• Organism
  • CORE COMPONENT
  • Taxonomic name: O-WALLET
  • Extension: PAYMENTS
  • Added on: v3.4.0 (08/06/18)
  • Updated on: v5.9.0 (13/07/21)

Wallet, stored cards

Wallet allows users to add and use payment methods within their account to make payments on Abeille Assurances websites. This addition allows users to add, store and edit their payment cards on Abeille Assurances websites.


Design and usage

At the moment, core Framework functionality supports only credit/debit cards. Other payment methods will be added in future releases, but the code is flexible enough to allow teams to add their own sections in the meantime if so desired.

Credit/debit card

Structure

  • If no bank cards are stored, the default view would show an empty credit card pictograph
  • When a new bank card is saved it will replace the empty credit card pictograph
  • The colour of each bank card matches the colour of that card's brand i.e. Visa cards are coloured in a Visa blue. Refer to the designs for the different card colour patterns
  • Each bank card must show:

    • The card type – indicated by the card's brand logo/icon
    • The card's expiry date (dates are shown in a MM/YY format, but can be shown as MM/YYYY when needed)
    • The card number in a truncated format (i.e. '****' and then the last 4 digits of the card number)
  • Each bank card should also include:

    • The cardholder's name
    • A button to 'Edit' the card
    • A button to 'Remove' the card

    These three elements are optional if there are technical constraints in implementing them.

  • Each card can also have a default button functionality (optional)
  • If the default functionality is used, it follows these rules:

    • There can be only one default card at any one time
    • A card can be made/changed to the default card by clicking on the heart button on the card or by clicking on the card's "Edit"/"Update" button
    • When a default card is selected, the heart button on the card becomes filled, and, when the page is refreshed, the card is positioned first in the sequence of cards
    • If a different card is selected to be the default card, the old card transitions to a state of "Make default" and, when the page is refreshed, is placed in the second position in the sequence of cards (whilst the new default card is first in the sequence)
    • If a default card is deselected and no new card is selected to become the default, the card remains in its current position and transitions to the state of "Make default"
  • Stored cards run side by side on desktop and tablet and stack on mobile viewports
  • The maximum number of bank cards allowed is a configurable limit. Once this limit is reached, a warning notification is displayed above the bank cards prompting the user to delete any unused cards in order to add a new card
  • The cards are ordered by the most recently used to the least recently used card. If this is not possible, the cards are ordered from most recently added to the least recently added
  • If there is a default card, this card is the first one shown in the sequence
  • Expiring or expired cards show with a notification in place of the card allowing the card to be updated (if supported) or removed
  • Success notifications appear above the cards

Labels

  • Card number is masked and only shows the last 4 digits except during the adding screens when the number is shown in full
  • Edit and Remove links should be kept short to reduce the risk of wrapping
  • Make default label can use different copy

Errors

  • If the associated bank does not allow a particular card to be updated, then only the "Remove" button is shown – i.e. the "Update expiry date" button is not present
  • If a customer's stored cards cannot be shown, an error notification card is displayed instead, with a message like the following: "We can't show your stored cards right now. Your card details are still secure. Please refresh the page or call 01234 567 890 to change your stored cards"

Placement

  • The Wallet viewing UI section can be added anywhere in a page

Design anatomy

Desktop break point

  • The empty card pictogram spans across 3 columns and measures (W=285px H=168px)
  • An "Add new card" CTA sits underneath the credit card/s
  • Each new credit card spans across 4 columns (W=390px H=236px) with a 30px right and bottom margin
  • The maximum number of cards per row is 3

Tablet break point

  • The empty card pictogram inherits the desktop size card and measures (W=285px H=168px)
  • An "Add new card" CTA sits underneath the credit card/s
  • Each new credit card spans across 4 columns (W=344px H=220px) with a 20px right and bottom margin
  • The maximum number of cards per row is 2

Mobile break point

  • The empty card pictogram spans across 4 columns (W=280px H=168px)
  • An "Add new card" CTA sits underneath the credit card/s and spans across 4 columns (280px)
  • Each new credit card spans across 4 columns (W=280px H=220px) with a 30px bottom margin
  • With each subsequent new card added, the card stacks beneath the previous card

Sketch Columns

  • Desktop:

    • Width per card 3 columns (285px)
    • Max 3 cards per row (12 columns, 1230px)
  • Tablet:

    • Width per card 4 columns (344px)
    • Max 2 cards per row (8 columns, 708px)
  • Mobile:

    • Width per card 4 columns (280px)

Examples

Stored cards functional example

No stored cards example

Interactive example

Code example

<div class="o-wallet-stored-cards">
	<a class="o-wallet-card-display" href="..." data-module="o-modal" data-module-load="true" data-modal-fullscreen="true" data-modal-wallet="true" aria-label="Add a card">
		<div class="o-wallet-card-display-inner">
			<p class="o-wallet-card-display-inner__number">
				<span class="o-wallet-card-display-inner__number-title"></span>
				<span class="o-wallet-card-display-inner__number-data"></span>
			</p>
			<p class="o-wallet-card-display-inner__expiry">
				<span></span>
			</p>
			<p class="o-wallet-card-display-inner__name"></p>
		</div>
	</a>
</div>

Stored cards layout example

Interactive example

Code example

<ul class="a-list-plain o-wallet-stored-cards [ Modifier ]">
	<li class="o-wallet-card-display o-wallet-stored-cards__card [ Modifier ] t-accent-dark">
		<p class="o-wallet-stored-cards__default-card">default</p>
		<div class="o-wallet-card-display-inner">
			<p class="o-wallet-card-display-inner__number">
				<span class="o-wallet-card-display-inner__number-title">Card number:</span>
				<span class="o-wallet-card-display-inner__card-ending">Card ending </span>
				<span class="o-wallet-card-display-inner__number-data">...</span>
				<span class="o-wallet-card-display-inner__card-is-expiring"> is expiring</span>
				<span class="o-wallet-card-display-inner__card-has-expired"> has expired</span>
			</p>
			<p class="o-wallet-card-display-inner__expiry">Expires:<span>...</span></p>
			<p class="o-wallet-card-display-inner__name">...</p>
		</div>
		<ul class="m-button-group">
			<li class="m-button-group__item">
				<a class="a-button a-button--tertiary a-button--edit" href="...">
					<span class="a-button__inner">
						<span class="o-wallet-card-display-inner__edit-card">Edit<span class="u-hidden--visually"> card ending ...</span></span>
						<span class="o-wallet-card-display-inner__update-card">Update expiry date</span>
					</span>
				</a>
			</li>
			<li class="m-button-group__item">
				<a class="a-button a-button--tertiary a-button--delete" href="...">
					<span class="a-button__inner">Remove<span class="u-hidden--visually"> card ending ...</span></span>
				</a>
			</li>
		</ul>
	</li>
	<li>...</li>
</ul>

Development and test

Notes for developers

Basic setup

The stored card wallet uses a layout of modified cards to present the stored payment cards.

Visible labels and accessible names

The Edit and Remove links require an extra span with the class u-hidden--visually is required within the a-button__inner to hold the hidden text required to make the accessible name for the label meaningful to screen readers. The visible label should always come first, with the hidden text following on to extend this by adding meaning and context, for example:

<span class="a-button--inner" href="...">Remove<span class="u-hidden--visually"> card ending 7829</span></span>

Important messages

To help those using assistive technologies, make sure that success/error messages which need to be announced to users have their aria attributes updated to role="alert" and/or aria-live="assertive".

Card types

Card type
The issuing network
Length
Number of allowable digits
IIN ranges
The card number will always begin with…
Spacing pattern
How the digits and spaces are printed on the card
Security code length
American Express 15 34, 37 4-6-5 4
China UnionPay 16-19 62 4-4-4-4 3
Dankort 16 5019 4-4-4-4 3
Diners Club
Carte Blanche, International, United States and Canada
14, 16 300-305, 309, 36, 38-39 4-6-5 3
Discover 16 6011, 622126-622925, 644-65 4-4-4-4 3
JCB 16 3528-3589 4-4-4-4 3
Maestro 12-19 50, 56-58, 6 4-4-4-4-4 3
MasterCard 16 51-55, 2221-2720 4-4-4-4 3
Mir 16-19 22-2204 4-4-4-4 3
RuPay 16 60, 6521 4-4-4-4 3
Visa 13-19 4 4-4-4-4 3
Visa Electron 16 4026, 417500, 4405, 4508, 4844, 4913, 4917 4-4-4-4 3

Note: Ranges shown for the IIN are inclusive of the upper and lower limits.

The order these cards are tested in for a match is: Visa Electron, Visa, MasterCard, American Express, Diners Club, JCB, UnionPay, RuPay, Discover, Dankort, Maestro, Mir


Notes for testers

  • Ensure that links can be accessed via the mouse as well as via tabbing using the keyboard.
  • Ensure that when hovering over a link the style changes noticeably.
  • Ensure that when a link has focus the style changes noticeably.
  • Ensure that text within links is descriptive of what or where the link is going. Additional descriptive text can be hidden visually from the user to aid in make the link understandable especially if there area number of links such as "Find out more" on the page which go to different locations.
  • Use a screen reader to confirm that the links are understandable.

Classes overview

The following table gives you a quick overview of the CSS classes that can be applied.

Class Outcome Required Applied to Comments
.o-wallet-stored-cards Base style wrapping container of stored cards Yes div or ul Defines styling for stored cards. Use a-list-plain if presented as a list of cards.
.o-wallet-stored-cards__card Base style wrapping container of card details Yes .o-wallet-stored-cards div ot li Must be used in conjuntion with o-wallet-card-display and t-accent-dark.
.o-wallet-stored-cards__card--american-express Modifier for card type   .o-wallet-stored-cards__card American Express
.o-wallet-stored-cards__card--dankort Modifier for card type   .o-wallet-stored-cards__card Dankort
.o-wallet-stored-cards__card--diners-club Modifier for card type   .o-wallet-stored-cards__card Diners Club
.o-wallet-stored-cards__card--discover Modifier for card type   .o-wallet-stored-cards__card Discover
.o-wallet-stored-cards__card--jcb Modifier for card type   .o-wallet-stored-cards__card JCB
.o-wallet-stored-cards__card--maestro Modifier for card type   .o-wallet-stored-cards__card Maestro
.o-wallet-stored-cards__card--mastercard Modifier for card type   .o-wallet-stored-cards__card Mastercard
.o-wallet-stored-cards__card--mir Modifier for card type   .o-wallet-stored-cards__card MIR
.o-wallet-stored-cards__card--rupay Modifier for card type   .o-wallet-stored-cards__card Rupay
.o-wallet-stored-cards__card--unionpay Modifier for card type   .o-wallet-stored-cards__card Unionpay
.o-wallet-stored-cards__card--visa Modifier for card type   .o-wallet-stored-cards__card VISA
.o-wallet-stored-cards__card--visa-electron Modifier for card type   .o-wallet-stored-cards__card VISA Electron
.o-wallet-stored-cards--is-expiring Modifier to indicate the card is expiring   .o-wallet-stored-cards__card  
.o-wallet-stored-cards--has-expired-update Modifier to indicate the card has expired and to update   .o-wallet-stored-cards__card  
.o-wallet-stored-cards--has-expired-remove Modifier to indicate the card has expired and to remove   .o-wallet-stored-cards__card  
.o-wallet-stored-cards__default-card Styling for default card   .o-wallet-stored-cards__card > p Optional default card status. Markup only required on default card. If no default card indication required, no markup needed.
.o-wallet-card-display-inner Styling for payment card details Yes .o-wallet-stored-cards__card > div  
.o-wallet-card-display-inner__number Styling for payment card details Yes .o-wallet-card-display-inner p Card number positioning
.o-wallet-card-display-inner__number-title Styling for payment card details list Yes .o-wallet-card-display-inner__number span Card number title styling
.o-wallet-card-display-inner__card-ending Styling for payment card details list Yes .o-wallet-card-display-inner__number span Text for card expiring/expired alert
.o-wallet-card-display-inner__number-data Styling for payment card details list Yes .o-wallet-card-display-inner__number span Last four digits of card number positioning
.o-wallet-card-display-inner__card-is-expiring Styling for payment card details list Yes .o-wallet-card-display-inner__number span Text for card expiring alert
.o-wallet-card-display-inner__card-has-expired Styling for payment card details list Yes .o-wallet-card-display-inner__number span Text for card expired alert
.o-wallet-card-display-inner__expiry Styling for payment card details Yes .o-wallet-card-display-inner p Card expiry styling
.o-wallet-card-display-inner__name Styling for payment card details list Yes .o-wallet-card-display-inner p Card holder name positioning
.o-wallet-card-display-inner__edit-card Styling for edit button label depending on card staus Yes .a-button__inner > span  
.o-wallet-card-display-inner__update-card Styling for edit button label depending on card staus Yes .a-button__inner > span  

Keyboard operations

TAB

Tabbing to an input field should make the input clearly visually different so that the focus point on the page is obvious to the user.

Component releases

  • Added on: v3.4.0 (08/06/18)
  • Updated on: v5.9.0 (13/07/21)

Latest update:

  • updated: It is now recommended that the data attribute data-module-load="true" is added alongside data-module="o-modal" in order to force loading of the JavaScript on page load instead of it being lazy loaded. This helps mitigate issues where modal content could remain visible until the anchor it is associated with comes into view.

Full version history

A full history of changes and enhancements detailing all minor and major updates to the component.

View full version history

Want something new in Framework, or to chat about an issue you're having with it?

Contact the team