This commit is contained in:
9
utils/payment-attempt.js
Normal file
9
utils/payment-attempt.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export const isUnknownPaymentResult = (error) => Boolean(error?.paymentResultUnknown);
|
||||
|
||||
export const getPaymentErrorMessage = (error, fallback = '支付失败,请稍后重试') => {
|
||||
if (isUnknownPaymentResult(error)) {
|
||||
return '支付结果未知,请稍后查看订单状态';
|
||||
}
|
||||
|
||||
return error?.msg || error?.message || fallback;
|
||||
};
|
||||
Reference in New Issue
Block a user