SFCC Integration: onpaymentauthorized Not Firing After Touch ID Authentication (Apple Pay on the Web)

Hello everyone,

We've encountered a blocking issue while integrating Apple Pay on the Web within a Salesforce Commerce Cloud (SFCC) environment. The session fails immediately after a successful user authentication.

Problem Summary: After a user authenticates a payment with Touch ID or Face ID, the Apple Pay sheet showing error "Payment not completed" message. The core of the issue is that the onpaymentauthorized event handler is never invoked in our client-side JavaScript. As a result, the corresponding server-side SFCC paymentAuthorized hooks are never triggered, and we cannot obtain a payment token to complete the transaction. Also, No console logs are observed.

Observed Flow of Events: The ApplePaySession proceeds correctly through the initial callbacks. We have verified through server-side logs that the corresponding SFCC platform hooks (getRequest, prepareBasket, shippingContactSelected, shippingMethodSelected) fire and complete successfully. The payment sheet correctly updates with shipping costs and the final transaction amount.

Failure Point & Steps to Reproduce: A user initiates an Apple Pay transaction within our SFCC site. They select their shipping contact and method. The payment sheet updates the total amount. The user taps the "Pay" button and authenticates successfully via Touch ID / Face ID.

Failure: The sheet immediately displays "Payment not completed" error. The onpaymentauthorized event is never fired on the client, and no paymentAuthorized calls reach our SFCC backend.

We have confirmed this behavior is reproducible even when using the standard plugin_applepay provided by SFCC. There are no associated errors in the browser's JavaScript console or any server-side logs, as the process appears to fail within the native Apple Pay session before control is returned to our client-side code.

Our Questions:

  1. Given this is occurring within an SFCC integration, we are trying to understand what could cause the session to terminate at this specific point.

  2. Are there internal validation checks that occur after successful user authentication but before the onpaymentauthorized event is dispatched?

What configuration issues (e.g., in the ApplePayPaymentRequest, merchant identity certificate, etc.) are known to cause a failure at this exact step, especially within a platform integration like SFCC?

Is there any additional client-side logging or debugging we can enable to get more insight into the internal state of the ApplePaySession?

Any guidance from Apple engineers or other developers who have integrated Apple Pay with SFCC would be greatly appreciated.

Thank you

To add further details, we created sandbox test accounts with the help of the below documentation and using test cards provided. https://developer.apple.com/apple-pay/sandbox-testing/

Hi @siddakumar,

More information is needed to investigate this issue. Please carefully review the resources in the post below:

Gathering Required Information for Troubleshooting Apple Pay on the Web Merchant Issues

https://developer.apple.com/forums/thread/762994

If, after reviewing the TNs, you are unable to resolve your payment failures, please follow the steps in the post above to create a report via Feedback Assistant.

Once submitted, please reply here with your Feedback ID so I may investigate your device logs, and escalate to the Apple Pay Server engineers directly, if needed.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Thank you for the thread attached in your response. The issue faced above internal to the Salesforce B2C Commerce Business manager configuration.

We are working for a US based site where 3DS is optional for merchants. Hence we did not enable it in our Business Manager portal.

Later, we found that 3DS is mandatory for Apple Pay to work. Below is the documentation shared by Salesforce with us. https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/merchantcapabilities

This information is neither logged in the browser console nor in the server side logs as there was no authorization event being triggered from applepay.js file hosted on Salesforce B2C Commerce instance. This has become a grey area for us to reach out both Apple and Salesforce.

After enabling 3DS, we are seeing the authorization event triggered.

Hope this answer helps for others who face similar issue on Apple Pay on Salesforce B2C Commerce aka Salesforce Commerce Cloud (SFCC) formerly known as Demandware.

SFCC Integration: onpaymentauthorized Not Firing After Touch ID Authentication (Apple Pay on the Web)
 
 
Q