Skip to main content

Enabling Apple Pay as a Payment Method

This article outlines how to implement Apple Pay as a payment method on your order form and upsell flow

Updated this week

​​Related: Your Order Form

In this article:

Apple Pay lets eligible customers check out faster using the cards saved in their Apple Wallet. When Apple Pay is enabled for your offer(s), a “Pay with Apple Pay” button appears on the order form for eligible customers.

Which payment types are supported by Apple Pay?

Apple Pay supports both one-time payments and recurring payments

See Apple Pays support documentation for additional information for support countries and regions: https://support.apple.com/en-us/102775

Will upsells also be paid with Apple Pay?

Yes, your customers will be able to pay for upsells, and order bumps with Apple Pay. If your customer selects “Pay with Apple Pay”, then Apple Pay becomes the default payment method during the upsell flow. If for whatever reason Apple Pay fails, the customer is returned to the original order form to provide a different payment method.

Getting Started

Contact your Account Manager to request Apple Pay feature enablement on your account.

This guild covers the Standard Apple Pay Setup. For Sellers with front-end development teams and expertise developers, refer see the Advanced Setup for additional configuration options.

The Standard Setup is designed for most sellers and does not require any custom code. You’ll enable Apple Pay in Vendor Settings, register up to three domains, and add a single consolidated script to your upsell pages.

1.1 Ask your Account Manager to enable Apple Pay for your Nickname

1.2 Configure the Apple Pay Ternary Switch & Domains

  1. Go to Vendor Settings → Order Form Control.

  2. Find the Payment Methods → Apple Pay section.

  3. Choose how Apple Pay should behave using the new ternary switch:

    • Disabled — Apple Pay is completely off.

    • Parameter Only — Apple Pay is enabled only when the apy parameter is present on your pay links (ideal for testing).

    • Enabled — Apple Pay is active on all supported order forms.

  4. Register up to three domains that will be used for your Apple Pay Merchant ID association.

Example Configuration Screen:

Example Configuration Screen

Domain & Association File Requirements

For each domain you enter in the Apple Pay section:

  • You must host ClickBank's merchant key on that domain.

    7b2276657273696f6e223a312c227073704964223a2241394235443542413534433135444531333435333445323731334441413739423943333735373341423533393146383844433946444346393742303037443238222c22637265617465644f6e223a31373730323333930363835307d

  • You must host the Apple Developer Merchant Association file at:

    https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association

Once the association file is reachable and the domain matches your entry in Vendor Settings, the domain can be registered with your Apple Merchant ID.

1.3 Add the Consolidated Apple Pay Script to Upsell Pages

For most use cases, you only need to add a single JavaScript file to the <head> of each upsell page.

Use this script for most setups. You may customize this script; however, if you plan to write your own custom Apple Pay integration to accommodate an advanced technology stack (frameworks, custom UI, etc.), skip this script and follow the Advanced Setup section instead.

Consolidated Upsell Script

Place this inside the <head> of each upsell page:

