@nuskin/ns-shop 7.3.0-pa-1.2 → 7.3.0-pa-1.4

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": "@nuskin/ns-shop",
3
- "version": "7.3.0-pa-1.2",
3
+ "version": "7.3.0-pa-1.4",
4
4
  "description": "The description that will amaze and astound your audience when they read it",
5
5
  "main": "src/shop.js",
6
6
  "scripts": {
@@ -30,7 +30,6 @@
30
30
  "@nuskin/nuskinjquery": "2.3.1",
31
31
  "@nuskin/order-model": "3.1.3",
32
32
  "@nuskin/product-lib": "2.2.1",
33
- "@nuskin/ns-util": "4.7.0",
34
33
  "axios": "1.7.9",
35
34
  "decimal.js": "10.4.3",
36
35
  "jp-conversion": "0.0.7",
@@ -44,7 +43,7 @@
44
43
  "@nuskin/ns-account": "5.9.2",
45
44
  "@nuskin/ns-jsanalyzer": "1.0.1",
46
45
  "@nuskin/ns-product": "3.50.8",
47
- "@nuskin/ns-util": "4.6.1",
46
+ "@nuskin/ns-util": "4.7.2",
48
47
  "axios-mock-adapter": "1.22.0",
49
48
  "babel-cli": "6.26.0",
50
49
  "babel-core": "6.26.3",
@@ -1,12 +1,12 @@
1
1
  import {UrlService} from "@nuskin/ns-util";
2
2
  import axios from 'axios'
3
3
 
4
- const hasAgreedToTerms = async (sapId) => {
4
+ const downConvertAgreedToTerms = async (sapId) => {
5
5
  let retVal = false;
6
6
 
7
7
  try {
8
- const result = await axios.get(`${UrlService.getAwsUrl()}/account-renroll/agreement-terms/${sapId}`)
9
- retVal = result.agreedTerms;
8
+ const result = await axios.get(`${UrlService.getApisUrl()}/account-enrollment/agreement-terms/${sapId}`)
9
+ retVal = result.data.agreedTerms;
10
10
  } catch (e) {
11
11
  console.error('agreement-terms check failed', e)
12
12
  }
@@ -14,18 +14,21 @@ const hasAgreedToTerms = async (sapId) => {
14
14
  return retVal
15
15
  }
16
16
 
17
- const setAgreedToTerms = async (sapId) => {
17
+ const setDownConvertAgreedToTerms = async (sapId) => {
18
+ let succeeded = true
18
19
  try {
19
- await axios.post(`${UrlService.getAwsUrl()}/account-renroll/agreement-terms`, {
20
+ await axios.post(`${UrlService.getApisUrl()}/account-enrollment/agreement-terms`, {
20
21
  agreedTerms: true,
21
22
  sapId
22
23
  })
23
24
  } catch (e) {
24
25
  console.error('Failed setting agreement to terms', e);
26
+ succeeded = false;
25
27
  }
28
+ return succeeded;
26
29
  }
27
30
 
28
31
  export default {
29
- hasAgreedToTerms,
30
- setAgreedToTerms
32
+ downConvertAgreedToTerms,
33
+ setDownConvertAgreedToTerms
31
34
  };
@@ -6,10 +6,8 @@ import {getCachedConfigField} from '@nuskin/configuration-sdk';
6
6
  import {UserService} from "@nuskin/ns-account";
7
7
  import PaymentAdapter from '../payment/PaymentAdapter';
8
8
  import pickupUtil from '../shipping/pickupUtil';
9
- import { storage } from "@nuskin/ns-util";
10
9
 
11
10
  let splitLineItems = [];
12
- const utmInfo = storage.getItem(storage.metadata.UTM_INFO) || {};
13
11
  const addToCustomList = (customList, type, key, value) => {
14
12
  if (value) {
15
13
  let found = false;
@@ -497,10 +495,6 @@ const populateCategory = (salesOrder) => {
497
495
  } else if (util.getSponsorId()) {
498
496
  // affiliates don't use a subdomain. So if we have a sponsor and it isn't a pitch then we consider it a storefront
499
497
  salesOrder.Category = "STOREFRONT";
500
- } else if (utmInfo.utm_medium && utmInfo.utm_medium.includes('paidsearch')) {
501
- salesOrder.Category = 'PAIDSEARCH';
502
- } else if (utmInfo.utm_medium && utmInfo.utm_medium.includes('paidsocial')) {
503
- salesOrder.Category = 'PAIDAD';
504
498
  } else {
505
499
  salesOrder.Category = 'WEB';
506
500
  }
@@ -1036,12 +1030,6 @@ const populateSalesOrder = (action, adr) => {
1036
1030
  if (user && user.isGuest) {
1037
1031
  addToCustomList(salesOrder.Custom, "FLAG", "GUEST", "TRUE");
1038
1032
  }
1039
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_SOURCE", utmInfo.utm_source);
1040
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_MEDIUM", utmInfo.utm_medium);
1041
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN", utmInfo.utm_campaign);
1042
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN_ID", utmInfo.utm_id);
1043
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_CONTENT", utmInfo.utm_content);
1044
- addToCustomList(salesOrder.Custom, "FLAG", "UTM_TERM", utmInfo.utm_term);
1045
1033
  const microsite = getCachedConfigField('microsite');
1046
1034
  if (microsite) {
1047
1035
  salesOrder.Reason = "CUSTOM";
@@ -158,15 +158,13 @@ let PickupUtil = function() {
158
158
  function getUrl() {
159
159
  switch (RunConfigService.getEnvironmentCode()) {
160
160
  case 'dev':
161
- return 'https://ship-methods.api.dev.nuskin.com/v1';
161
+ return 'https://apis.dev.nuskin.com/ship-methods/v1';
162
162
  case 'test':
163
- return 'https://ship-methods.api.test.nuskin.com/v1';
164
- case 'stage':
165
- return 'https://ship-methods.api.dev.nuskin.com/v1';
163
+ return 'https://apis.test.nuskin.com/ship-methods/v1';
166
164
  case 'prod':
167
- return 'https://ship-methods.api.nuskin.com/v1';
165
+ return 'https://apis.nuskin.com/ship-methods/v1';
168
166
  default:
169
- return 'https://ship-methods.api.test.nuskin.com/v1';
167
+ return 'https://apis.test.nuskin.com/ship-methods/v1';
170
168
  }
171
169
  }
172
170