Apple Pay
Offer Apple Pay on your website with the Kashier SDK
Add an Apple Pay button to your website with the Kashier SDK. Customers on Apple devices pay directly from your checkout page.
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.
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
Provide your website domain to the Kashier support team for certification with Apple.
Step 2: Certificate installation
After receiving the Apple Pay certificate from Kashier:
- Save the certificate file as
apple-developer-merchantid-domain-association.txt - Create a
.well-knowndirectory in your web server's root directory - Upload the certificate file to this directory
- Ensure the file is accessible at:
https://your-domain.com/.well-known/apple-developer-merchantid-domain-association.txt
Implementation
After receiving the Apple Pay certificate from Kashier:
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 |
Support
For technical support, contact Kashier support at:
- Email: [email protected]