New apple pay in PC chrome dosn't work with iOS 18

I've encountered an issue with Apple Pay in PC Chrome with iOS 18. Below is the scenario and code for reference:

Issue Scenario:

  1. A button is clicked to initiate the Apple Pay process.
  2. A QR code window pops up, which I scan with my phone.
  3. As soon as the session is established, the window closes immediately, not allowing the user to select a payment card.
  4. No errors appear in the console.

Here's the code snippet for handling the Apple Pay button click:

const onApplePayButtonClicked = () => {
  if (!window.ApplePaySession) {
    return;
  }

  log('Apple Pay button clicked');

  const request = {
    countryCode: 'UA',
    currencyCode: 'UAH',
    merchantCapabilities: ['supports3DS'],
    supportedNetworks: ['visa', 'masterCard'],
    total: {
      label: 'PoC Merchant Apple Pay',
      type: 'final',
      amount: amount.toString(),
    },
  };

  const session = new window.ApplePaySession(3, request);

  session.onvalidatemerchant = async (event) => {
    try {
      log('Creating ApplePaySession');
      const response = await fetchAppleSessionAPI(event.validationURL, applePayMercantId, { deviceId, refreshToken });
      log('validateMerchantResponse', response);

      session.completeMerchantValidation(response.applePaySessionData);
    } catch (error) {
      log('validateMerchantError', error);
    }
  };

  session.onshippingmethodselected = () => {
    const newTotal = {
      label: 'PoC Merchant Apple Pay',
      type: 'final',
      amount: amount.toString(),
    };
    session.completeShippingMethodSelection(window.ApplePaySession.STATUS_SUCCESS, {}, newTotal);
  };

  session.onpaymentauthorized = async (event) => {
    log('onpaymentauthorized', event);

    const result = {
      status: window.ApplePaySession.STATUS_SUCCESS,
    };
    session.completePayment(result);
    log('TOKEN', event.payment.token);
  };

  session.begin();
};

Troubleshooting Steps Taken:

  • Verified that window.ApplePaySession is available.
  • Checked for any console errors—none found.
  • Confirmed that the QR code scanning and session initiation work as expected.

Expected Behavior:

  • After scanning the QR code and establishing the session, the user should be able to select a payment card and proceed with the payment flow.

Current Behavior:

  • The window closes immediately after the session is established, preventing card selection.

Has anyone else faced this issue or has insights on how to resolve it?

Thanks in advance!

Hey.

Sorry to hear you're having problems getting Apple Pay working in Chrome!

If there's a failure after scanning the code, it will likely be the iPhone side triggering the overall failure.

At such an early stage of the transaction, it could be an issue with either the session data (provided as part of completeMerchantValidation) or the payment request itself. It's hard to say with the information provided.

I would first recommend trying the same page and transaction using Safari on macOS, to see if that also experiences any issues. If there are any issues at that stage, you should be able to see it locally within Safari through logging and Console.

If that works fine, it may be worth checking to see if the iPhone is logging anything that may provide some insight as to why it's failing. You can also do this using Console on macOS with the iPhone connected, and selecting it in the side menu. In particular, filtering on PassbookUIService should reduce most of the unnecessary noise in this situation.

If this doesn't succeed, then it could be a bug, and we would need a sysdiagnose to investigate further. I would recommend the following:

  1. Install the "Apple Pay for iOS/iPadOS" logging profile on the iPhone. This is available from https://developer.apple.com/bug-reporting/profiles-and-logs
  2. Restart the iPhone after installing the profile, and reproduce the issue a few times.
  3. File Feedback through Feedback Assistant on the iPhone, with as much information as possible. This will provide a sysdiagnose that we can look at. Please do not attempt to upload the sysdiagnose to this thread. Information about Feedback Assistant and bug reporting can be found at https://developer.apple.com/bug-reporting.
New apple pay in PC chrome dosn't work with iOS 18
 
 
Q