Add an Apple Pay button to your embedded payment form for one-tap checkout with biometric authentication on supported Apple devices
This guide outlines the steps to enable Apple Pay on your Payment Form, following Apple’s development requirements. Once set up, the payment form features the Apple Pay button, enhancing your payment options.
If you request to create a payment form with Apple Pay without verifying the domain, the button is not displayed, and the appropriate warning is sent.
Once the domain is verified and certificates are configured, configure the paymentIntent object with the fields below to display the Apple Pay button on the Payment Form. You can additionally hide the button if necessary.
paymentIntent object
Expand all
Choose your payment scenario to see the fields it requires.
Description
Order amount in minor units. For example, 1020 means 10 USD and 20 cents. Can be 0 for zero-amount authorization.
Example
1020
Description
Identifier of the predefined product in UUID v4 format.
Example
faf3b86a-1fe6-4ae5-84d4-ab0651d75db2
Description
Customer ID in the merchant’s system.
Example
4dad42f878
Description
Price ID of the predefined product. Use get product prices to obtain it.
Example
faf3b86a-1fe6-4ae5-84d4-ab0651d75db2
Description
Customer ID in the merchant’s system.
Example
4dad42f878
Description
Order ID, which must be unique, is specified in the merchant system.
Example
123456
Description
Currency in three-letter code per the
ISO-4217
Wiki
standard.
Example
USD
Description
Order description in your system and for bank processing.
Highly recommended to keep the description brief to improve the clarity of payment processing, ideally not exceeding 100 characters. It is used in the email receipt sent to the customer.
Example
Premium package
Description
Merchant name, which can be displayed to the customers on the Apple Payment Sheet when paying via Apple Pay.
If not provided, the Apple Payment Sheet falls back to the default merchant name configured for the channel.
Example
Solidgate
Description
Domain where you have uploaded the domain-verification file. Automatically configured from the internal database. Do not pass it in the request.
Example
solidgate.com
Description
Customer email.
If not provided, it is collected on the payment form.
Example
test@solidgate.com
Description
Customer’s first name.
Example
John
Description
Customer’s last name.
Example
Snow
Description
Public IP address of the customer. Both IPv4 and IPv6 are supported.
Private IPs (10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255) result in an ‘Invalid IP’ error.
Metadata is useful for storing additional, structured information about an object, consisting of up to 10 key-value pairs with a validation limit of 380 characters per field.
The callback notification returns an order_metadata from the order in each state.
Example
{"coupon_code": "NY2025", "partner_id": "123989"}
Description
Provide this URL if you want to redirect a customer to your own Success Screen.
If you do not provide the URL, Solidgate directs customers to the Solidgate Success Screen.
Example
https://merchant.example/success
Description
Provide this URL if you want to redirect a customer to your own Fail Screen.
If you do not provide the URL, Solidgate directs customers to the Solidgate Fail Screen.
Subscribe to the mountedevent to check when the Apple Pay button is set up and displayed. When the event is emitted for the applebtn entity, this means the Apple Pay button is fully displayed.
You can test the Apple Pay payments when setting up the integration.
Apple Pay is not supported in
Guide
Collect country-specific customer data like billing address, tax ID, and phone number to meet issuer requirements and improve approvals.
certain
regions, including India.
Non-Safari browsers
Customers can complete purchases with Apple Pay on devices running macOS, Windows, and other operating systems using third-party browsers. During checkout, they can see the Apple Pay option and can finalize the transaction by scanning a QR code.
When Apple’s JavaScript object detects a non-Safari browser, it generates a QR code for transaction processing. The QR code can then be scanned with an iPhone running iOS 18 or later to complete the purchase through the familiar Apple Pay process.
This approach is necessary, as many browsers do not natively support Apple Pay. Merchants must update their integration to enable Apple Pay in browsers other than Safari.
To enable Apple Pay in non-Safari browsers
Add a new integrationType parameter for the applePayButtonParams object. By default, the integrationType is set to
css
, representing the previous, well-tested, and stable integration method.
Update the integrationType by setting it to
js
.
Check your website appearance after the changes. The new integration type uses the WebComponents approach, which could result in visual differences between old and new versions, depending on your website styling.
When using the JavaScript integration type integrationType: ‘js’, update your Content Security Policy (CSP) to allow Apple Pay resources. Add https://applepay.cdn-apple.com/ to your CSP directives:
img-src for Apple Pay button images
script-src for Apple Pay JavaScript SDK
frame-src for Apple Pay payment sheet iframes
For the complete list of required CSP directives and their values, refer to the
Apple Pay JS
SDK
Reference.
Customization
In addition to displaying the button on the payment form, you can also control the button position, color, and type. Use the applePayButtonParams object for changes as you would for all other
Guide
Customize payment form appearance with CSS overrides, theme configuration, font selection, and layout adjustments to match your brand.
customizations
in the Solidgate Payment Form.
To maintain a consistent and recognizable customer experience, Apple Pay supports only the customization of predefined styles. It is required to follow official design guidelines and the use of custom CSS or images is not allowed. For more information, check the Apple Pay button
design guidelines
Reference
.
Button position
To set the Apple Pay button position, create, and specify a div, pass its id attribute value to the containerId parameter in the applePayButtonParams object.
<template><Payment:merchant-data="merchantData":apple-pay-container-ref="appleButton"/><divref="appleButton"/></template><scriptlang="ts"setup>import{defineAsyncComponent,ref}from'vue'import{InitConfig}from'@solidgate/vue-sdk'constPayment=defineAsyncComponent(()=>import('@solidgate/vue-sdk'))constappleButton=ref<HTMLDivElement>()constmerchantData:InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}</script>
import{Component}from'@angular/core';import{FormType,InitConfig}from"@solidgate/angular-sdk";@Component({selector:'app-root',template:`
<ngx-solid-payment
[merchantData]="merchantData"
[applePayContainer]="applePay"
></ngx-solid-payment>
<div class="apple-pay" #applePay></div>
`})exportclassAppComponent{merchantData: InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}}
In this example, the div with the ID yourCustomContainerId is created and the containerId parameter in the applePayButtonParams object is set to the value yourCustomContainerId.
Without a specified containerId, the button appears by default above all fields of the Payment Form. If a non-existing container is specified, an error message appears in the console.
Container with id =‘specified-container’
does not exist.
Button styling
To change the button style, two parameters can be changed in the applePayButtonParams object:
black
- use on white or light-color backgrounds that provide sufficient contrast. Avoid using on black or dark backgrounds.
white-outline
- use on white or light-color backgrounds that do not provide sufficient contrast. Do not place on dark or saturated backgrounds.
white
- use on dark-color backgrounds that provide sufficient contrast.
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. You can find more information in the Apple Pay Guidelines.
The following button types are not supported by Solidgate:
donate
support
rent
contribute
tip
Button hiding
To hide the button from the customer, pass
false
to the enabled parameter. You do not need to specify
true
to display the button on the form as it is the default value. When you pass the
false
value, it means that the form with the passed parameters of containerId, color, and type is collected but not displayed on the Payment Form.
Button hiding properties
Expand all
Description
Displays the Apple Pay button.
Example
false
Default
true
Description
Identifier of container to place the Apple Pay button.
By default, if not set, the button is displayed above the form.