KashierDevelopersKashier Developers
Accept payments

Apple Pay

Accept Apple Pay on Kashier's checkout page, on your website, or in your iOS app, using Kashier's Apple Pay certificates or your own

Accept Apple Pay on Kashier's hosted checkout page, on your own website with the Kashier SDK, or inside your own iOS app. Customers on Apple devices pay with the card saved in their Apple Wallet.

Note

An Apple Pay payment settles over the card rail (MPGS), so refunds, void and authorize/capture behave the same as a card payment. enable3DS is forced to false - the device cryptogram already carries the authentication, so no separate 3D Secure step runs. Google Pay is not supported.

Choose your setup

Pick the row that matches where your customers pay.

Where customers payApple Developer accountWhat you set upGuide
Kashier's hosted checkout pageNot neededNothingKashier hosted checkout page
Your website, with Kashier's certificatesNot neededShare your website domain with Kashier and host the file Kashier sends youUse Kashier's Apple Pay certificates
Your iOS appRequiredYour Merchant ID and Payment Processing Certificate, uploaded in the Kashier dashboardAccept Apple Pay in your iOS app
Your website, with your own certificatesRequiredYour Merchant ID, Payment Processing Certificate and Merchant Identity Certificate, uploaded in the Kashier dashboard, and your domain verified in your Apple Developer accountAccept Apple Pay on your website with your own certificates

What each setup needs:

Hosted checkout pageWebsite, Kashier's certificatesiOS appWebsite, your own certificates
Merchant IDKashier'sKashier'sYoursYours
Payment Processing CertificateKashier'sKashier'sYoursYours
Merchant Identity CertificateKashier'sKashier'sNot neededYours
Domain verificationNot neededDone by KashierNot neededDone by you, in your Apple Developer account
Action needed from KashierNoneRegister your domainNoneNone

iOS apps always use your own Apple Pay account

Apple only lets an app offer Apple Pay with a Merchant ID that belongs to the same Apple Developer account as the app. To accept Apple Pay in your iOS app, register your own Merchant ID and upload your own Payment Processing Certificate to Kashier. Kashier's certificates cannot be used inside your app.

You can combine setups. For example, your iOS app can use your own certificates while your website keeps using Kashier's certificates. Kashier reads which certificate each Apple Pay payment was encrypted for and decrypts it with the matching key. If you never turn on your own certificates, nothing changes for you.

Kashier hosted checkout page

If you send customers to Kashier's hosted checkout page (the sessionUrl of a payment session), Apple Pay is offered on that page with no setup on your side.

Use Kashier's Apple Pay certificates

Use this setup to show the Apple Pay button on your own website without an Apple Developer account. Kashier registers your domain with Apple under Kashier's Apple Pay account.

Prerequisites

Before implementing the Kashier Apple Pay integration, ensure you have:

  1. A website with HTTPS enabled
  2. Provided your website domain to Kashier's team so it can be verified with Apple
  3. The Kashier SDK script

Step 1: Domain registration

Share your website URL with the Kashier support team so Kashier can register your domain with Apple.

Step 2: Certificate installation

After receiving the Apple Pay domain-association file from Kashier:

  1. Access your website's root directory
  2. Create a .well-known directory if it does not exist
  3. Upload the file to this directory
  4. Ensure the file is accessible at: https://your-domain.com/.well-known/apple-developer-merchantid-domain-association.txt

Tip

Apple requests the file at /.well-known/apple-developer-merchantid-domain-association (without .txt). Serving the same file at both paths avoids verification failures.

Then add the SDK to your checkout page as described in Website implementation.

Use your own Apple Pay certificates

If you have an Apple Developer account, you can run Apple Pay under your own Merchant ID and certificates. Apple then encrypts payments for your own Payment Processing Certificate, and Kashier decrypts them with the private key you upload. You need this setup to accept Apple Pay in your iOS app, and you can also use it on your website.

What you need

