Express Wallets

A variant of Embedded Payments that shows only the Apple Pay and Google Pay buttons - no card form, no tabs. Use it for a "Buy now" button on a product or basket page.

It uses the <super-single-checkout> web component instead of <super-checkout>. The checkout-session and payment-completion steps are identical to the standard flow, so this guide links out to those and focuses on what's different: mounting the component and handling the wallet response.

Prerequisites


1. Mount the Express Wallets Component

Add the payment.js library (same script as the standard flow) and the <super-single-checkout> element, with payment-to-display set to EXPRESS_WALLETS:

<html>
  <head>...</head>
  <body>
    ...
    <script src="https://cdn.superpayments.com/js/payment.js"></script>
    <super-single-checkout
      id="super-express-wallets"
      amount="AMOUNT"
      currency="GBP"
      checkout-session-token="CHECKOUT_SESSION_TOKEN_FROM_STEP_1"
      payment-to-display="EXPRESS_WALLETS"
      display-auth="false"
    ></super-single-checkout>
    ...
  </body>
</html>
<html>
  <head>...</head>
  <body>
    ...
    <script src="https://cdn.superpayments.com/js/test/payment.js"></script>
    <super-single-checkout
      id="super-express-wallets"
      amount="AMOUNT"
      currency="GBP"
      checkout-session-token="CHECKOUT_SESSION_TOKEN_FROM_STEP_1"
      payment-to-display="EXPRESS_WALLETS"
      display-auth="false"
    ></super-single-checkout>
    ...
  </body>
</html>
Attribute
Description
amount
Amount to charge, in minor units (e.g. 1000 = £10.00).
currency
The currency to charge in, for example GBP. Read once when the component mounts - changing it afterwards has no effect, so re-create the component if your page switches currency.
checkout-session-token
Token returned from Step 1.
payment-to-display
Set to EXPRESS_WALLETS to render only the Apple Pay and Google Pay buttons. This is the only supported value.
display-auth
Set to false to hide the mobile number login. Leave it out and the component also shows Super's 1-click login prompt alongside the wallet buttons.

2. Register the Wallet Payment Handler

Unlike <super-checkout>, <super-single-checkout> does not expose a window.superCheckout global. Register the handler on the element itself once it is defined. The element is not available as soon as the page loads, so poll for it:

const ELEMENT_ID = 'super-express-wallets';

const poll = setInterval(() => {
  const el = document.getElementById(ELEMENT_ID);
  if (typeof el?.registerWalletsHandler !== 'function') return;

  clearInterval(poll);
  el.registerWalletsHandler((event) => handleWalletPayment(event.detail));
}, 500);

billingAddress and shippingAddress are always requested, so event.detail always carries both - ignore shippingAddress if your order does not need it. The field names differ between the two wallets:

{
  "type": "applepay",
  "billingAddress": {
    "givenName": "John",
    "familyName": "Smith",
    "addressLines": ["221B Baker Street"],
    "locality": "London",
    "postalCode": "NW1 6XE",
    "administrativeArea": "England",
    "countryCode": "GB",
    "emailAddress": "[email protected]"
  },
  "shippingAddress": {
    "givenName": "John",
    "familyName": "Smith",
    "addressLines": ["10 Downing Street"],
    "locality": "London",
    "postalCode": "SW1A 2AA",
    "administrativeArea": "England",
    "countryCode": "GB",
    "emailAddress": "[email protected]"
  },
  "email": "[email protected]"
}
{
  "type": "googlepay",
  "billingAddress": {
    "name": "John Smith",
    "address1": "221B Baker Street",
    "locality": "London",
    "administrativeArea": "England",
    "postalCode": "NW1 6XE",
    "countryCode": "GB",
    "phoneNumber": "07462123456"
  },
  "shippingAddress": {
    "name": "John Smith",
    "address1": "10 Downing Street",
    "locality": "London",
    "administrativeArea": "England",
    "postalCode": "SW1A 2AA",
    "countryCode": "GB",
    "phoneNumber": "07462123456"
  },
  "email": "[email protected]"
}
Field
Apple Pay
Google Pay
Send as
Name
givenName, familyName
name - one string
firstName, lastName
Street
addressLines - an array of any length
address1, address2, address3
addressLine1, addressLine2, addressLine3
City
locality
locality
city
Region
administrativeArea
administrativeArea
stateOrProvince
Postcode
postalCode
postalCode
postCode
Country
countryCode
countryCode
country
Email
emailAddress on each address, and detail.email
detail.email only
email
Phone
not returned
phoneNumber
phone
⚠️

Work out shipping and tax before you create the session

The wallet only returns an address after the customer has authorised the payment, and the amount is fixed by then. Super does not recalculate shipping or tax from it.

This matters most where express buttons usually go. On a product or basket page you often have no address yet, so anything that depends on one - delivery cost, tax, or whether you ship there at all - has to be settled before you create the checkout session. If you cannot, use the standard checkout instead.

billingAddress and shippingAddress come straight from Apple and Google in their own raw shapes, so check type before reading them.

3. Complete the Payment

Send event.detail to your backend and let it do whatever it needs to do on your side first - for example,
creating the order using detail.email, detail.billingAddress, and detail.shippingAddress. Once that's done, your backend calls the /proceed endpoint from Step 4 - Complete the payment to complete the payment, same as in the standard flow.

billingAddress/shippingAddress come straight from Apple/Google in their own raw per-wallet shapes (see detail.type), so your backend needs to branch on type to read the right fields when it builds its own order and, eventually, the /proceed request. Send the raw event.detail rather than mapping it in the browser - that way the exact wallet payload lands in your own logs, and if an address arrives wrong you can tell whether the wallet or your mapping caused it.

3D Secure on Wallet Payments

Most wallet payments complete without a challenge, because the card is device-tokenised. Google Pay can still require 3D Secure, though - when the saved card is PAN_ONLY card-on-file rather than an Android device-tokenised card (CRYPTOGRAM_3DS), or when the merchant or payment gateway explicitly asks for authentication.

When that happens the customer is redirected to complete the challenge and then returned to your successUrl or failureUrl. The payment still completes. But a redirect rather undoes the point of an express button, so if you want the challenge to happen inline on your page instead, follow Keeping the Customer on Your Page During 3D Secure - you pass preferNativeActions on the /proceed call and hand the response back to the component.

❗️

Always complete the payment server-side

As with the standard flow, the /proceed call in Step 4 must be made server-side, using your
paymentInitiatorId. Never call it directly from the browser.


Did this page help you?