LogoLogo
API ReferencesGithubSupport CenterStatus pageBecome a Partner
  • Getting Started
    • Welcome
    • Our Products
  • Integration Process
  • Devices
    • Dejavoo
    • PAX
    • ID TECH
  • Become a Partner
  • Developer Resources
    • Overview
    • Sandbox & Production Environments
  • Testing Integration
    • Test Cards & ACH Accounts
    • Onboarding API Result Codes
    • Transaction Error Generation Data
    • Card Response & Result Codes
      • Card Error Response Codes
      • Card Transaction Result Codes
      • CSC Response Codes
      • AVS Response Codes
      • Duplicate Transaction Settings
    • ACH Request Validation & Return Codes
      • ACH Request Validation Codes
      • ACH Return Codes
  • API Catalog
    • Merchant Onboarding APIs
    • Transaction (Quest) APIs
    • Automated Merchant Onboarding Setup API
    • Reporting API
  • Webhooks
    • Prerequisites
    • Register Endpoint
    • Webhook Subscriptions
    • Working with Webhooks
      • Transaction Webhook
      • Onboarding Webhooks
        • Application Status
        • Application Fixes
      • Equipment Tracking & Activation Webhooks
        • Equipment Tracking
        • Equipment Activation
  • Merchant Onboarding
    • Overview
  • Automated Merchant Onboarding
    • Prerequisites
    • Working with Automated Merchant Onboarding
      • Generating a Merchant Application
      • Completing the Application
      • Modifying Default Merchant Pricing
        • Retrieving Existing Pricing Templates
        • Modifying Pricing Fees & Completing Merchant Application Record
    • Merchant Onboarding Status Webhooks
    • Configuring Automated Merchant Onboarding
  • Merchant Onboarding via Partner Portal
    • Starting New Application
    • Adding Hierarchy & Compensation Details
    • Entering Business Information
    • Entering Profile Details
    • Conducting the Site Survey
    • Configuring Pricing Details
    • Adding Banking Information
    • Adding Equipment
    • Submitting Signature
    • Reviewing & Submitting Application
    • Viewing Application Summary
  • Merchant Onboarding via API
    • Prerequisites
    • Understanding Integration
    • Working with Merchant Onboarding API
      • Creating a Merchant Profile
      • Completing the Merchant Application
        • Gathering Merchant Demographics
        • Configuring Merchant Pricing
        • Ordering and Setting Up Equipment
      • Submitting the Signature
      • Submitting the Application
  • Payment Processing Solutions
    • Overview
    • JavaScript SDK
      • Prerequisites
        • Browser Support
      • Working with JavaScript SDK
        • Adding the Payment Form
        • Formatting the Payment Form
        • Processing the Payment
        • Apple Pay for Web
        • Google Pay for Web
        • Using IDTech VP8300
      • Card Validations
        • Card Number Validation
        • Card Expiration Date Validation
        • Card CSC/CVC Validation
      • Configuring with JavaScript SDK
        • Using Members
        • Using Methods
  • Hosted Payments
    • Prerequisites
      • Browser Support
    • Integrating the Hosted Payments
      • Configuring the Pay Now Button
      • Configuring Payment Page with an Amount Field
      • Configuring Payment Page with an Optional Billing Address and Headline Text
      • Configuring Payment Page with the Save Card Option
      • Configuring the Add Payment Method Button
      • Styling Your Brand on the Payment Page
      • Configuring Apple Pay for Web
      • Configuring Hosted Payment Page Using Members
      • Configuring Hosted Payment Page Using Methods
      • Configuring Hosted Payment Page Using Functions
    • Transaction Responses
      • Successful Transaction Response
      • Successful Transaction Response for a Billing Address
      • Failed Transaction Response
      • Unauthorized Request Response
      • Successful Transaction Response for a Token
      • Successful Token Request Response
    • Response Validations
      • Successful Transaction Response Validation
      • Failed Transaction Response Validation
    • Card Validations
  • Mobile EMV SDK
    • VP3300 Mobile Card Reader
      • Charging the card reader
      • Reading the card data
    • iOS Framework
      • iOS Framework Pre-requisites
      • Processing payments in your iOS app
        • Optional settings
        • Starting a Bluetooth connection
        • Pairing the card reader with an iOS device
        • Integrating the iOS framework into your app
        • Setting up the iOS framework in your Objective-C app
        • Starting a transaction in your iOS app
        • Receiving feedback messages
    • Android Framework
      • Integrating the Android framework into your app
      • Additional settings
      • Generating a JSON Web Token
      • Disabling default EMV configuration
  • ACH Transactions
    • Submitting the payment request
    • Creating an ACH token
    • Getting an ACH transaction
    • ACH transaction statuses
    • ACH transaction return codes
  • Paylink
    • Getting the paylink settings
    • Creating the paylink
    • Sending the paylink
    • Paylink URL
  • Virtual Terminal
    • Working with the Virtual Terminal
      • Accessing Virtual Terminal
      • Adding or Ordering the Equipment
      • Recurring Payments
        • Adding a New Customer
        • Adding a Payment Method
        • Adding a New Payment Plan
        • Viewing the Plans
      • Processing Sales Transaction
      • Processing ACH Transaction
      • Transaction Search
        • Viewing Transactions
        • Viewing Transaction Receipt
        • Printing Transaction Receipt
        • Emailing Transaction Receipt
        • Void a Transaction
        • Refund a Transaction
        • Processing Pending Transactions
      • Open Batches
        • Viewing Batches
      • VT Settings
        • Merchant
        • Terminal
        • External Terminal
        • Address Verification (AVS)
        • Card Security Code (CSC)
        • Hosted Payment Page (HPP)
  • Cloud EMV
    • Working with Cloud EMV
      • Direct Data Transfer to Cloud
      • Payment Authorization Process via Quest Payment Gateway
  • Financial Management
    • Overview
    • Merchant Pricing
  • Merchant Billing & Funding
  • Financial Reporting
  • Disputes Management
    • Understanding Disputes
    • Managing Disputes via Merchant Portal
    • Managing Disputes via API (Pilot Mode)
  • Reporting
    • Overview
  • Reporting Solutions
  • Working with Reporting API
    • Accessing Reports
    • Retrieving Reports
    • Exporting Reports
  • Support Ticketing
    • Overview
    • Benefits of Support Ticketing System
    • Accessing Support in the Portals
    • Working with Support Ticketing via Partner Portal
      • Types of Support Tickets
      • Submitting a Support Ticket via Partner Portal
  • Working with Support Ticketing via Merchant Portal
    • Types of Support Tickets
    • Submitting a Support Ticket via Merchant Portal
  • Partner & Merchant Solutions
    • Overview
    • Accessing the Portals
    • Navigating the User Interface
    • Working with the Partner Portal
      • Monitoring Performance with Dashboards
      • Managing Merchant Applications
      • Managing Merchants
      • Accessing Reports & Managing Subscriptions
        • Accessing Reports
        • Managing Subscriptions
      • Submitting a Support Ticket
  • Working with the Merchant Portal
    • Monitoring Home Page
    • Accessing Batches
    • Managing Transactions
    • Managing Funding Transactions
    • Managing Virtual Terminal
    • Viewing Chargebacks
    • Managing Disputes
    • Managing Statements & Tax Forms
    • Managing Account Settings
    • Managing User Notifications
    • Managing Support Tickets
  • Security Solutions
    • Overview
    • PCI Compliance
    • Tokenization
    • Encryption
    • Advanced Compliance & Security Measures & Programs
