@paypal/merchant-onboarding-sdk 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -185,12 +185,30 @@ import { servicing } from "@paypal/merchant-onboarding-sdk/servicing";
185
185
 
186
186
  ### Initialize And Render Servicing SDK
187
187
 
188
+ `PayPal.servicing.<MODULE_NAME>.initialize(props)`
189
+
188
190
  ```aiexclude
189
- PayPal.servicing.<MODULE>.initialize(props)
191
+ servicing.ACTION_WIDGETS.initialize({
192
+ targetElementId: 'container',
193
+ getAccessToken: async () => { // implementation here to get spoke access token} ,
194
+ style: {
195
+ color: {
196
+ primary: {
197
+ main: 'red',
198
+ },
199
+ secondary: {
200
+ main: 'green',
201
+ },
202
+ },
203
+ },
204
+ partnerName: 'partner',
205
+ partnerHostedModuleUrls: {
206
+ MONEY: 'www.partner.com/balance', // Partner web url where money SDK is used
207
+ ACTION_WIDGETS: 'www.partner.com/notification' // Partner web url where action widget SDK is used
208
+ }
209
+ });
190
210
  ```
191
211
 
192
- example: `PayPal.servicing.ACTION_WIDGETS.initialize(props)`
193
-
194
212
  #### Supported modules
195
213
 
196
214
  | Supported Module Names |
