Skip to main content

Apple Pay

Overview

Renders an Apple Pay button for eligible devices and orchestrates the Apple Pay flow. Designed to be used within justifi-modular-checkout.

Usage

<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<title>justifi-apple-pay</title>

<script type="module" src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@6.7.3/dist/webcomponents/webcomponents.esm.js"></script>

<script
nomodule
src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@6.7.3/dist/webcomponents/webcomponents.js"
></script>

<style>
/** These are the available parts for styling the component. */ ::part(button){' '}
{
  // button styles
}
</style>

</head>

<body>
<justifi-modular-checkout
  auth-token="authToken"
  checkout-id="ch_123"  
>
  <justifi-apple-pay />
  <justifi-checkout-summary />
</justifi-modular-checkout>
</body>
</html>

Props, Events & Methods

NameTypeRequiredDefaultDescription
button-style`ApplePayButtonStyle.BLACKApplePayButtonStyle.WHITEApplePayButtonStyle.WHITE_OUTLINE`No
button-type`ApplePayButtonType.BOOKApplePayButtonType.BUYApplePayButtonType.CHECK_OUTApplePayButtonType.DONATE
country-codestringNo"US"
disabledbooleanNofalse
heightstringNo"48px"
initiative-contextstringNo"dev-checkout.justifi-staging.com"
merchant-display-namestringNo"JustiFi Checkout"
merchant-identifierstringNo"merchant.com.staging-justifi.checkout-dev"
show-skeletonbooleanNotrue
widthstringNo"100%"

Events

  • applePayStarted: Fires when the Apple Pay sheet is presented.
  • applePayCompleted: Fires when payment completes; includes success status and payment method details.
  • applePayCancelled: Fires when the user dismisses the Apple Pay sheet.
  • applePayError: Surfaces tokenization failures (network issues, validation errors, etc.).

Public methods

  1. isSupported() – Check if Apple Pay is available on the current device/browser.
  2. getPaymentMethods() – Returns available payment method types.
  3. abort() – Programmatically cancel an in-progress Apple Pay session.

Theming & Layout

  • Styling is intentionally limited to keep Apple compliance.
PartDescriptionDOM target
::part(skeleton)