Powered by GitBook

Resources

  • Contact
  • Support Site
  • Campus

Terms & Policies

  • Terms
  • Privacy Policy
  • Disclosures
  • Merchant Agreement

Cookies

  • Cookie List
  • Cookies Settings

Site Info

  • Sitemap

© 2025 Clearent, LLC is a registered agent for Central Bank of St. Louis, MO; Citizens Bank, N.A., Providence, RI; and Pathward, N.A., Sioux Falls, SD.

On this page
  • Prerequisites
  • Supported Payment Methods
  • Unsupported Payment Methods
  • Getting Started
  • Setting Up Apple Pay
  • Adding the Apple Pay Button
  • Configuring the onClick Event
  • Testing Apple Pay for Web
  • Calculating Final Transaction Cost

Was this helpful?

Export as PDF
  1. Payment Processing Solutions
  2. JavaScript SDK
  3. Working with JavaScript SDK

Apple Pay for Web

PreviousProcessing the PaymentNextGoogle Pay for Web

Last updated 6 days ago

Was this helpful?

Apple Pay for Web lets you accept payments from customers using the Safari browser on their iOS devices.

The following sections explain how to integrate Apple pay on your website.

Prerequisites

Make sure the following requirements are met before integrating Apple Pay and accepting payments on your website:

  • A MacBook running macOS 10.12.1 or later

  • An iPhone running iOS 10.1 or later

  • Safari browser

  • A server that supports Apple Pay

  • An application served over HTTPS in both development and production environments

  • A valid SSL-certified domain

  • A server that supports Transport Layer Security (TLS) version 1.2 or later

Refer to the for setting up your production environment.

Always implement manual card entry in the JavaScript SDK as a fallback option.

