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
    • Transaction Webhook
    • Onboarding Webhooks
      • Application Status
      • Application Fixes
      • Equipment Tracking & Activation
        • 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
    • Cloud EMV
      • Working with Cloud EMV
        • Direct Data Transfer to Clearent's Cloud
        • Payment Authorization Process via Clearent's Quest Payment Gateway
    • JavaScript SDK
      • Prerequisites
        • Browser Support
      • Working with JavaScript SDK
        • Adding the Payment Form
        • Formatting the Payment Form
        • Processing the Payment
        • Using Apple Pay for Web
        • Using 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
    • Working with 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
    • Working with Mobile Card Reader
    • Working with iOS Framework for IDTech VP3300
      • Processing Payments for iOS Applications
        • Pairing the VP3300 Card Reader with Your iOS Phone or Tablet
        • Charging the VP3300 Card Reader
        • Reading the Card Data Using the IDTech VP3300
        • Clearent's iOS Framework for IDTech VP3300 - Pre-requisites
        • Clearent's iOS Framework for IDTech VP3300 - Additional Configuration
        • Adding Clearent's iOS Framework into your iOS Application
        • Setting Up Clearent's iOS Framework for your Objective-C iOS App
        • Starting a Transaction using Clearent's iOS Framework
        • Starting a Connection using Clearent's iOS Framework
        • Starting a Connection using Clearent's iOS Framework
        • Receiving Feedback Messages using Clearent's iOS Framework
    • Working with Android Framework for IDTech VP3300
      • Configuring an Android Framework for your App
      • Additional Configuration to your Android App
      • Generating a Transaction Token for Manual card Entry
      • Disabling Default EMV Configuration for the Card Reader
      • Configuring Experience with Clearent's Android Framework
  • ACH Transaction Integration
    • Integration Methods for the ACH Transactions
    • Processing an ACH Transaction
    • Getting an ACH Transaction
    • Creating an ACH Transaction Token
    • Handling Returns for the ACH Transactions
    • Checking an ACH Transaction Status
    • ACH Transaction Statuses
    • ACH Transaction Return Codes
  • Paylink
    • The Paylink URL
    • Working with the Paylink
      • Setting up the Paylink
      • Configuring the Paylink URL
      • Using the Paylink Settings API
        • Request Parameters
      • Getting the Paylink Settings
      • Applying the Paylink Settings
      • Sending the Paylink SMS
  • 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)
  • Financial Management
    • Overview
    • Merchant Pricing
  • Merchant Billing & Funding
  • Financial Reporting
  • Disputes Management
    • Understanding Charge Disputes
    • Managing Disputes in Merchant Portal
    • Managing Disputes via API (Coming Soon!)
  • 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
  • Offline Testing for Apple Pay
  • Calculating Final Transaction Cost
  1. Payment Processing Solutions
  2. JavaScript SDK
  3. Working with JavaScript SDK

Using Apple Pay for Web

PreviousProcessing the PaymentNextUsing Google Pay for Web

Last updated 7 days ago

Apple Pay for Web allows you to make secure payments using the Safari browser.

The following articles help you with the Apple Pay payment method.

Prerequisites

Follow the prerequisites below before you incorporate Apple Pay on your website:

  • Use the macOS version 10.12.1 or later for MacBook.

  • Use the iOS version 10.1 or later for iPhone.

  • Use the Safari browser on your Apple device.

  • Ensure your server supports Apple Pay.

  • Serve your application over HTTPS in both development and in production environments.

  • Use an SSL-certified domain.

  • Use a server with Transport Layer Security (TLS) protocol version 1.2 or later and a supported cipher suite.

  • Refer to the for setting up your production environment.

  • Implement the manual card entry of the JavaScript SDK solution.

Supported Payment Methods

You must have 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

Follow the below steps 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

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

  1. Send a notification to Clearent after you host the file with appropriate URL, to request to register and verify your domain with Apple.

  2. You will receive confirmation after successful domain verification with Apple from Clearent.

Setting Up Apple Pay

Adding the Apple Pay Button

1

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

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

You can use the following example to request button type for your website.

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

Add the function below to your website 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

Follow the below steps to configure the onClick event for your payment process:

1

Configure the onClick event using the payment sheet object below 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

Clearent’s JavaScript SDK handles the Apple Pay token and converts it into the JWT that you process.

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 token provided by Clearent to your server using the secure transmission.

4

Provide the secret API key to Clearent from your server.

Note: Do not provide the secret API key from your website.

5

Return a successful token response you receive to the JavaScript SDK to handle it appropriately

Offline Testing for Apple Pay

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()
});

Note: Clearent manages the process for you by creating an Apple Merchant ID and CSR. For more information, see .

Note: 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 .

Note: Before moving to the next step, ensure you have integrated with Clearent’s 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.

Note: You can add the optional handler, which triggers when the customer clicks the Cancel button, to remove the payment page.

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