• 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, remove card

Wallet allows users to add and use payment methods within their account to make payments on Abeille Assurances websites. This addition allows users to remove an existing card from within wallet.


Design and usage

Structure

  • When the user requests to remove a card, a full screen modal is shown to ask for confirmation.
  • Within the modal, a visual representation of the card the user wishes to delete is shown to help reaffirm they are deleting the right card. NOTE: If the card is linked to ongoing or scheduled payments (like an auto renewal) the screen should carry a message informing the user of the impact on those paymentsoOur design example is based on a UK scenario where removing a card doesn't stop the regular payments.
  • Dates on the card are shown as MM/YY but can be shown as MM/YYYY when needed.
  • When a card is successfully removed, a success notification is shown on the underlying page, just above the list of stored cards.

Labels

  • All modals must have a 'Cancel' form button and the 'Close' modal button.
  • Card number is masked and only shows the last 4 digits.
  • The modal title for removing the card must replay the last 4 digits of the user's card.
  • PROHIBITED: Remove button cannot be a short label like 'yes' or 'remove'; the button must carry a descriptive action, eg. 'Yes, remove this card'.

Errors

  • If an error occurs, and a card cannot be deleted, an error notification would be displayed on the page where their stored cards are shown to say that an error has occurred, that they cannot currently delete their card and to try again later.

Non-JS requirements and considerations

  • Instead of displaying these screens in a modal, each screen appearson its own separate page.

Placement

  • Full screen modal forms show as built and the layout cannot be modified.

Examples

Interactive example

Code example

Remove card - modal trigger button

<a href="..." class="a-button" data-module="o-modal" data-module-load="true" data-modal-fullscreen="true" data-modal-wallet="true">Edit card</a>

Remove card - content

<div class="l-content-container o-wallet-wrapper o-wallet-wrapper--remove">
	<div class="o-wallet" data-module="o-wallet" data-variant="remove">
		<div class="o-wallet-add-edit-remove">
			<div class="o-wallet-card-display [ modifier ]">
				<div class="l-content-container">
					<h1 class="a-heading a-heading--1 o-wallet-add-edit-remove-heading">Remove card ending <strong>...</strong></h1>
					<h2 class="a-heading a-heading--3 o-wallet-add-edit-remove-subheading">Are you sure you want to remove this card?</h2>
					<div class="o-wallet-card-display-inner t-accent-dark">
						<p class="o-wallet-card-display-inner__number"><small>Card ending:</small><span>XXXX ...</span></p>
						<p class="o-wallet-card-display-inner__expiry"><small>Expires:</small><span>...</span></p>
						<p class="o-wallet-card-display-inner__name">...</p>
					</div>
					<div class="m-form-row m-form-row--full-width o-wallet-add-edit-remove-buttons">
						<div class="m-form-row__content">
							<ul class="m-button-group">
								<li class="m-button-group__item"><button class="a-button a-button--primary" type="submit">Yes, remove this card</button></li>
								<li class="m-button-group__item"><button class="a-button a-button--secondary">Cancel</button></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

Development and test

Notes for developers

Basic setup

For basic information about setting up wallet, including standard classes, information regarding locale settings, card types and so on, please visit the Wallet documentation page.

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".

Extension component

This component forms part of the 'payments' extension and so requires an additional stylesheet to be loaded in order to be used; include the following code in the header of your page to attach the relevant additional stylesheet:

<link media="all" href="./assets/[ theme type ]/[ release version ]/[ organisation ]/[ theme name ]/css/payments.css" rel="stylesheet" />

Notes for testers

  • Ensure that all form fields have a correctly associated label. This not only provides context to each field for assistive technology users but also a larger clickable area to select the field. Clicking/pressing on a label for a single input field should cause the input to gain focus.
  • Ensure that autofill is not available for sensitive fields such as password, card/account number etc.
  • Users should be able to copy and paste if necessary.
  • If the field has been restricted in length the maximum number of characters allowed must also be restricted. Note: many browsers will not do this for number field and older browsers will not do this at all.

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-wrapper .o-wallet-wrapper--remove Base style for main wallet remove card area Yes .o-wallet-outer-wrapper > div  
.o-wallet Base style wrapping container of wallet organism Yes .o-wallet-wrapper > div Defines styling for standard form elements when used within wallet
.o-wallet-add-edit-remove Style for main form rows wrapper Yes .o-wallet > div  
.o-wallet-card-display Base style for card display area Yes .o-wallet-add-edit-remove > div  
.o-wallet-add-edit-remove-heading Style for card display heading at mobile Yes .o-wallet-display > l-content-container > h1  
.o-wallet-add-edit-remove-subheading Style for card display heading at mobile   .o-wallet-display > l-content-container > h3  
.o-wallet-card-display-inner Style for card display inner content wrapper Yes .o-wallet-display > l-content-container > div  
.o-wallet-card-display-inner__number Style for card number within card display Yes .o-wallet-display-inner > p  
.o-wallet-card-display-inner__expiry Style for expiry date within card display Yes .o-wallet-display > p  
.o-wallet-card-display-inner__name Style for card holder's name within card display Yes .o-wallet-display > p  
.o-wallet-add-edit-remove-buttons Style for form row containing primary and secondary CTAs Yes .o-wallet-card-display > .l-content-container > .m-form-row  
.o-wallet-card-display--american-express Modifier for card icon image   .o-wallet-card-display American Express
.o-wallet-card-display--dankort Modifier for card icon image   .o-wallet-card-display Dankort
.o-wallet-card-display--diners-club Modifier for card icon image   .o-wallet-card-display Diners Club
.o-wallet-card-display--discover Modifier for card icon image   .o-wallet-card-display Discover
.o-wallet-card-display--jcb Modifier for card icon image   .o-wallet-card-display JCB
.o-wallet-card-display--maestro Modifier for card icon image   .o-wallet-card-display Maestro
.o-wallet-card-display--mastercard Modifier for card icon image   .o-wallet-card-display Mastercard
.o-wallet-card-display--mir Modifier for card icon image   .o-wallet-card-display MIR
.o-wallet-card-display--rupay Modifier for card icon image   .o-wallet-card-display Rupay
.o-wallet-card-display--unionpay Modifier for card icon image   .o-wallet-card-display Unionpay
.o-wallet-card-display--visa Modifier for card icon image   .o-wallet-card-display VISA
.o-wallet-card-display--visa-electron Modifier for card icon image   .o-wallet-card-display VISA Electron

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