@nuskin/ns-shop 7.3.0-pa-1.6 → 7.3.0
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 +2 -2
- package/src/cart/cartService.js +2 -2
- package/src/order/order.js +11 -0
- package/src/order/orderAdapter.js +3 -0
- package/src/shop.js +0 -1
- package/src/account/agreementService.js +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/ns-shop",
|
|
3
|
-
"version": "7.3.0
|
|
3
|
+
"version": "7.3.0",
|
|
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": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@nuskin/ns-account": "5.9.2",
|
|
44
44
|
"@nuskin/ns-jsanalyzer": "1.0.1",
|
|
45
45
|
"@nuskin/ns-product": "3.50.8",
|
|
46
|
-
"@nuskin/ns-util": "4.
|
|
46
|
+
"@nuskin/ns-util": "4.6.1",
|
|
47
47
|
"axios-mock-adapter": "1.22.0",
|
|
48
48
|
"babel-cli": "6.26.0",
|
|
49
49
|
"babel-core": "6.26.3",
|
package/src/cart/cartService.js
CHANGED
|
@@ -245,7 +245,7 @@ async function checkForMissingEventNames(order) {
|
|
|
245
245
|
});
|
|
246
246
|
|
|
247
247
|
let updated = await cart.setMissingEventNames(order);
|
|
248
|
-
setCart(cart);
|
|
248
|
+
setCart(cart, false);
|
|
249
249
|
return updated || outOfSync;
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -821,7 +821,7 @@ function syncCartItemToSapItem(sapItemKey, cartItemKey = null) {
|
|
|
821
821
|
cartItem.qtyRedeemWithPoints = sapItem.qtyRedeemWithPoints;
|
|
822
822
|
cartItem.product.subPriceFlag = sapItem.product.subPriceFlag;
|
|
823
823
|
cart.addCartItem(cartItem, true);
|
|
824
|
-
setCart(cart);
|
|
824
|
+
setCart(cart, false);
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
|
package/src/order/order.js
CHANGED
|
@@ -56,6 +56,7 @@ newShop.Order = function(orderData){
|
|
|
56
56
|
let errorResponseInfo;
|
|
57
57
|
let paymentAuthorizationObject;
|
|
58
58
|
let giftReceipt;
|
|
59
|
+
let dropShip;
|
|
59
60
|
let externalPaymentAdrNumber;
|
|
60
61
|
|
|
61
62
|
let redirectUrl;
|
|
@@ -117,6 +118,7 @@ newShop.Order = function(orderData){
|
|
|
117
118
|
errorResponseInfo = orderData.errorResponseInfo;
|
|
118
119
|
paymentAuthorizationObject = orderData.paymentAuthorizationObject;
|
|
119
120
|
giftReceipt = orderData.giftReceipt;
|
|
121
|
+
dropShip = orderData.dropShip;
|
|
120
122
|
externalPaymentAdrNumber = orderData.externalPaymentAdrNumber;
|
|
121
123
|
redirectUrl = orderData.redirectUrl;
|
|
122
124
|
proxyLaunchUrl = orderData.proxyLaunchUrl;
|
|
@@ -272,6 +274,7 @@ newShop.Order = function(orderData){
|
|
|
272
274
|
order.externalPaymentAdrNumber = externalPaymentAdrNumber;
|
|
273
275
|
order.paymentAuthorizationObject = paymentAuthorizationObject;
|
|
274
276
|
order.giftReceipt = giftReceipt;
|
|
277
|
+
order.dropShip = dropShip;
|
|
275
278
|
order.redirectUrl = redirectUrl;
|
|
276
279
|
order.proxyLaunchUrl = proxyLaunchUrl;
|
|
277
280
|
order.proxyReenterUrl = proxyReenterUrl;
|
|
@@ -691,6 +694,14 @@ newShop.Order = function(orderData){
|
|
|
691
694
|
giftReceipt = _giftReceipt;
|
|
692
695
|
}
|
|
693
696
|
},
|
|
697
|
+
dropShip: {
|
|
698
|
+
get: function() {
|
|
699
|
+
return dropShip;
|
|
700
|
+
},
|
|
701
|
+
set: function(_dropShip) {
|
|
702
|
+
dropShip = _dropShip;
|
|
703
|
+
}
|
|
704
|
+
},
|
|
694
705
|
externalPaymentAdrNumber: {
|
|
695
706
|
get: function() {
|
|
696
707
|
return externalPaymentAdrNumber;
|
|
@@ -1027,6 +1027,9 @@ const populateSalesOrder = (action, adr) => {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
addToCustomList(salesOrder.Custom, "", "SENDER", order.distributorName);
|
|
1029
1029
|
addToCustomList(salesOrder.Custom, "", "ZZUSE_PTS", order.shippingPayWithPoints ? "X" : "NA");
|
|
1030
|
+
if (order.dropShip) {
|
|
1031
|
+
addToCustomList(salesOrder.Custom, "FLAG", "DROPSHIP", "TRUE");
|
|
1032
|
+
}
|
|
1030
1033
|
if (user && user.isGuest) {
|
|
1031
1034
|
addToCustomList(salesOrder.Custom, "FLAG", "GUEST", "TRUE");
|
|
1032
1035
|
}
|
package/src/shop.js
CHANGED
|
@@ -65,7 +65,6 @@ export {default as AccertifyFraudService} from './payment/accertifyFraudService.
|
|
|
65
65
|
export {default as EquinoxCartService} from './cart/equinoxCartService.js';
|
|
66
66
|
export {default as eidLogin} from './eidLogin';
|
|
67
67
|
export {default as Receiver} from './receiver';
|
|
68
|
-
export {default as AgreementService} from './account/agreementService.js'
|
|
69
68
|
|
|
70
69
|
export {PriceType, Agelocme, Product, ProductStatus} from '@nuskin/ns-product-lib';
|
|
71
70
|
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {UrlService} from "@nuskin/ns-util";
|
|
2
|
-
import axios from 'axios'
|
|
3
|
-
|
|
4
|
-
const downConvertAgreedToTerms = async (sapId, authToken) => {
|
|
5
|
-
let retVal = true;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const result = await axios.get(
|
|
9
|
-
`${UrlService.getApisUrl()}/account-enrollment/agreement-terms/${sapId}`,
|
|
10
|
-
{
|
|
11
|
-
headers: {
|
|
12
|
-
Authorization: `Bearer ${authToken}`
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
)
|
|
16
|
-
retVal = result.data.agreedTerms;
|
|
17
|
-
} catch (e) {
|
|
18
|
-
console.error('agreement-terms check failed', e)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return retVal
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const setDownConvertAgreedToTerms = async (sapId, authToken) => {
|
|
25
|
-
let succeeded = true
|
|
26
|
-
try {
|
|
27
|
-
await axios.post(`${UrlService.getApisUrl()}/account-enrollment/agreement-terms`, {
|
|
28
|
-
agreedTerms: true,
|
|
29
|
-
sapId
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
headers: {
|
|
33
|
-
Authorization: `Bearer ${authToken}`
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
} catch (e) {
|
|
37
|
-
console.error('Failed setting agreement to terms', e);
|
|
38
|
-
succeeded = false;
|
|
39
|
-
}
|
|
40
|
-
return succeeded;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
downConvertAgreedToTerms,
|
|
45
|
-
setDownConvertAgreedToTerms
|
|
46
|
-
};
|