diff --git a/src/components/modal/v2/lib/zoid-polyfill.js b/src/components/modal/v2/lib/zoid-polyfill.js index 5e6f0e69b4..3dd49ba5ea 100644 --- a/src/components/modal/v2/lib/zoid-polyfill.js +++ b/src/components/modal/v2/lib/zoid-polyfill.js @@ -6,6 +6,19 @@ import { isIframe } from './utils'; const IOS_INTERFACE_NAME = 'paypalMessageModalCallbackHandler'; const ANDROID_INTERFACE_NAME = 'paypalMessageModalCallbackHandler'; +const getAccount = (merchantId, clientId, payerId) => { + if (merchantId) { + return merchantId; + } + + // Logger endpoint expects account field to be prefixed if the value is a clientId + if (clientId) { + return `client-id:${clientId}`; + } + + return payerId; +}; + const setupBrowser = props => { window.xprops = { // We will never recieve new props via this integration style @@ -39,7 +52,7 @@ const setupBrowser = props => { // TODO: This should likely be specific to this integration type type: 'modal', // messageRequestId, - account: merchantId || clientId || payerId, + account: getAccount(merchantId, clientId, payerId), trackingDetails } };