Skip to content

Commit

Permalink
chore: cut release (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
gillycheesesteak authored Jun 17, 2024
2 parents b5f6161 + d15bf57 commit fd26374
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/components/modal/v2/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const getContent = memoize(
contextualComponents,
devTouchpoint,
disableSetCookie,
features
features,
buttonSessionId
}) => {
const query = objectEntries({
currency,
Expand All @@ -44,7 +45,8 @@ export const getContent = memoize(
contextual_components: contextualComponents,
devTouchpoint,
disableSetCookie,
features
features,
buttonSessionId
})
.filter(([, val]) => Boolean(val))
.reduce(
Expand Down
6 changes: 4 additions & 2 deletions src/library/controllers/modal/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const memoizedModal = memoizeOnProps(
contextualComponents,
cspNonce,
integrationIdentifier,
features
features,
buttonSessionId
}) => {
addPerformanceMeasure(PERFORMANCE_MEASURE_KEYS.FIRST_MODAL_RENDER_DELAY);

Expand All @@ -68,7 +69,8 @@ const memoizedModal = memoizeOnProps(
contextualComponents,
cspNonce,
integrationIdentifier,
features
features,
buttonSessionId
});
// Fired from inside the default onReady callback
let renderProm;
Expand Down
11 changes: 11 additions & 0 deletions src/library/zoid/message/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ export default {

return undefined;
},
buttonSessionId: ({ props: { buttonSessionId } }) => {
if (typeof buttonSessionId !== 'undefined') {
if (!validateType(Types.STRING, buttonSessionId)) {
logInvalidType('buttonSessionId', Types.STRING, buttonSessionId);
} else {
return buttonSessionId;
}
}

return undefined;
},
contextualComponents: ({ props: { contextualComponents } }) => {
// Return early if contextualComponents is undefined
if (typeof contextualComponents === 'undefined') {
Expand Down
10 changes: 8 additions & 2 deletions src/library/zoid/modal/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () =>
required: false,
value: validate.ecToken
},
buttonSessionId: {
type: 'string',
queryParam: 'button_session_id',
required: false,
value: validate.buttonSessionId
},
pageType: {
type: 'string',
queryParam: 'page_type',
Expand All @@ -159,7 +165,6 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () =>

return ({ linkName, src }) => {
const { index, refIndex } = props;

logger.track({
index,
refIndex,
Expand Down Expand Up @@ -284,7 +289,7 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () =>
type: 'function',
queryParam: false,
value: ({ props, state, event }) => {
const { onReady } = props;
const { onReady, buttonSessionId } = props;
// Fired anytime we fetch new content (e.g. amount change)
return ({ products, meta, ts }) => {
const { index, offer, merchantId, account, refIndex, messageRequestId } = props;
Expand Down Expand Up @@ -318,6 +323,7 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () =>
[index]: {
type: 'modal',
messageRequestId,
buttonSessionId,
account: merchantId || account,
partnerClientId,
trackingDetails
Expand Down
5 changes: 3 additions & 2 deletions src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function generateLogPayload(account, { meta, events: bizEvents, tracking }) {
const components = Object.entries(meta)
.filter(([, component]) => component.account === account)
.map(([index, component]) => {
const { type, messageRequestId, stats = {}, trackingDetails } = component;

// buttonSessionId could be undefined here
const { type, buttonSessionId, messageRequestId, stats = {}, trackingDetails } = component;
const { clickUrl } = trackingDetails;
delete trackingDetails.clickUrl;

Expand Down Expand Up @@ -58,6 +58,7 @@ function generateLogPayload(account, { meta, events: bizEvents, tracking }) {
return {
component_type: type,
instance_id: messageRequestId,
button_session_id: buttonSessionId,
fdata,
merchant_events: bizEvents.filter(event => event.payload?.index === index),
...trackingDetails,
Expand Down

0 comments on commit fd26374

Please sign in to comment.