@paypal/checkout-components 5.0.322 → 5.0.323

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.322",
3
+ "version": "5.0.323",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -716,7 +716,7 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
716
716
  offerCountryCode,
717
717
  creditProductIdentifier,
718
718
  }) => {
719
- const { message, clientID, merchantID, currency, buttonSessionID } =
719
+ const { message, clientID, currency, buttonSessionID, merchantID } =
720
720
  props;
721
721
  const amount = message?.amount;
722
722
 
@@ -729,7 +729,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
729
729
  [FPTI_KEY.CONTEXT_ID]: buttonSessionID,
730
730
  [FPTI_KEY.CONTEXT_TYPE]: "button_session_id",
731
731
  [FPTI_KEY.EVENT_NAME]: "message_click",
732
- [FPTI_KEY.SELLER_ID]: merchantID?.join(","),
733
732
  [FPTI_KEY.BUTTON_MESSAGE_OFFER_TYPE]: offerType,
734
733
  [FPTI_KEY.BUTTON_MESSAGE_CREDIT_PRODUCT_IDENTIFIER]:
735
734
  creditProductIdentifier,
@@ -740,7 +739,8 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
740
739
  [FPTI_KEY.BUTTON_MESSAGE_OFFER_COUNTRY]: offerCountryCode,
741
740
  [FPTI_KEY.BUTTON_MESSAGE_CURRENCY]: currency,
742
741
  [FPTI_KEY.BUTTON_MESSAGE_AMOUNT]: amount,
743
- });
742
+ })
743
+ .flush();
744
744
 
745
745
  const modalInstance = await getModal(clientID, merchantID);
746
746
  return modalInstance?.show({
@@ -757,10 +757,10 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
757
757
  required: false,
758
758
  value: ({ props }) => {
759
759
  return () => {
760
+ const { clientID, merchantID } = props;
760
761
  // offerType, messageType, offerCountryCode, and creditProductIdentifier are passed in and may be used in an upcoming message hover logging feature
761
762
 
762
763
  // lazy loads the modal, to be memoized and executed onMessageClick
763
- const { clientID, merchantID } = props;
764
764
  return getModal(clientID, merchantID);
765
765
  };
766
766
  },
@@ -775,8 +775,17 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
775
775
  messageType,
776
776
  offerCountryCode,
777
777
  creditProductIdentifier,
778
+ merchantID: serverMerchantId,
778
779
  }) => {
779
- const { message, buttonSessionID, currency, merchantID } = props;
780
+ // merchantID that comes from props is an array
781
+ const { message, buttonSessionID, currency } = props;
782
+
783
+ // override with server id if partner does not exist
784
+ if (serverMerchantId) {
785
+ getLogger().addTrackingBuilder(() => ({
786
+ [FPTI_KEY.SELLER_ID]: serverMerchantId,
787
+ }));
788
+ }
780
789
 
781
790
  getLogger()
782
791
  .info("button_message_render")
@@ -787,7 +796,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
787
796
  [FPTI_KEY.CONTEXT_ID]: buttonSessionID,
788
797
  [FPTI_KEY.CONTEXT_TYPE]: "button_session_id",
789
798
  [FPTI_KEY.EVENT_NAME]: "message_render",
790
- [FPTI_KEY.SELLER_ID]: merchantID?.join(","),
791
799
  [FPTI_KEY.BUTTON_MESSAGE_OFFER_TYPE]: offerType,
792
800
  [FPTI_KEY.BUTTON_MESSAGE_CREDIT_PRODUCT_IDENTIFIER]:
793
801
  creditProductIdentifier,
@@ -798,7 +806,8 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
798
806
  [FPTI_KEY.BUTTON_MESSAGE_CURRENCY]: currency,
799
807
  [FPTI_KEY.BUTTON_MESSAGE_OFFER_COUNTRY]: offerCountryCode,
800
808
  [FPTI_KEY.BUTTON_MESSAGE_AMOUNT]: message?.amount,
801
- });
809
+ })
810
+ .flush();
802
811
  };
803
812
  },
804
813
  },
@@ -371,7 +371,7 @@ function buildModalBundleUrl(): string {
371
371
 
372
372
  export const getModal: (
373
373
  clientID: string,
374
- merchantID: $ReadOnlyArray<string> | void
374
+ merchantID?: $ReadOnlyArray<string> | void
375
375
  ) => Object = memoize(async (clientID, merchantID) => {
376
376
  try {
377
377
  const namespace = getNamespace();