Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/components/modal/v2/lib/zoid-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
};
Expand Down
Loading