Skip to content

Commit 092d71e

Browse files
fix: prefix client-id for lander modal events (#1177)
* add prefix to client-id
1 parent f61c4f2 commit 092d71e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/components/modal/v2/lib/zoid-polyfill.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ import { isIframe } from './utils';
66
const IOS_INTERFACE_NAME = 'paypalMessageModalCallbackHandler';
77
const ANDROID_INTERFACE_NAME = 'paypalMessageModalCallbackHandler';
88

9+
const getAccount = (merchantId, clientId, payerId) => {
10+
if (merchantId) {
11+
return merchantId;
12+
}
13+
14+
// Logger endpoint expects account field to be prefixed if the value is a clientId
15+
if (clientId) {
16+
return `client-id:${clientId}`;
17+
}
18+
19+
return payerId;
20+
};
21+
922
const setupBrowser = props => {
1023
window.xprops = {
1124
// We will never recieve new props via this integration style
@@ -39,7 +52,7 @@ const setupBrowser = props => {
3952
// TODO: This should likely be specific to this integration type
4053
type: 'modal',
4154
// messageRequestId,
42-
account: merchantId || clientId || payerId,
55+
account: getAccount(merchantId, clientId, payerId),
4356
trackingDetails
4457
}
4558
};

0 commit comments

Comments
 (0)