oak-pay-business 3.4.1 → 3.4.2

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.
@@ -58,12 +58,12 @@ const checkers = [
58
58
  });
59
59
  };
60
60
  if (data instanceof Array) {
61
- for (const d of data) {
62
- checkfn(d);
63
- }
61
+ return pipeline(...data.map((ele) => {
62
+ return () => checkfn(ele);
63
+ }));
64
64
  }
65
65
  else {
66
- checkfn(data);
66
+ return checkfn(data);
67
67
  }
68
68
  }
69
69
  },
@@ -273,6 +273,12 @@ export default class AliPay extends AliPayDebug {
273
273
  async close(pay) {
274
274
  const outTradeNo = compressTo32(pay.id);
275
275
  try {
276
+ const [iState, updateData] = await this.getState(pay);
277
+ // 电脑网站支付时 设置超时后,支付宝交易订单会出现超时关闭 需查询当前的状态
278
+ // 如果支付宝查询接口返回状态为closed,则订单已关闭,不需要执行关闭接口
279
+ if (iState === 'closed') {
280
+ return;
281
+ }
276
282
  const result = await this.alipaySdk.curl('POST', '/v3/alipay/trade/close', {
277
283
  body: {
278
284
  out_trade_no: outTradeNo,
@@ -60,12 +60,12 @@ const checkers = [
60
60
  });
61
61
  };
62
62
  if (data instanceof Array) {
63
- for (const d of data) {
64
- checkfn(d);
65
- }
63
+ return (0, executor_1.pipeline)(...data.map((ele) => {
64
+ return () => checkfn(ele);
65
+ }));
66
66
  }
67
67
  else {
68
- checkfn(data);
68
+ return checkfn(data);
69
69
  }
70
70
  }
71
71
  },
@@ -276,6 +276,12 @@ class AliPay extends AliPay_debug_1.default {
276
276
  async close(pay) {
277
277
  const outTradeNo = (0, uuid_1.compressTo32)(pay.id);
278
278
  try {
279
+ const [iState, updateData] = await this.getState(pay);
280
+ // 电脑网站支付时 设置超时后,支付宝交易订单会出现超时关闭 需查询当前的状态
281
+ // 如果支付宝查询接口返回状态为closed,则订单已关闭,不需要执行关闭接口
282
+ if (iState === 'closed') {
283
+ return;
284
+ }
279
285
  const result = await this.alipaySdk.curl('POST', '/v3/alipay/trade/close', {
280
286
  body: {
281
287
  out_trade_no: outTradeNo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-pay-business",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib/**/*",
@@ -31,10 +31,10 @@
31
31
  "alipay-sdk": "^4.14.0",
32
32
  "classnames": "^2.3.1",
33
33
  "dayjs": "^1.11.5",
34
- "oak-domain": "^5.1.29",
34
+ "oak-domain": "^5.1.30",
35
35
  "oak-external-sdk": "^2.3.11",
36
- "oak-frontend-base": "^5.3.40",
37
- "oak-general-business": "~5.10.1",
36
+ "oak-frontend-base": "^5.3.43",
37
+ "oak-general-business": "~5.10.4",
38
38
  "react-markdown": "^9.0.3",
39
39
  "wechat-pay-nodejs": "^0.2.3"
40
40
  },