@pisell/private-materials 6.3.14 → 6.3.16
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
- package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
- package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
- package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
- package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
- package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
- package/es/components/pay/toC/index.js +278 -118
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
- package/es/components/wallet/Detail/index.js +3 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/components/WalletCard.js +8 -3
- package/es/components/wallet/model.d.ts +9 -1
- package/es/hooks/usePaymentLogger.d.ts +22 -0
- package/es/hooks/usePaymentLogger.js +78 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
- package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
- package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
- package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
- package/lib/components/pay/toC/index.js +183 -48
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
- package/lib/components/wallet/Detail/index.js +18 -5
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/components/WalletCard.js +3 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/hooks/usePaymentLogger.d.ts +22 -0
- package/lib/hooks/usePaymentLogger.js +69 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +3 -3
@@ -15,6 +15,7 @@ import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
|
|
15
15
|
import { Context } from "../../model";
|
16
16
|
import { getPayGroupParamsFromStorage } from "../../payGroup";
|
17
17
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
18
|
+
import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
|
18
19
|
import { clientPayment, formatFranchiseeRoute } from "../../utils";
|
19
20
|
/**
|
20
21
|
* @title: 谷歌支付
|
@@ -26,7 +27,7 @@ import { clientPayment, formatFranchiseeRoute } from "../../utils";
|
|
26
27
|
* @Date: 2024-08-16 11:01
|
27
28
|
*/
|
28
29
|
var GooglePay = function GooglePay(props, ref) {
|
29
|
-
var _context$appHelper, _context$appHelper2;
|
30
|
+
var _context$appHelper, _context$appHelper2, _state$payGroup;
|
30
31
|
var _useContext = useContext(Context),
|
31
32
|
state = _useContext.state;
|
32
33
|
var _useState = useState(false),
|
@@ -39,6 +40,12 @@ var GooglePay = function GooglePay(props, ref) {
|
|
39
40
|
var _context$appHelper$ut = (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils,
|
40
41
|
interaction = _context$appHelper$ut.interaction;
|
41
42
|
|
43
|
+
// GooglePay支付日志记录器
|
44
|
+
var paymentLogger = usePaymentLogger({
|
45
|
+
orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
|
46
|
+
step: '2'
|
47
|
+
});
|
48
|
+
|
42
49
|
/**
|
43
50
|
* @title: 初始化
|
44
51
|
* @description:
|
@@ -50,33 +57,60 @@ var GooglePay = function GooglePay(props, ref) {
|
|
50
57
|
var init = /*#__PURE__*/function () {
|
51
58
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
52
59
|
var _utils$getStore, _interaction$utils, _interaction$utils$is, _interaction$utils2, _interaction$utils2$i;
|
53
|
-
var payGroup, utils, dvaStore, values, _dvaStore$core, _dvaStore$core2, _state$
|
60
|
+
var payGroup, utils, dvaStore, values, _dvaStore$core, _dvaStore$core2, _state$payGroup2, locale, shopId, currentURL, linkElement, shop_domain, _href;
|
54
61
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
55
62
|
while (1) switch (_context.prev = _context.next) {
|
56
63
|
case 0:
|
57
64
|
payGroup = _ref2.payGroup;
|
65
|
+
// 记录GooglePay初始化开始
|
66
|
+
paymentLogger.addLog({
|
67
|
+
key: 'GooglePay初始化开始',
|
68
|
+
value: ""
|
69
|
+
});
|
58
70
|
utils = context.appHelper.utils || {};
|
59
71
|
dvaStore = utils === null || utils === void 0 || (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 ? void 0 : _utils$getStore.getState(); // 获取交易组
|
60
72
|
values = getPayGroupParamsFromStorage(payGroup.order_id);
|
73
|
+
if (values) {
|
74
|
+
_context.next = 10;
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
// 记录获取支付参数失败
|
78
|
+
paymentLogger.addLog({
|
79
|
+
key: 'GooglePay获取支付参数失败',
|
80
|
+
value: {
|
81
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
|
82
|
+
data: {
|
83
|
+
payGroup: payGroup
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
paymentLogger.sendLogs('GooglePay获取支付参数失败');
|
88
|
+
setOpen(false);
|
89
|
+
return _context.abrupt("return");
|
90
|
+
case 10:
|
91
|
+
// 记录获取支付参数成功
|
92
|
+
paymentLogger.addLog({
|
93
|
+
key: 'GooglePay获取支付参数成功',
|
94
|
+
value: ""
|
95
|
+
});
|
61
96
|
if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils) && (interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$i = _interaction$utils2.isAndroid_ios) === null || _interaction$utils2$i === void 0 ? void 0 : _interaction$utils2$i.call(_interaction$utils2)) === 'android')) {
|
62
|
-
_context.next =
|
97
|
+
_context.next = 15;
|
63
98
|
break;
|
64
99
|
}
|
100
|
+
// 记录Android客户端支付
|
101
|
+
paymentLogger.addLog({
|
102
|
+
key: 'GooglePay使用Android客户端支付',
|
103
|
+
value: ""
|
104
|
+
});
|
105
|
+
paymentLogger.sendLogs('GooglePay客户端支付');
|
65
106
|
return _context.abrupt("return", clientPayment({
|
66
107
|
order_id: payGroup.order_id,
|
67
108
|
type: 'google_pay',
|
68
109
|
values: values,
|
69
110
|
interaction: interaction
|
70
111
|
}));
|
71
|
-
case
|
112
|
+
case 15:
|
72
113
|
setOpen(true);
|
73
|
-
if (values) {
|
74
|
-
_context.next = 10;
|
75
|
-
break;
|
76
|
-
}
|
77
|
-
setOpen(false);
|
78
|
-
return _context.abrupt("return");
|
79
|
-
case 10:
|
80
114
|
try {
|
81
115
|
locale = ((_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale) || 'en';
|
82
116
|
shopId = (_dvaStore$core2 = dvaStore.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.shop) === null || _dvaStore$core2 === void 0 ? void 0 : _dvaStore$core2.id;
|
@@ -86,12 +120,29 @@ var GooglePay = function GooglePay(props, ref) {
|
|
86
120
|
|
87
121
|
// 提取域名
|
88
122
|
shop_domain = linkElement.hostname;
|
89
|
-
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/google-pay?order_id=".concat((_state$
|
123
|
+
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/google-pay?order_id=".concat((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id), state.history)); // 记录即将跳转到GooglePay
|
124
|
+
paymentLogger.addLog({
|
125
|
+
key: 'GooglePay准备跳转',
|
126
|
+
value: ""
|
127
|
+
});
|
128
|
+
paymentLogger.sendLogs('GooglePay跳转成功');
|
90
129
|
window.location.href = _href;
|
91
130
|
} catch (err) {
|
131
|
+
// 记录GooglePay处理错误
|
132
|
+
paymentLogger.addLog({
|
133
|
+
key: 'GooglePay处理错误',
|
134
|
+
value: {
|
135
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " GooglePay\u5904\u7406\u5931\u8D25: ").concat((err === null || err === void 0 ? void 0 : err.message) || '未知错误'),
|
136
|
+
data: {
|
137
|
+
payGroup: payGroup,
|
138
|
+
values: values
|
139
|
+
}
|
140
|
+
}
|
141
|
+
});
|
142
|
+
paymentLogger.sendLogs('GooglePay处理失败', err);
|
92
143
|
setOpen(false);
|
93
144
|
}
|
94
|
-
case
|
145
|
+
case 17:
|
95
146
|
case "end":
|
96
147
|
return _context.stop();
|
97
148
|
}
|
@@ -6,6 +6,7 @@ import { useImperativeHandle, forwardRef, useContext } from 'react';
|
|
6
6
|
import { offlinePayment } from "./serve";
|
7
7
|
import { Context } from "../../model";
|
8
8
|
import { getPayGroupParamsFromStorage } from "../../payGroup";
|
9
|
+
import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
|
9
10
|
import "./index.less";
|
10
11
|
/**
|
11
12
|
* @title: 线下支付
|
@@ -17,9 +18,16 @@ import "./index.less";
|
|
17
18
|
* @Date: 2024-08-16 11:16
|
18
19
|
*/
|
19
20
|
var OfflinePayment = function OfflinePayment(props, ref) {
|
21
|
+
var _state$payGroup;
|
20
22
|
var _useContext = useContext(Context),
|
21
23
|
state = _useContext.state;
|
22
24
|
|
25
|
+
// OfflinePayment支付日志记录器
|
26
|
+
var paymentLogger = usePaymentLogger({
|
27
|
+
orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
|
28
|
+
step: '2'
|
29
|
+
});
|
30
|
+
|
23
31
|
/**
|
24
32
|
* @title: 初始化
|
25
33
|
* @description:
|
@@ -30,34 +38,91 @@ var OfflinePayment = function OfflinePayment(props, ref) {
|
|
30
38
|
*/
|
31
39
|
var init = /*#__PURE__*/function () {
|
32
40
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
33
|
-
var _item$params;
|
34
|
-
var payGroup, _item, params;
|
41
|
+
var payGroup, _item$params, _item$params2, _item, params;
|
35
42
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
36
43
|
while (1) switch (_context.prev = _context.next) {
|
37
44
|
case 0:
|
38
45
|
payGroup = _ref.payGroup;
|
46
|
+
_context.prev = 1;
|
47
|
+
// 记录OfflinePayment初始化开始
|
48
|
+
paymentLogger.addLog({
|
49
|
+
key: 'OfflinePayment初始化开始',
|
50
|
+
value: ""
|
51
|
+
});
|
39
52
|
_item = payGroup === null || payGroup === void 0 ? void 0 : payGroup.otherPayment; // 获取交易组信息
|
40
53
|
params = getPayGroupParamsFromStorage(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, {
|
41
54
|
order_id: payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id,
|
42
55
|
payment_method: _item === null || _item === void 0 || (_item$params = _item.params) === null || _item$params === void 0 ? void 0 : _item$params.payment_method
|
43
56
|
});
|
44
57
|
if (params) {
|
45
|
-
_context.next =
|
58
|
+
_context.next = 9;
|
46
59
|
break;
|
47
60
|
}
|
61
|
+
// 记录获取支付参数失败
|
62
|
+
paymentLogger.addLog({
|
63
|
+
key: 'OfflinePayment获取支付参数失败',
|
64
|
+
value: {
|
65
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
|
66
|
+
data: {
|
67
|
+
payGroup: payGroup
|
68
|
+
}
|
69
|
+
}
|
70
|
+
});
|
71
|
+
paymentLogger.sendLogs('OfflinePayment获取支付参数失败');
|
48
72
|
return _context.abrupt("return");
|
49
|
-
case
|
50
|
-
|
73
|
+
case 9:
|
74
|
+
// 记录获取支付参数成功
|
75
|
+
paymentLogger.addLog({
|
76
|
+
key: 'OfflinePayment获取支付参数成功',
|
77
|
+
value: ""
|
78
|
+
});
|
79
|
+
|
80
|
+
// 记录开始执行线下支付
|
81
|
+
paymentLogger.addLog({
|
82
|
+
key: 'OfflinePayment开始执行支付',
|
83
|
+
value: {
|
84
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u5F00\u59CB\u6267\u884C\u7EBF\u4E0B\u652F\u4ED8"),
|
85
|
+
data: {
|
86
|
+
params: params,
|
87
|
+
paymentMethod: _item === null || _item === void 0 || (_item$params2 = _item.params) === null || _item$params2 === void 0 ? void 0 : _item$params2.payment_method
|
88
|
+
}
|
89
|
+
}
|
90
|
+
});
|
91
|
+
|
92
|
+
// 支付
|
93
|
+
_context.next = 13;
|
51
94
|
return offlinePayment(params);
|
52
|
-
case
|
95
|
+
case 13:
|
96
|
+
// 记录支付成功
|
97
|
+
paymentLogger.addLog({
|
98
|
+
key: 'OfflinePayment支付成功',
|
99
|
+
value: ""
|
100
|
+
});
|
101
|
+
paymentLogger.sendLogs('OfflinePayment支付成功');
|
53
102
|
state.payCallback({
|
54
103
|
key: 'success'
|
55
104
|
});
|
56
|
-
|
105
|
+
_context.next = 22;
|
106
|
+
break;
|
107
|
+
case 18:
|
108
|
+
_context.prev = 18;
|
109
|
+
_context.t0 = _context["catch"](1);
|
110
|
+
// 记录OfflinePayment处理错误
|
111
|
+
paymentLogger.addLog({
|
112
|
+
key: 'OfflinePayment处理错误',
|
113
|
+
value: {
|
114
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " OfflinePayment\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
|
115
|
+
data: {
|
116
|
+
payGroup: payGroup
|
117
|
+
}
|
118
|
+
}
|
119
|
+
});
|
120
|
+
paymentLogger.sendLogs('OfflinePayment处理失败', _context.t0);
|
121
|
+
case 22:
|
57
122
|
case "end":
|
58
123
|
return _context.stop();
|
59
124
|
}
|
60
|
-
}, _callee);
|
125
|
+
}, _callee, null, [[1, 18]]);
|
61
126
|
}));
|
62
127
|
return function init(_x) {
|
63
128
|
return _ref2.apply(this, arguments);
|
@@ -5,6 +5,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
5
5
|
import { useImperativeHandle, forwardRef, useContext } from 'react';
|
6
6
|
import { Context } from "../../model";
|
7
7
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
8
|
+
import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
|
8
9
|
import "./index.less";
|
9
10
|
/**
|
10
11
|
* @title: StripePay
|
@@ -16,10 +17,17 @@ import "./index.less";
|
|
16
17
|
* @Date: 2024-08-16 11:17
|
17
18
|
*/
|
18
19
|
var StripePay = function StripePay(props, ref) {
|
19
|
-
var
|
20
|
-
|
20
|
+
var _state$payGroup;
|
21
|
+
var _ref = useContext(Context),
|
22
|
+
state = _ref.state;
|
21
23
|
var context = useEngineContext();
|
22
24
|
|
25
|
+
// StripePay支付日志记录器
|
26
|
+
var paymentLogger = usePaymentLogger({
|
27
|
+
orderId: (state === null || state === void 0 || (_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
|
28
|
+
step: '2'
|
29
|
+
});
|
30
|
+
|
23
31
|
/**
|
24
32
|
* @title: 初始化
|
25
33
|
* @description:
|
@@ -29,19 +37,42 @@ var StripePay = function StripePay(props, ref) {
|
|
29
37
|
* @Date: 2024-08-16 11:17
|
30
38
|
*/
|
31
39
|
var init = /*#__PURE__*/function () {
|
32
|
-
var
|
33
|
-
var payGroup, _context$appHelper, _item, platform;
|
40
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
41
|
+
var payGroup, _context$appHelper, _item, platform, redirectUrl;
|
34
42
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
35
43
|
while (1) switch (_context.prev = _context.next) {
|
36
44
|
case 0:
|
37
|
-
payGroup =
|
38
|
-
|
45
|
+
payGroup = _ref2.payGroup;
|
46
|
+
// 记录StripePay初始化开始
|
47
|
+
paymentLogger.addLog({
|
48
|
+
key: 'StripePay初始化开始',
|
49
|
+
value: ""
|
50
|
+
});
|
51
|
+
_context.prev = 2;
|
39
52
|
_item = payGroup === null || payGroup === void 0 ? void 0 : payGroup.otherPayment;
|
40
|
-
platform = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.platform) || 'h5'; //
|
53
|
+
platform = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.platform) || 'h5'; // 记录平台信息
|
54
|
+
paymentLogger.addLog({
|
55
|
+
key: 'StripePay平台检测',
|
56
|
+
value: {
|
57
|
+
platform: platform,
|
58
|
+
paymentItem: _item
|
59
|
+
}
|
60
|
+
});
|
61
|
+
|
62
|
+
// pc打开弹窗
|
41
63
|
if (!(platform === 'pc')) {
|
42
|
-
_context.next =
|
64
|
+
_context.next = 11;
|
43
65
|
break;
|
44
66
|
}
|
67
|
+
// 记录PC端回调准备
|
68
|
+
paymentLogger.addLog({
|
69
|
+
key: 'StripePay PC端回调准备',
|
70
|
+
value: {
|
71
|
+
service: _item.service,
|
72
|
+
orderId: payGroup.order_id,
|
73
|
+
paymentMethod: _item.title
|
74
|
+
}
|
75
|
+
});
|
45
76
|
state.payCallback({
|
46
77
|
key: _item.service,
|
47
78
|
data: {
|
@@ -49,23 +80,43 @@ var StripePay = function StripePay(props, ref) {
|
|
49
80
|
payment_method: _item.title
|
50
81
|
}
|
51
82
|
});
|
83
|
+
paymentLogger.sendLogs('StripePay PC端回调成功');
|
52
84
|
return _context.abrupt("return");
|
53
|
-
case
|
85
|
+
case 11:
|
54
86
|
// h5跳转页面
|
55
|
-
|
56
|
-
|
87
|
+
redirectUrl = "/pay/stripe?order_id=".concat(payGroup.order_id, "&payment_method=").concat(encodeURIComponent(_item.title)); // 记录H5端跳转准备
|
88
|
+
paymentLogger.addLog({
|
89
|
+
key: 'StripePay H5端跳转准备',
|
90
|
+
value: {
|
91
|
+
redirectUrl: redirectUrl
|
92
|
+
}
|
93
|
+
});
|
94
|
+
state.history.push(redirectUrl);
|
95
|
+
paymentLogger.sendLogs('StripePay H5端跳转成功');
|
96
|
+
_context.next = 21;
|
57
97
|
break;
|
58
|
-
case
|
59
|
-
_context.prev =
|
60
|
-
_context.t0 = _context["catch"](
|
61
|
-
|
98
|
+
case 17:
|
99
|
+
_context.prev = 17;
|
100
|
+
_context.t0 = _context["catch"](2);
|
101
|
+
// 记录StripePay处理错误
|
102
|
+
paymentLogger.addLog({
|
103
|
+
key: 'StripePay处理错误',
|
104
|
+
value: {
|
105
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " StripePay\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
|
106
|
+
data: {
|
107
|
+
payGroup: payGroup
|
108
|
+
}
|
109
|
+
}
|
110
|
+
});
|
111
|
+
paymentLogger.sendLogs('StripePay处理失败', _context.t0);
|
112
|
+
case 21:
|
62
113
|
case "end":
|
63
114
|
return _context.stop();
|
64
115
|
}
|
65
|
-
}, _callee, null, [[
|
116
|
+
}, _callee, null, [[2, 17]]);
|
66
117
|
}));
|
67
118
|
return function init(_x) {
|
68
|
-
return
|
119
|
+
return _ref3.apply(this, arguments);
|
69
120
|
};
|
70
121
|
}();
|
71
122
|
useImperativeHandle(ref, function () {
|
@@ -17,6 +17,7 @@ import { Context } from "../../model";
|
|
17
17
|
import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
|
18
18
|
import "./index.less";
|
19
19
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
20
|
+
import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
|
20
21
|
import { clientPayment } from "../../utils";
|
21
22
|
/**
|
22
23
|
* @title: 支付宝支付
|
@@ -26,7 +27,7 @@ import { clientPayment } from "../../utils";
|
|
26
27
|
* @Date: 2024-08-16 11:18
|
27
28
|
*/
|
28
29
|
var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
29
|
-
var _context$appHelper;
|
30
|
+
var _context$appHelper, _state$payGroup;
|
30
31
|
var _useContext = useContext(Context),
|
31
32
|
state = _useContext.state;
|
32
33
|
var onChange = props.onChange;
|
@@ -42,6 +43,12 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
42
43
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
43
44
|
interaction = _context$appHelper$ut.interaction;
|
44
45
|
|
46
|
+
// SuperPayAliPayH5支付日志记录器
|
47
|
+
var paymentLogger = usePaymentLogger({
|
48
|
+
orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
|
49
|
+
step: '2'
|
50
|
+
});
|
51
|
+
|
45
52
|
/**
|
46
53
|
* @title: 初始化
|
47
54
|
* @description:
|
@@ -58,52 +65,117 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
58
65
|
while (1) switch (_context.prev = _context.next) {
|
59
66
|
case 0:
|
60
67
|
payGroup = _ref.payGroup;
|
68
|
+
// 记录SuperPayAliPayH5初始化开始
|
69
|
+
paymentLogger.addLog({
|
70
|
+
key: 'SuperPayAliPayH5初始化开始',
|
71
|
+
value: ""
|
72
|
+
});
|
73
|
+
|
61
74
|
// 交易组
|
62
75
|
values = getPayGroupParamsFromStorage(payGroup.order_id);
|
63
76
|
if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils))) {
|
64
|
-
_context.next =
|
77
|
+
_context.next = 7;
|
65
78
|
break;
|
66
79
|
}
|
80
|
+
// 记录App环境检测
|
81
|
+
paymentLogger.addLog({
|
82
|
+
key: 'SuperPayAliPayH5App环境检测',
|
83
|
+
value: "检测到App环境,调用客户端支付"
|
84
|
+
});
|
85
|
+
paymentLogger.sendLogs('SuperPayAliPayH5App环境支付');
|
67
86
|
return _context.abrupt("return", clientPayment({
|
68
87
|
order_id: payGroup.order_id,
|
69
88
|
type: 'aliPay',
|
70
89
|
values: values,
|
71
90
|
interaction: interaction
|
72
91
|
}));
|
73
|
-
case
|
92
|
+
case 7:
|
74
93
|
setOpen(true);
|
75
94
|
if (values) {
|
76
|
-
_context.next =
|
95
|
+
_context.next = 13;
|
77
96
|
break;
|
78
97
|
}
|
98
|
+
// 记录获取支付参数失败
|
99
|
+
paymentLogger.addLog({
|
100
|
+
key: 'SuperPayAliPayH5获取支付参数失败',
|
101
|
+
value: {
|
102
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
|
103
|
+
data: {
|
104
|
+
payGroup: payGroup
|
105
|
+
}
|
106
|
+
}
|
107
|
+
});
|
108
|
+
paymentLogger.sendLogs('SuperPayAliPayH5获取支付参数失败');
|
79
109
|
setOpen(false);
|
80
110
|
return _context.abrupt("return");
|
81
|
-
case
|
82
|
-
|
83
|
-
|
111
|
+
case 13:
|
112
|
+
// 记录获取支付参数成功
|
113
|
+
paymentLogger.addLog({
|
114
|
+
key: 'SuperPayAliPayH5获取支付参数成功',
|
115
|
+
value: ""
|
116
|
+
});
|
117
|
+
_context.prev = 14;
|
118
|
+
_context.next = 17;
|
84
119
|
return getAliPayUrl(payGroup.order_id, values);
|
85
|
-
case
|
120
|
+
case 17:
|
86
121
|
data = _context.sent;
|
87
122
|
if (data !== null && data !== void 0 && data.pay_url) {
|
123
|
+
// 记录获取支付宝支付链接成功
|
124
|
+
paymentLogger.addLog({
|
125
|
+
key: 'SuperPayAliPayH5获取支付链接成功',
|
126
|
+
value: ""
|
127
|
+
});
|
128
|
+
|
88
129
|
// 设置交易号
|
89
130
|
setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
|
90
131
|
setShowSuccessBackButton(true);
|
132
|
+
|
133
|
+
// 记录即将跳转到支付宝
|
134
|
+
paymentLogger.addLog({
|
135
|
+
key: 'SuperPayAliPayH5准备跳转支付宝',
|
136
|
+
value: ""
|
137
|
+
});
|
138
|
+
paymentLogger.sendLogs('SuperPayAliPayH5跳转成功');
|
139
|
+
|
91
140
|
// 跳转
|
92
141
|
window.location.href = data === null || data === void 0 ? void 0 : data.pay_url;
|
93
142
|
} else {
|
143
|
+
// 记录支付链接为空
|
144
|
+
paymentLogger.addLog({
|
145
|
+
key: 'SuperPayAliPayH5支付链接为空',
|
146
|
+
value: {
|
147
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u652F\u4ED8\u5B9D\u652F\u4ED8\u94FE\u63A5\u4E3A\u7A7A"),
|
148
|
+
data: {
|
149
|
+
response_data: data
|
150
|
+
}
|
151
|
+
}
|
152
|
+
});
|
153
|
+
paymentLogger.sendLogs('SuperPayAliPayH5支付链接为空');
|
94
154
|
setOpen(false);
|
95
155
|
}
|
96
|
-
_context.next =
|
156
|
+
_context.next = 26;
|
97
157
|
break;
|
98
|
-
case
|
99
|
-
_context.prev =
|
100
|
-
_context.t0 = _context["catch"](
|
158
|
+
case 21:
|
159
|
+
_context.prev = 21;
|
160
|
+
_context.t0 = _context["catch"](14);
|
161
|
+
// 记录SuperPayAliPayH5处理错误
|
162
|
+
paymentLogger.addLog({
|
163
|
+
key: 'SuperPayAliPayH5处理错误',
|
164
|
+
value: {
|
165
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " SuperPayAliPayH5\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
|
166
|
+
data: {
|
167
|
+
payGroup: payGroup,
|
168
|
+
values: values
|
169
|
+
}
|
170
|
+
}
|
171
|
+
});
|
172
|
+
paymentLogger.sendLogs('SuperPayAliPayH5处理失败', _context.t0);
|
101
173
|
setOpen(false);
|
102
|
-
case
|
174
|
+
case 26:
|
103
175
|
case "end":
|
104
176
|
return _context.stop();
|
105
177
|
}
|
106
|
-
}, _callee, null, [[
|
178
|
+
}, _callee, null, [[14, 21]]);
|
107
179
|
}));
|
108
180
|
return function init(_x) {
|
109
181
|
return _ref2.apply(this, arguments);
|