ItemiOS appWebsiteWhat it is for
Merchant IDRequiredRequiredYour Apple Pay merchant identifier, for example merchant.com.yourcompany
Payment Processing Certificate and its private keyRequiredRequiredKashier uses them to decrypt your Apple Pay payments
Merchant Identity Certificate and its private keyNot neededRequiredProves to Apple that your website may start an Apple Pay session
Domain verified with AppleNot neededRequiredApple only shows Apple Pay on domains verified under your Merchant ID

You create all of these in your Apple Developer account (Certificates, Identifiers & Profiles). You also need a computer with OpenSSL (macOS includes it) to create the private keys.

Create your Merchant ID and certificates

  1. Merchant ID. In Certificates, Identifiers & Profiles > Identifiers > Merchant IDs, find or create your Merchant ID, for example merchant.com.yourcompany.
  2. Payment Processing Certificate (required). Create it for that Merchant ID from a certificate signing request (CSR) whose private key is an EC P-256 (prime256v1) key.
  3. Merchant Identity Certificate (website only). Create it for the same Merchant ID. Skip it if you accept Apple Pay only in your iOS app.

Upload your certificates to Kashier

In the Kashier dashboard, open Settings > Device Payment Configuration > Apple Pay:

  1. Turn on Use my own certificates.
  2. Enter your Merchant ID exactly as it appears in your Apple Developer account, including merchant..
  3. Under Payment Processing Certificate, upload the certificate and its private key. This pair is required.
  4. For your website only: under Merchant Identity Certificate, upload the certificate and its private key. Skip this for an iOS app.
  5. Select Save changes.

When the setup is complete, the Apple Pay status shows Using your certificates and your Merchant ID. Until the Merchant ID and the Payment Processing pair are saved, Kashier's setup stays in use.

FileAccepted formats
Payment Processing Certificate.cer or .pem
Payment Processing Private Key.key or .pem, unencrypted, EC P-256
Merchant Identity Certificate.cer or .pem
Merchant Identity Private Key.key or .pem, unencrypted
  • Each file can be at most 64 KB.
  • Private keys must not be password-protected.
  • Each certificate is uploaded together with its own private key, and the key must match the certificate.
  • Certificates must not be expired and must belong to the Merchant ID you entered.
  • To change the Merchant ID, upload a new Payment Processing pair created for the new Merchant ID at the same time.

Your private keys

Kashier stores your private keys encrypted and never shows them again, in the dashboard or in the API. Keep your own copy somewhere safe.

Accept Apple Pay in your iOS app

To accept Apple Pay inside your own iOS app, you need your Merchant ID and your Payment Processing Certificate and private key. The Merchant Identity Certificate and domain verification are for websites only, so skip them.

  1. Create your Merchant ID and Payment Processing Certificate in your Apple Developer account.
  2. Upload them to Kashier and check that the status shows Using your certificates.
  3. In Xcode, add the Apple Pay capability to your app target and select the same Merchant ID.
  4. Pass the same Merchant ID to the Kashier SDK you use:
    • iOS SDK: KashierConfig(appleMerchantID:). See iOS SDK > Apple Pay.
    • Flutter SDK: KashierSDK.initialize(appleMerchantId:). See the Flutter SDK Apple Pay integration guide.
    • Your own PassKit integration: send the Apple Pay token unmodified as paymentMethod.card.applePay = { token } in the checkout pay request.

The Merchant ID in your app, in the SDK and in the Kashier dashboard must be the same. Kashier then decrypts the payments from your app with your Payment Processing private key.

Accept Apple Pay on your website with your own certificates

  1. Create your Merchant ID, Payment Processing Certificate and Merchant Identity Certificate in your Apple Developer account.
  2. Verify your website domain in your Apple Developer account, under the same Merchant ID (Merchant Domains > Add Domain). Use the domain-association file Apple gives you in your own account, not the file Kashier sends for the standard setup, and host it at https://your-domain.com/.well-known/apple-developer-merchantid-domain-association. No action is needed from Kashier.
  3. Upload both certificate pairs to Kashier.
  4. Add the SDK to your checkout page as described in Website implementation.

A domain can belong to only one Apple developer account

