()
| 239 | }; |
| 240 | |
| 241 | const stripePreTopUp = async () => { |
| 242 | if (!enableStripeTopUp) { |
| 243 | showError(t('管理员未开启在线充值!')); |
| 244 | return; |
| 245 | } |
| 246 | setPayWay('stripe'); |
| 247 | setPaymentLoading(true); |
| 248 | try { |
| 249 | await getStripeAmount(); |
| 250 | if (stripeTopUpCount < stripeMinTopUp) { |
| 251 | showError(t('充值数量不能小于') + stripeMinTopUp); |
| 252 | return; |
| 253 | } |
| 254 | setStripeOpen(true); |
| 255 | } catch (error) { |
| 256 | showError(t('获取金额失败')); |
| 257 | } finally { |
| 258 | setPaymentLoading(false); |
| 259 | } |
| 260 | }; |
| 261 | |
| 262 | const onlineStripeTopUp = async () => { |
| 263 | if (stripeAmount === 0) { |
no test coverage detected