Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dynamic messages - pass merchant id from cpnw callback, flush logger #2381

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

paypal-rosman
Copy link
Contributor

@paypal-rosman paypal-rosman commented May 1, 2024

Description

we are passing merchantID from a callback handled in an internal service. We are also flushing the logger that way on page navigation we can send up logger events

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

Reproduction Steps (if applicable)

Screenshots (if applicable)

Dependent Changes (if applicable)

Groups who should review (if applicable)

❤️ Thank you!

src/zoid/buttons/component.jsx Outdated Show resolved Hide resolved
src/zoid/buttons/util.js Outdated Show resolved Hide resolved
src/zoid/buttons/component.jsx Outdated Show resolved Hide resolved
src/zoid/buttons/component.jsx Outdated Show resolved Hide resolved
src/zoid/buttons/util.js Outdated Show resolved Hide resolved
src/zoid/buttons/component.jsx Outdated Show resolved Hide resolved
src/zoid/buttons/component.jsx Outdated Show resolved Hide resolved
const { message, buttonSessionID, currency, merchantID } = props;

// override with server id if partner does not exist
getLogger().addTrackingBuilder(() => ({
[FPTI_KEY.SELLER_ID]: merchantID?.toString() || serverMerchantId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this already exists in sdk-client: https://github.com/paypal/paypal-sdk-client/blob/main/src/tracking.js#L138

I would consider changing this to

if (serverMerchantId) {
  getLogger().addTrackingBuilder(() => ({
    [FPTI_KEY.SELLER_ID]: serverMerchantId,
  }))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me get this added

@@ -396,7 +396,7 @@ export const getModal: (

return window[namespace].MessagesModal({
account: `client-id:${clientID}`,
merchantId: merchantID?.join(",") || undefined,
merchantId: merchantID?.join() || undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to drop the "," in the join?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think by default it makes it comma delimited but i can add it back in for clarity

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i went ahead and added it back in just in case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i addressed the comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants