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 pay | Apple Developer account | What you set up | Guide |
|---|---|---|---|
| Kashier's hosted checkout page | Not needed | Nothing | Kashier hosted checkout page |
| Your website, with Kashier's certificates | Not needed | Share your website domain with Kashier and host the file Kashier sends you | Use Kashier's Apple Pay certificates |
| Your iOS app | Required | Your Merchant ID and Payment Processing Certificate, uploaded in the Kashier dashboard | Accept Apple Pay in your iOS app |
| Your website, with your own certificates | Required | Your Merchant ID, Payment Processing Certificate and Merchant Identity Certificate, uploaded in the Kashier dashboard, and your domain verified in your Apple Developer account | Accept Apple Pay on your website with your own certificates |
What each setup needs:
| Hosted checkout page | Website, Kashier's certificates | iOS app | Website, your own certificates | |
|---|---|---|---|---|
| Merchant ID | Kashier's | Kashier's | Yours | Yours |
| Payment Processing Certificate | Kashier's | Kashier's | Yours | Yours |
| Merchant Identity Certificate | Kashier's | Kashier's | Not needed | Yours |
| Domain verification | Not needed | Done by Kashier | Not needed | Done by you, in your Apple Developer account |
| Action needed from Kashier | None | Register your domain | None | None |
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:
- A website with HTTPS enabled
- Provided your website domain to Kashier's team so it can be verified with Apple
- 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:
- Access your website's root directory
- Create a
.well-knowndirectory if it does not exist - Upload the file to this directory
- 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
| Item | iOS app | Website | What it is for |
|---|---|---|---|
| Merchant ID | Required | Required | Your Apple Pay merchant identifier, for example merchant.com.yourcompany |
| Payment Processing Certificate and its private key | Required | Required | Kashier uses them to decrypt your Apple Pay payments |
| Merchant Identity Certificate and its private key | Not needed | Required | Proves to Apple that your website may start an Apple Pay session |
| Domain verified with Apple | Not needed | Required | Apple 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
- Merchant ID. In Certificates, Identifiers & Profiles > Identifiers > Merchant IDs, find or create your Merchant ID, for example
merchant.com.yourcompany. - 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. - Merchant Identity Certificate (website only). Create it for the same Merchant ID. Skip it if you accept Apple Pay only in your iOS app.
Keep every .key file private. You upload it to Kashier only.
Payment Processing Certificate (required)
# 1. EC P-256 private key
openssl ecparam -genkey -name prime256v1 -noout -out payment_processing.key
# 2. Certificate signing request (enter a 2-letter Country Name, for example EG)
openssl req -new -key payment_processing.key -out payment_processing.csr
# 3. Upload the CSR in Apple Developer: Merchant IDs > your Merchant ID >
# Apple Pay Payment Processing Certificate > Create Certificate, then download apple_pay.cer
# 4. Optional: convert the certificate to PEM
openssl x509 -inform DER -in apple_pay.cer -out payment_certificate.pemMerchant Identity Certificate (website only)
# 1. RSA 2048 private key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out merchant_identity.key
# 2. Certificate signing request
openssl req -new -key merchant_identity.key -out merchant_identity.csr
# 3. Upload the CSR in Apple Developer: Merchant IDs > your Merchant ID >
# Apple Pay Merchant Identity Certificate > Create Certificate, then download merchant_id.cer
# 4. Optional: convert the certificate to PEM
openssl x509 -inform DER -in merchant_id.cer -out merchant_certificate.pemYou can upload the downloaded .cer files as they are, or the converted .pem files.
Upload your certificates to Kashier
In the Kashier dashboard, open Settings > Device Payment Configuration > Apple Pay:
- Turn on Use my own certificates.
- Enter your Merchant ID exactly as it appears in your Apple Developer account, including
merchant.. - Under Payment Processing Certificate, upload the certificate and its private key. This pair is required.
- For your website only: under Merchant Identity Certificate, upload the certificate and its private key. Skip this for an iOS app.
- 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.
| File | Accepted 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.
- Create your Merchant ID and Payment Processing Certificate in your Apple Developer account.
- Upload them to Kashier and check that the status shows Using your certificates.
- In Xcode, add the Apple Pay capability to your app target and select the same Merchant ID.
- 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.
- iOS SDK:
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
- Create your Merchant ID, Payment Processing Certificate and Merchant Identity Certificate in your Apple Developer account.
- 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. - Upload both certificate pairs to Kashier.
- 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 ID | Required | Description |
|---|---|---|
| kashier-sdk-id | Yes | Container where the Apple Pay button will be rendered |
| kashier-success-id | No | Optional container for displaying successful payment information |
| kashier-failure-id | No | Optional container for displaying payment failure information |
Configuration options
The kashierSDK.load() method accepts a configuration object with the following properties:
Required parameters
| Parameter | Type | Description |
|---|---|---|
| data.mode | String | Environment mode: 'test' or 'live' |
| data.sessionId | String | Unique payment session identifier provided by Kashier's payment session creation API. See payment sessions. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
| locale | String | Language for the Apple Pay button: 'en' (English) or 'ar' (Arabic) |
| onSuccess | Function | Callback function that executes after successful payment completion |
| onFailure | Function | Callback 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:
- Create the new certificate in your Apple Developer account, but do not activate it yet.
- Upload the new certificate and private key to Kashier in Settings > Device Payment Configuration > Apple Pay.
- 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
| Problem | Likely cause | What to do |
|---|---|---|
| Apple Pay is not offered in your iOS app | The Merchant ID in Xcode, in the SDK and in the Kashier dashboard are not the same | Use the same Merchant ID in all three places |
appleMerchantID / appleMerchantId is not passed to the SDK | Pass your Merchant ID when you initialize the SDK | |
| The Apple Pay sheet does not open on your website | Your domain is not verified under the same Apple developer account as your Merchant ID | Verify the domain under that Merchant ID with Apple's domain-association file from your account |
| Your Merchant Identity Certificate has expired or was removed | Create 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 Kashier | Upload the pair that is active at Apple |
| The certificate was renewed or rotated at Apple without uploading it to Kashier first | Upload the new pair to Kashier, as in Renewing your certificates | |
| Use my own certificates is turned off | Turn it on and save |
Support
For technical support, contact Kashier support at:
- Email: [email protected]