Apple lets a domain be registered under one Apple developer team only. If your domain is already registered with Kashier for the standard setup, ask Kashier support to remove it first, or use a different subdomain for your checkout page.

Website implementation

The code below is the same whether your website uses Kashier's certificates or your own.

Basic integration

Add the following code to your checkout page:

<!-- Apple Pay Button Container -->
<div id="kashier-sdk-id"></div>

<!-- Optional Success Response Container -->
<div id="kashier-success-id"></div>

<!-- Optional Failure Response Container -->
<div id="kashier-failure-id"></div>

<!-- Kashier SDK Script -->
<script src="https://payments.kashier.io/kashier-sdk.js"></script>

<!-- Initialization Script -->
<script>
  kashierSDK.load({
      data: {
          mode: 'test', // Use 'live' for production
          sessionId: "YOUR_SESSION_ID"
      },
      onSuccess: (response) => console.log(response),
      onFailure: (error) => console.log(error),
      locale: 'en',
  });
</script>

HTML elements

Element IDRequiredDescription
kashier-sdk-idYesContainer where the Apple Pay button will be rendered
kashier-success-idNoOptional container for displaying successful payment information
kashier-failure-idNoOptional container for displaying payment failure information

Configuration options

The kashierSDK.load() method accepts a configuration object with the following properties:

Required parameters

ParameterTypeDescription
data.modeStringEnvironment mode: 'test' or 'live'
data.sessionIdStringUnique payment session identifier provided by Kashier's payment session creation API. See payment sessions.

Optional parameters

ParameterTypeDescription
localeStringLanguage for the Apple Pay button: 'en' (English) or 'ar' (Arabic)
onSuccessFunctionCallback function that executes after successful payment completion
onFailureFunctionCallback function that executes after payment failure

Managing your certificates

In Settings > Device Payment Configuration > Apple Pay you can:

  • View your saved Merchant ID and the date your certificates became active.
  • Replace a certificate or private key: select Replace on the file, upload the new one, and save.
  • Remove the Merchant Identity Certificate: Apple Pay on your website stops using your own identity. Payments in your iOS app are not affected.
  • Switch back to Kashier's setup: turn off Use my own certificates and save. Your uploaded files are kept, so you can turn it on again later.

When you switch back to Kashier's setup:

  • Apple Pay in your iOS app stops working until you turn your own certificates on again.
  • If your website used your own certificates, it needs the standard setup again: your domain registered with Kashier, and the domain-association file Kashier sends you. Because a domain can belong to only one Apple developer account, remove the domain from your own Apple account first.

Renewing your certificates

Apple certificates expire, so renew them before the expiry date. Kashier holds one active Payment Processing pair at a time:

  1. Create the new certificate in your Apple Developer account, but do not activate it yet.
  2. Upload the new certificate and private key to Kashier in Settings > Device Payment Configuration > Apple Pay.
  3. Activate the new certificate in your Apple Developer account.

Do steps 2 and 3 back to back. Between them, payments encrypted for the certificate Kashier no longer holds fail. For the Merchant Identity Certificate, upload the new pair to Kashier before the old certificate expires.

Troubleshooting

ProblemLikely causeWhat to do
Apple Pay is not offered in your iOS appThe Merchant ID in Xcode, in the SDK and in the Kashier dashboard are not the sameUse the same Merchant ID in all three places
appleMerchantID / appleMerchantId is not passed to the SDKPass your Merchant ID when you initialize the SDK
The Apple Pay sheet does not open on your websiteYour domain is not verified under the same Apple developer account as your Merchant IDVerify the domain under that Merchant ID with Apple's domain-association file from your account
Your Merchant Identity Certificate has expired or was removedCreate a new identity certificate and upload it with its key
The payment fails with "Apple Pay token is invalid"The Payment Processing Certificate active at Apple is not the one uploaded to KashierUpload the pair that is active at Apple
The certificate was renewed or rotated at Apple without uploading it to Kashier firstUpload the new pair to Kashier, as in Renewing your certificates
Use my own certificates is turned offTurn it on and save

Support

For technical support, contact Kashier support at:

On this page