@pisell/pisellos 0.0.288 → 0.0.289
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.
|
@@ -1407,7 +1407,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1407
1407
|
|
|
1408
1408
|
// 更新 stateAmount 为剩余未支付金额
|
|
1409
1409
|
_context17.next = 22;
|
|
1410
|
-
return this.updateStateAmountToRemaining();
|
|
1410
|
+
return this.updateStateAmountToRemaining(false);
|
|
1411
1411
|
case 22:
|
|
1412
1412
|
_context17.next = 24;
|
|
1413
1413
|
return this.core.effects.emit(CheckoutHooks.OnPaymentStarted, {
|
|
@@ -2838,14 +2838,18 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2838
2838
|
key: "updateStateAmountToRemaining",
|
|
2839
2839
|
value: (function () {
|
|
2840
2840
|
var _updateStateAmountToRemaining = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2841
|
-
var
|
|
2841
|
+
var checkOrder,
|
|
2842
|
+
remainingAmount,
|
|
2843
|
+
currentStateAmount,
|
|
2844
|
+
_args34 = arguments;
|
|
2842
2845
|
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2843
2846
|
while (1) switch (_context34.prev = _context34.next) {
|
|
2844
2847
|
case 0:
|
|
2845
|
-
|
|
2846
|
-
_context34.
|
|
2848
|
+
checkOrder = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : true;
|
|
2849
|
+
_context34.prev = 1;
|
|
2850
|
+
_context34.next = 4;
|
|
2847
2851
|
return this.calculateRemainingAmountAsync();
|
|
2848
|
-
case
|
|
2852
|
+
case 4:
|
|
2849
2853
|
remainingAmount = _context34.sent;
|
|
2850
2854
|
currentStateAmount = this.store.stateAmount; // 只有当剩余金额与当前 stateAmount 不同时才更新
|
|
2851
2855
|
if (remainingAmount !== currentStateAmount) {
|
|
@@ -2869,23 +2873,30 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2869
2873
|
}
|
|
2870
2874
|
|
|
2871
2875
|
// 同步更新系统内部的 balanceDueAmount
|
|
2872
|
-
_context34.next =
|
|
2876
|
+
_context34.next = 9;
|
|
2873
2877
|
return this.updateBalanceDueAmount();
|
|
2874
|
-
case
|
|
2875
|
-
|
|
2878
|
+
case 9:
|
|
2879
|
+
if (checkOrder) {
|
|
2880
|
+
_context34.next = 12;
|
|
2881
|
+
break;
|
|
2882
|
+
}
|
|
2883
|
+
this.logInfo('外部传入无需 checkOrder,不执行订单支付完成检测和同步');
|
|
2884
|
+
return _context34.abrupt("return");
|
|
2885
|
+
case 12:
|
|
2886
|
+
_context34.next = 14;
|
|
2876
2887
|
return this.checkOrderPaymentCompletion();
|
|
2877
|
-
case
|
|
2878
|
-
_context34.next =
|
|
2888
|
+
case 14:
|
|
2889
|
+
_context34.next = 19;
|
|
2879
2890
|
break;
|
|
2880
|
-
case
|
|
2881
|
-
_context34.prev =
|
|
2882
|
-
_context34.t0 = _context34["catch"](
|
|
2891
|
+
case 16:
|
|
2892
|
+
_context34.prev = 16;
|
|
2893
|
+
_context34.t0 = _context34["catch"](1);
|
|
2883
2894
|
this.logError('更新 stateAmount 为剩余金额失败:', _context34.t0);
|
|
2884
|
-
case
|
|
2895
|
+
case 19:
|
|
2885
2896
|
case "end":
|
|
2886
2897
|
return _context34.stop();
|
|
2887
2898
|
}
|
|
2888
|
-
}, _callee34, this, [[
|
|
2899
|
+
}, _callee34, this, [[1, 16]]);
|
|
2889
2900
|
}));
|
|
2890
2901
|
function updateStateAmountToRemaining() {
|
|
2891
2902
|
return _updateStateAmountToRemaining.apply(this, arguments);
|
|
@@ -876,7 +876,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
876
876
|
}
|
|
877
877
|
this.store.currentOrder = updatedOrder;
|
|
878
878
|
}
|
|
879
|
-
await this.updateStateAmountToRemaining();
|
|
879
|
+
await this.updateStateAmountToRemaining(false);
|
|
880
880
|
await this.core.effects.emit(import_types.CheckoutHooks.OnPaymentStarted, {
|
|
881
881
|
orderUuid: this.store.currentOrder.uuid,
|
|
882
882
|
paymentMethodCode: paymentItem.code,
|
|
@@ -1754,7 +1754,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1754
1754
|
/**
|
|
1755
1755
|
* 更新 stateAmount 为当前剩余未支付金额
|
|
1756
1756
|
*/
|
|
1757
|
-
async updateStateAmountToRemaining() {
|
|
1757
|
+
async updateStateAmountToRemaining(checkOrder = true) {
|
|
1758
1758
|
try {
|
|
1759
1759
|
const remainingAmount = await this.calculateRemainingAmountAsync();
|
|
1760
1760
|
const currentStateAmount = this.store.stateAmount;
|
|
@@ -1776,6 +1776,10 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
await this.updateBalanceDueAmount();
|
|
1779
|
+
if (!checkOrder) {
|
|
1780
|
+
this.logInfo("外部传入无需 checkOrder,不执行订单支付完成检测和同步");
|
|
1781
|
+
return;
|
|
1782
|
+
}
|
|
1779
1783
|
await this.checkOrderPaymentCompletion();
|
|
1780
1784
|
} catch (error) {
|
|
1781
1785
|
this.logError("更新 stateAmount 为剩余金额失败:", error);
|