|
@@ -247,14 +247,13 @@ const sendPayConfirm = (code, payment, uid) => { |
|
@@ -247,14 +247,13 @@ const sendPayConfirm = (code, payment, uid) => { |
247
|
};
|
247
|
};
|
248
|
|
248
|
|
249
|
/**
|
249
|
/**
|
250
|
- * [公共支付成功数据处理]
|
|
|
251
|
- * @param {[type]} orderInfo [订单信息]
|
|
|
252
|
- * @param {[type]} fraudData [资源位数据]
|
|
|
253
|
- * @param {[type]} payId [支付方式ID]
|
250
|
+ * [埋点数据公共处理]
|
|
|
251
|
+ * @param {[type]} orderInfo [订单详情]
|
|
|
252
|
+ * @param {[type]} payId [支付方式id]
|
|
|
253
|
+ * @param {[type]} payResult [支付成功状态]
|
254
|
* @return {[type]} [{}]
|
254
|
* @return {[type]} [{}]
|
255
|
*/
|
255
|
*/
|
256
|
-const _execOrderData = (orderInfo, fraudData, payId) => {
|
|
|
257
|
- let fraud = _.result(_.find(fraudData, {template_name: 'text'}), 'data') || {};
|
256
|
+const _point = (orderInfo, payId, payResult) => {
|
258
|
let sknArr = [];
|
257
|
let sknArr = [];
|
259
|
let skuArr = [];
|
258
|
let skuArr = [];
|
260
|
|
259
|
|
|
@@ -264,6 +263,26 @@ const _execOrderData = (orderInfo, fraudData, payId) => { |
|
@@ -264,6 +263,26 @@ const _execOrderData = (orderInfo, fraudData, payId) => { |
264
|
});
|
263
|
});
|
265
|
|
264
|
|
266
|
return {
|
265
|
return {
|
|
|
266
|
+ order_code: orderInfo.order_code,
|
|
|
267
|
+ payResult: payResult, // 1支付成功,2支付失败
|
|
|
268
|
+ amount: orderInfo.payment_amount,
|
|
|
269
|
+ payStyle: payId, // 支付方式id
|
|
|
270
|
+ proSkn: sknArr.join(','),
|
|
|
271
|
+ proSku: skuArr.join(',')
|
|
|
272
|
+ };
|
|
|
273
|
+};
|
|
|
274
|
+
|
|
|
275
|
+/**
|
|
|
276
|
+ * [公共支付成功数据处理]
|
|
|
277
|
+ * @param {[type]} orderInfo [订单信息]
|
|
|
278
|
+ * @param {[type]} fraudData [资源位数据]
|
|
|
279
|
+ * @param {[type]} payId [支付方式ID]
|
|
|
280
|
+ * @return {[type]} [{}]
|
|
|
281
|
+ */
|
|
|
282
|
+const _execOrderData = (orderInfo, fraudData, payId) => {
|
|
|
283
|
+ let fraud = _.result(_.find(fraudData, {template_name: 'text'}), 'data') || {};
|
|
|
284
|
+
|
|
|
285
|
+ return {
|
267
|
paymentTypes: (orderInfo.payment_type === 1 ? '在线支付' : '货到付款'),
|
286
|
paymentTypes: (orderInfo.payment_type === 1 ? '在线支付' : '货到付款'),
|
268
|
multiPackage: orderInfo.is_multi_package === 'Y',
|
287
|
multiPackage: orderInfo.is_multi_package === 'Y',
|
269
|
ordersUrl: helpers.urlFormat('/home/orders'),
|
288
|
ordersUrl: helpers.urlFormat('/home/orders'),
|
|
@@ -279,15 +298,7 @@ const _execOrderData = (orderInfo, fraudData, payId) => { |
|
@@ -279,15 +298,7 @@ const _execOrderData = (orderInfo, fraudData, payId) => { |
279
|
order_code: orderInfo.order_code,
|
298
|
order_code: orderInfo.order_code,
|
280
|
items: orderInfo.order_goods
|
299
|
items: orderInfo.order_goods
|
281
|
},
|
300
|
},
|
282
|
- point: {
|
|
|
283
|
- order_code: orderInfo.order_code,
|
|
|
284
|
- payResult: 1, // 1支付成功,2支付失败
|
|
|
285
|
- amount: orderInfo.payment_amount,
|
|
|
286
|
- payStyle: payId, // 支付方式id
|
|
|
287
|
- proSkn: sknArr.join(','),
|
|
|
288
|
- proSku: skuArr.join(',')
|
|
|
289
|
-
|
|
|
290
|
- }
|
301
|
+ point: _point(orderInfo, payId, 1)
|
291
|
};
|
302
|
};
|
292
|
};
|
303
|
};
|
293
|
|
304
|
|
|
@@ -316,7 +327,7 @@ const procOrderData = (payResult, uid, payId) => { |
|
@@ -316,7 +327,7 @@ const procOrderData = (payResult, uid, payId) => { |
316
|
|
327
|
|
317
|
if (orderInfo.is_cancel === 'Y') {
|
328
|
if (orderInfo.is_cancel === 'Y') {
|
318
|
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: orderInfo});
|
329
|
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: orderInfo});
|
319
|
- return {code: 417, message: '支付成功,但订单已取消,需联系客服!'};
|
330
|
+ return {code: 417, message: '支付成功,但订单已取消,需联系客服!', point: _point(orderInfo, payId, 2)};
|
320
|
}
|
331
|
}
|
321
|
|
332
|
|
322
|
if (orderInfo.payment_status === 'N') {
|
333
|
if (orderInfo.payment_status === 'N') {
|
|
@@ -327,7 +338,8 @@ const procOrderData = (payResult, uid, payId) => { |
|
@@ -327,7 +338,8 @@ const procOrderData = (payResult, uid, payId) => { |
327
|
logger.warn('front pay success but the amount is not same.', {payResult: payResult, order: orderInfo});
|
338
|
logger.warn('front pay success but the amount is not same.', {payResult: payResult, order: orderInfo});
|
328
|
return {
|
339
|
return {
|
329
|
code: 415,
|
340
|
code: 415,
|
330
|
- message: '支付金额与订单金额不一致,订单状态更新失败!'
|
341
|
+ message: '支付金额与订单金额不一致,订单状态更新失败!',
|
|
|
342
|
+ point: _point(orderInfo, payId, 2)
|
331
|
};
|
343
|
};
|
332
|
}
|
344
|
}
|
333
|
|
345
|
|