If the merchant enables Apple Pay through a LINK cartridge, the merchant must meet
minimum requirements.
The merchant must:
Note: B2C Commerce currently supports only version 1 of the Apple Pay JS API that is provided
by Apple in Safari.
Salesforce B2C Commerce
Extensions
B2C Commerce provides the constant METHOD_DW_APPLE_PAY to
the new Apple Pay system Payment Method.
B2C Commerce provides hooks for
payment authorization:
- dw.extensions.applepay.getRequest
- dw.extensions.applepay.prepareBasket
- dw.extensions.applepay.shippingContactSelected
- dw.extensions.applepay.shippingMethodSelected
- dw.extensions.applepay.paymentAuthorized.createOrder
- dw.extensions.applepay.paymentAuthorized.authorizeOrderPayment
- dw.extensions.applepay.paymentAuthorized.placeOrder
- dw.extensions.applepay.paymentAuthorized.failOrder
- dw.extensions.applepay.cancel
- dw.extensions.paymentapi.beforeAuthorization (If not implemented,
custom data will neither be included in the request nor handled in the
response as before.)
- dw.extensions.paymentapi.afterAuthorization (If not implemented,
custom data will neither be included in the request nor handled in the
response as before.)
Note: Several Apple Pay hooks can optionally trigger a client-side
DOM event after executing. Supported hooks are:
- applepay.prepareBasket
- applepay.shippingContactSelected
- applepay.shippingMethodSelected
- applepay.paymentMethodSelected
- applepay.cancel
Note: The dw.extensions.applepay.shippingMethodSelected can
return a status of INVALID_SHIPPING_ADDRESS. The
dw.extension.applepay.paymentAuthorized hook can also return a status of
INVALID_SHIPPING_ADDRESS if the street address field is invalid; however,
if the name, email, or phone number is invalid,
dw.extension.applepay.paymentAuthorized returns
INVALID_SHIPPING_CONTACT.
Note: The cartridge that contains the hook
must be in the site cartridge path (not the Business Manager cartridge
path).
The API class dw.extensions.applepay.ApplePayHookResult
indicates error reasons.
The <isapplepay> ISML tag injects a
default black Apple Pay button into the HTML page.
You can use the
following CSS class names on pages where Apple Pay for the Web is
enabled:
- dw-apple-pay-button
- dw-apple-pay-mini-cart
- dw-apple-pay-cart
- dw-apple-pay-logo-white
- dw-apple-pay-border
Testing Your Apple Pay on the Web
Implementation
You use the Apple Pay Sandbox to
test integration and payment sheet configuration. For more details, see
Apple Pay Sandbox Testing (at
https://developer.apple.com/support/apple-pay-sandbox/).