<script type="module">
(async () => {
var _a;
const sdkReady = new Promise((res) => {
window.addEventListener('CB-apple-pay-ready', res);
});
const urlParams = new URLSearchParams(window.location.search);
const isAppleCustomer = urlParams.get('pmt') === 'apple';
if (!isAppleCustomer || !((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePayments())) {
return;
}
const el = document.createElement('script');
el.src = 'https://apple-sdk.clickbank.net/cb-apple-pay.js';
el.type = 'module';
document.head.appendChild(el);
const itemToHrefMap = {};
const itemErrorCount = {};
let fallbackHref = '';
window.defaultCBAppleErrorHandler = (event) => {
const { type, item: incomingItem } = event.detail;
const item = incomingItem || 'global';
itemErrorCount[item] = (itemErrorCount[item] || 0) + 1;
if (itemErrorCount[item] > 1) {
const redirect = itemToHrefMap[item] || fallbackHref;
if (redirect) {
window.location.href = redirect;
}
}
switch (type) {
case 'payment':
window.alert('Payment not accepted - please try again!');
break;
default:
window.alert('Unable to process transaction - please try again!');
}
};
window.addEventListener('CB-apple-pay-error', window.defaultCBAppleErrorHandler);
const sheet = document.createElement('style');
sheet.innerHTML = `@supports (-webkit-appearance: -apple-pay-button) {
.CB-apple-pay-button {
height: 3.125rem;
width: 200px;
display: inline-block;
-webkit-appearance: -apple-pay-button;
-apple-pay-button-type: buy;
-apple-pay-button-style: black;
box-shadow:
rgb(0 0 0 / 20%) 0px 3px 1px -2px,
rgb(0 0 0 / 14%) 0px 2px 2px 0px,
rgb(0 0 0 / 12%) 0px 1px 5px 0px;
}
.CB-apple-pay-button:hover { cursor: pointer; }
.CB-apple-pay-button:disabled { cursor: not-allowed; }
}
@supports not (-webkit-appearance: -apple-pay-button) {
.CB-apple-pay-button {
display: inline-block;
background-size: 100% 50%;
background-repeat: no-repeat;
background-position: 50% 50%;
border-radius: 5px;
padding: 0px;
box-sizing: border-box;
min-width: 200px;
height: 3.125rem;
background-image: -webkit-named-image(apple-pay-logo-white);
background-color: black;
border: 1px solid black;
box-shadow:
rgb(0 0 0 / 20%) 0px 3px 1px -2px,
rgb(0 0 0 / 14%) 0px 2px 2px 0px,
rgb(0 0 0 / 12%) 0px 1px 5px 0px;
width: 200px;
}
.CB-apple-pay-button:hover { cursor: pointer; }
.CB-apple-pay-button:disabled { cursor: not-allowed; }
}`;
document.head.appendChild(sheet);
const anchorTags = document.querySelectorAll('a[href*="cbur=a"]');
if (anchorTags.length === 0) { return; }
for (let i = 0; i < anchorTags.length; i++) {
const tag = anchorTags[i];
const { href } = tag;
const paylink = new URL(href);
if (paylink.protocol !== 'https:') { continue; }
const [, seller] = /([a-zA-Z\d]{5,10})\.pay\.clickbank(-tst)?\.net/.exec(paylink.hostname) || [];
const tagParams = new URLSearchParams(paylink.search);
const item = tagParams.get('cbitems');
if (!item) { continue; }
itemToHrefMap[item] = href;
if (!seller) { continue; }
if (!fallbackHref) { fallbackHref = href; }
const btn = document.createElement('button');
btn.type = 'button';
btn.classList.add('CB-apple-pay-button');
btn.dataset.item = item;
btn.dataset.seller = seller;
tag.after(btn);
tag.remove();
}
await sdkReady;
window.CBApplePaySdk.init();
})();
</script>

This consolidated script automatically:

  • Detects Apple Pay availability on the customer’s device.

  • Displays and wires up a “Pay with Apple Pay” button in the upsell flow.

  • Handles Apple Pay session creation and token forwarding.

  • Supports one‑click Apple Pay on upsells and order bumps.

  • Manages fallback behavior (returning customers to the order form if Apple Pay fails).

1.4 Testing Apple Pay Using Parameter Mode

To safely test Apple Pay without enabling it on all traffic, switch the Apple Pay mode to Parameter Only in Vendor Settings. Then append &apy to individual pay links.

Example pay link with Apple Pay enabled for testing:

https://pay.clickbank.net/?cbitems=123&cbfid=00000&apy

With this setting, Apple Pay is only offered when the apy parameter is present, which removes the need to manually suppress Apple Pay on every pay link during initial setup.

FAQs

Will upsells also be paid with Apple Pay?

Yes. If a customer chooses “Pay with Apple Pay” on the initial order form:

  • Apple Pay becomes the default payment method during the upsell and order‑bump flow.

  • If Apple Pay fails for any reason, the customer is returned to the original order form to choose another payment method.

How many domains can I register for Apple Pay?

You can register up to three domains per ClickBank nickname in Vendor Settings → Order Form Control.

Do I still need ClickBank support to register my Apple Pay Merchant ID?

No. You now complete Merchant ID domain registration through Vendor Settings. You are responsible for:

  • Hosting the merchant key on your domain.

  • Serving the Apple Developer Merchant Association file in the required path.

Should I use Standard or Advanced Setup?

  • Choose Standard Setup if you want the fastest, easiest path to Apple Pay with minimal or no custom code.

  • Choose Advanced Setup only if you have development resources and specific requirements such as React integration, heavily customized UI, or bespoke error handling.

  • Remember: use only one approach on any given page—do not mix the consolidated Standard script with a custom Advanced implementation.

How do I safely test my integration?

  1. Set the Apple Pay mode to Parameter Only in Vendor Settings.

  2. Add &apy to your test pay links.

  3. Verify behavior across:

    • Supported Apple Pay devices (Safari on macOS / iOS).

    • The full upsell and order‑bump flow.

  4. Once validated, switch the mode to Enabled as desired.

How do I suppress Apple Pay on some payment links?

Add &paymentMethod=NOAPY to any initial order pay link to suppress Apple Pay from being offered.

Did this answer your question?