Supported Payment Methods

You can collect the payment and address information of your customers who use Apply Pay.

Supported Cards

  • Visa

  • MasterCard

  • American Express

  • Discover

Merchant Capabilities

  • Credit cards (Visa or Mastercard)

  • Debit cards (Visa or Mastercard)

Unsupported Payment Methods

  • In-App Payments

  • Recurring Payments

  • Split Shipment

  • Voids/Refunds through Apple Pay

Getting Started

To register and verify your domain with Apple:

  1. Provide your domain(s) that will be used for Apple Pay.

  2. Host the verification file provided by Clearent to you on the following URL, replacing [DOMAIN_NAME] with your domain name.

URL: https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association

This URL must be publicly accessible to allow Apple to verify the file.

  1. Send the hosted file with the appropriate URL to register and verify your domain with Apple.

  2. Clearent will confirm once your domain is successfully verified.

Setting Up Apple Pay

Adding the Apple Pay Button

1

Create a container on your website to add the Apple Pay button with the default style.

<button id="apple-pay-button" class=""></button>

To request button type for your website:

{
    "total": {
        "label": "AAA",
        "type": "final",
        "amount": "1.99"
    }
}
2

Add the function to check whether your customer uses Apple Pay. This function helps you decide whether to display the Apple Pay button in the customer’s browser.

ClearentSDK.applePayAvailable()

Configuring the onClick Event

To configure the onClick event for your payment process:

1

Add the onClick object into your payment sheet to start the Apple Pay session.

if(ClearentSDK.applePayAvailable()) {
  let applyPaymentSheet = YOUR_PAYMENT_SHEET
  jq2("#apple-pay-button").on("click", () => {
      const session = ClearentSDK.buildApplePaySession(applyPaymentSheet);
// optional dynamic handling events can be added here (see below for details)
      session.begin()
  });
}
2

The JavaScript SDK handles the Apple Pay token and converts it into a JSON Web Token (JWT).

function ClearentTokenSuccess(raw, json) {
    console.log("ClearentTokenSuccess");
    console.log(raw);
    console.log(json);
    console.log("-----------------------------------------------");
    console.log("now you can send the token to your server");
    console.log("to complete the transaction via mobile-gateway");
    console.log("-----------------------------------------------")
}
function ClearentTokenError(raw, json) {
    console.log("ClearentTokenError");
    console.log(raw);
    console.log(json);
}
3

Send the JSON Web Token (JWT) to your server using a secure connection.

4

Provide the secret API key to Clearent from your server.

Don’t expose the secret API key in your website code.

5

Clearent returns a successful token response.

6

Send the token response to the JavaScript SDK for handling.

Testing Apple Pay for Web

Apple requires an offline test implementation of Apple Pay for apps, websites, and point-of-sale systems.

Calculating Final Transaction Cost

You can calculate final transaction cost using customer’s payment method, billing address, shipping address, and shipping method:

Refer the following example to implement the optional handlers in your payment sheet:

Example:

jq2("#apple-pay-button").on("click", () => {
    const session = ClearentSDK.buildApplePaySession(request);
  session.onshippingmethodselected = function (event) {
    selectedShippingMethod = event.shippingMethod
    const newTotalAmount = calculateTotal….
    const newLineItems = [update line items…]
    session.completeShippingMethodSelection(
      {
        newTotal: {
          label: request.total.label,
          amount: newTotalAmount,
          type: final }, // newTotal is required
        newLineItems,
      }
    )
  }
   session.oncancel = function(event) {
       …add logic for when session is cancelled by user
}
…. Other optional handlers can be added here
    session.begin()
});

Clearent handles the process for you by creating an Apple Merchant ID and Certificate Signing Request. For more information, see .

Apple provides several types of buttons so that you can choose the button type that fits best with the terminology and flow of your purchase or payment experience. For more information on Apple Styling Guidelines, see .

Before moving to the next step, ensure you have integrated with JavaScript SDK to avoid an error. For more information, see .

You can test your Apple Pay transaction using the reference.

If you want to calculate the final transaction cost using payment method, add the optional handler in your payment sheet.

If you want to calculate the final transaction cost using shipping method, add the optional handler in your payment sheet.

If you want to calculate the final transaction cost using billing address and shipping address, add the optional handler in your payment sheet.

You can add the optional handler, which triggers when the customer clicks the Cancel button, to cancel the Apple Pay session.

Apple Server Configurations
Merchant Validation
Apple Developer Documentation
Apple Pay
JavaScript SDK
Sandbox testing
onpaymentmethodselected
onshippingmethodselected
onshippingcontactselected
oncancel