package/dist/servicing.js CHANGED
@@ -54776,7 +54776,7 @@ var env_config_ENV_CONFIG = {
54776
54776
  /* harmony default export */ const env_config = (env_config_ENV_CONFIG);
54777
54777
  ;// ./src/utils/envUtils.js
54778
54778
 
54779
- var envUtils_getHost = function getHost(env) {
54779
+ var getHost = function getHost(env) {
54780
54780
  var _HOST__;
54781
54781
  return env ? env_config[env].host : (_HOST__ = "www.paypal.com") !== null && _HOST__ !== void 0 ? _HOST__ : env_config.production.host;
54782
54782
  };
@@ -54836,12 +54836,12 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
54836
54836
  var searchParams = new URLSearchParams({
54837
54837
  payerId: payerId
54838
54838
  });
54839
- var returnUri = " https://".concat(envUtils_getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
54839
+ var returnUri = " https://".concat(getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
54840
54840
  return /*#__PURE__*/react.createElement(ZoidPopup, {
54841
54841
  styles: styles,
54842
54842
  partnerName: partnerName,
54843
54843
  onError: onError,
54844
- url: "https://".concat(envUtils_getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
54844
+ url: "https://".concat(getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
54845
54845
  width: width,
54846
54846
  height: height,
54847
54847
  onComplete: onComplete,
@@ -54854,7 +54854,7 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
54854
54854
  styles: styles,
54855
54855
  partnerName: partnerName,
54856
54856
  onError: onError,
54857
- url: "https://".concat(envUtils_getHost(env), "/fundsmanagement/login-redirect"),
54857
+ url: "https://".concat(getHost(env), "/fundsmanagement/login-redirect"),
54858
54858
  getAccessToken: getAccessToken,
54859
54859
  width: width,
54860
54860
  height: height,
@@ -62605,7 +62605,7 @@ var RemoteApp = function RemoteApp(props) {
62605
62605
  id: "remoteAppContainer"
62606
62606
  }, /*#__PURE__*/react.createElement(RemoteComponent, {
62607
62607
  preFetchedData: prefetchData,
62608
- host: envUtils_getHost(env),
62608
+ host: getHost(env),
62609
62609
  styleOverrides: props.style,
62610
62610
  isSDKFlow: true,
62611
62611
  partnerHostedModuleUrls: partnerHostedModuleUrls
@@ -62854,7 +62854,7 @@ var prefixUrlWithHost = function prefixUrlWithHost(url) {
62854
62854
  var targetPath = _MF_PREFIXABLE_PATHS[_i];
62855
62855
  if (pathname.startsWith(targetPath)) {
62856
62856
  console.log('[SDK Interceptor] Update path to paypal domain');
62857
- finalUrl = "https://".concat(envUtils_getHost(env)).concat(pathname);
62857
+ finalUrl = "https://".concat(getHost(env)).concat(pathname);
62858
62858
  break;
62859
62859
  }
62860
62860
  }
@@ -67300,6 +67300,8 @@ var installXhrInterceptor = function installXhrInterceptor(env) {
67300
67300
  * - federationModuleConfigs: Module federation configurations for modules that support it
67301
67301
  */
67302
67302
 
67303
+
67304
+
67303
67305
  /**
67304
67306
  * Iframe module configurations
67305
67307
  * These URLs are used when module federation is not available or is disabled
@@ -52838,7 +52838,7 @@ var env_config_ENV_CONFIG = {
52838
52838
  /* harmony default export */ const env_config = (env_config_ENV_CONFIG);
52839
52839
  ;// ./src/utils/envUtils.js
52840
52840
 
52841
- var envUtils_getHost = function getHost(env) {
52841
+ var getHost = function getHost(env) {
52842
52842
  var _HOST__;
52843
52843
  return env ? env_config[env].host : (_HOST__ = "localhost.paypal.com") !== null && _HOST__ !== void 0 ? _HOST__ : env_config.production.host;
52844
52844
  };
@@ -52898,12 +52898,12 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
52898
52898
  var searchParams = new URLSearchParams({
52899
52899
  payerId: payerId
52900
52900
  });
52901
- var returnUri = " https://".concat(envUtils_getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
52901
+ var returnUri = " https://".concat(getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
52902
52902
  return /*#__PURE__*/index_js_eager_default().createElement(ZoidPopup, {
52903
52903
  styles: styles,
52904
52904
  partnerName: partnerName,
52905
52905
  onError: onError,
52906
- url: "https://".concat(envUtils_getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
52906
+ url: "https://".concat(getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
52907
52907
  width: width,
52908
52908
  height: height,
52909
52909
  onComplete: onComplete,
@@ -52916,7 +52916,7 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
52916
52916
  styles: styles,
52917
52917
  partnerName: partnerName,
52918
52918
  onError: onError,
52919
- url: "https://".concat(envUtils_getHost(env), "/fundsmanagement/login-redirect"),
52919
+ url: "https://".concat(getHost(env), "/fundsmanagement/login-redirect"),
52920
52920
  getAccessToken: getAccessToken,
52921
52921
  width: width,
52922
52922
  height: height,
@@ -54229,7 +54229,7 @@ var RemoteApp = function RemoteApp(props) {
54229
54229
  id: "remoteAppContainer"
54230
54230
  }, /*#__PURE__*/index_js_eager_default().createElement(RemoteComponent, {
54231
54231
  preFetchedData: prefetchData,
54232
- host: envUtils_getHost(env),
54232
+ host: getHost(env),
54233
54233
  styleOverrides: props.style,
54234
54234
  isSDKFlow: true,
54235
54235
  partnerHostedModuleUrls: partnerHostedModuleUrls
@@ -54478,7 +54478,7 @@ var prefixUrlWithHost = function prefixUrlWithHost(url) {
54478
54478
  var targetPath = _MF_PREFIXABLE_PATHS[_i];
54479
54479
  if (pathname.startsWith(targetPath)) {
54480
54480
  console.log('[SDK Interceptor] Update path to paypal domain');
54481
- finalUrl = "https://".concat(envUtils_getHost(env)).concat(pathname);
54481
+ finalUrl = "https://".concat(getHost(env)).concat(pathname);
54482
54482
  break;
54483
54483
  }
54484
54484
  }
@@ -58924,6 +58924,8 @@ var installXhrInterceptor = function installXhrInterceptor(env) {
58924
58924
  * - federationModuleConfigs: Module federation configurations for modules that support it
58925
58925
  */
58926
58926
 
58927
+
58928
+
58927
58929
  /**
58928
58930
  * Iframe module configurations
58929
58931
  * These URLs are used when module federation is not available or is disabled
@@ -52838,7 +52838,7 @@ var env_config_ENV_CONFIG = {
52838
52838
  /* harmony default export */ const env_config = (env_config_ENV_CONFIG);
52839
52839
  ;// ./src/utils/envUtils.js
52840
52840
 
52841
- var envUtils_getHost = function getHost(env) {
52841
+ var getHost = function getHost(env) {
52842
52842
  var _HOST__;
52843
52843
  return env ? env_config[env].host : (_HOST__ = "www.sandbox.paypal.com") !== null && _HOST__ !== void 0 ? _HOST__ : env_config.production.host;
52844
52844
  };
@@ -52898,12 +52898,12 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
52898
52898
  var searchParams = new URLSearchParams({
52899
52899
  payerId: payerId
52900
52900
  });
52901
- var returnUri = " https://".concat(envUtils_getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
52901
+ var returnUri = " https://".concat(getHost(env), "/fundsmanagement/embedded?").concat(searchParams.toString());
52902
52902
  return /*#__PURE__*/index_js_eager_default().createElement(ZoidPopup, {
52903
52903
  styles: styles,
52904
52904
  partnerName: partnerName,
52905
52905
  onError: onError,
52906
- url: "https://".concat(envUtils_getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
52906
+ url: "https://".concat(getHost(env), "/signin/?returnUri=").concat(encodeURIComponent(returnUri)),
52907
52907
  width: width,
52908
52908
  height: height,
52909
52909
  onComplete: onComplete,
@@ -52916,7 +52916,7 @@ var PromptEmbeddedLogin = function PromptEmbeddedLogin(props) {
52916
52916
  styles: styles,
52917
52917
  partnerName: partnerName,
52918
52918
  onError: onError,
52919
- url: "https://".concat(envUtils_getHost(env), "/fundsmanagement/login-redirect"),
52919
+ url: "https://".concat(getHost(env), "/fundsmanagement/login-redirect"),
52920
52920
  getAccessToken: getAccessToken,
52921
52921
  width: width,
52922
52922
  height: height,
@@ -54229,7 +54229,7 @@ var RemoteApp = function RemoteApp(props) {
54229
54229
  id: "remoteAppContainer"
54230
54230
  }, /*#__PURE__*/index_js_eager_default().createElement(RemoteComponent, {
54231
54231
  preFetchedData: prefetchData,
54232
- host: envUtils_getHost(env),
54232
+ host: getHost(env),
54233
54233
  styleOverrides: props.style,
54234
54234
  isSDKFlow: true,
54235
54235
  partnerHostedModuleUrls: partnerHostedModuleUrls
@@ -54478,7 +54478,7 @@ var prefixUrlWithHost = function prefixUrlWithHost(url) {
54478
54478
  var targetPath = _MF_PREFIXABLE_PATHS[_i];
54479
54479
  if (pathname.startsWith(targetPath)) {
54480
54480
  console.log('[SDK Interceptor] Update path to paypal domain');
54481
- finalUrl = "https://".concat(envUtils_getHost(env)).concat(pathname);
54481
+ finalUrl = "https://".concat(getHost(env)).concat(pathname);
54482
54482
  break;
54483
54483
  }
54484
54484
  }
@@ -58924,6 +58924,8 @@ var installXhrInterceptor = function installXhrInterceptor(env) {
58924
58924
  * - federationModuleConfigs: Module federation configurations for modules that support it
58925
58925
  */
58926
58926
 
58927
+
58928
+
58927
58929
  /**
58928
58930
  * Iframe module configurations
58929
58931
  * These URLs are used when module federation is not available or is disabled