对搜索返回的消息做中英双版本
This commit is contained in:
@@ -304,7 +304,8 @@ class Finance extends MobileBase
|
||||
}
|
||||
$msgEsc = htmlspecialchars($msg, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
return response('<!doctype html><html><head><meta charset="utf-8"><title>充值</title></head><body><p>' . $msgEsc . '</p></body></html>', 200, [
|
||||
$title = htmlspecialchars((string) __('Deposit'), ENT_QUOTES, 'UTF-8');
|
||||
return response('<!doctype html><html><head><meta charset="utf-8"><title>' . $title . '</title></head><body><p>' . $msgEsc . '</p></body></html>', 200, [
|
||||
'Content-Type' => 'text/html; charset=utf-8',
|
||||
]);
|
||||
}
|
||||
@@ -313,16 +314,27 @@ class Finance extends MobileBase
|
||||
$noEsc = htmlspecialchars($orderNo, ENT_QUOTES, 'UTF-8');
|
||||
$signEsc = htmlspecialchars($sign, ENT_QUOTES, 'UTF-8');
|
||||
$payChannel = is_string($order->pay_channel) ? htmlspecialchars($order->pay_channel, ENT_QUOTES, 'UTF-8') : '';
|
||||
$html = '<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>模拟支付</title></head><body style="font-family:system-ui;padding:1rem">';
|
||||
$html .= '<h2>模拟第三方收银台</h2>';
|
||||
$html .= '<p>订单号:' . $noEsc . '</p>';
|
||||
$html .= '<p>支付渠道:' . $payChannel . '</p>';
|
||||
$html .= '<p>金额(法币/标价):' . htmlspecialchars($amount, ENT_QUOTES, 'UTF-8') . ' + 赠送 ' . htmlspecialchars($bonus, ENT_QUOTES, 'UTF-8') . '(币)</p>';
|
||||
$html .= '<p>点击下方按钮即视为<strong>第三方支付成功</strong>,服务端会回调并到账。</p>';
|
||||
$tMockPay = htmlspecialchars((string) __('Mock payment'), ENT_QUOTES, 'UTF-8');
|
||||
$tCashier = htmlspecialchars((string) __('Mock third-party cashier'), ENT_QUOTES, 'UTF-8');
|
||||
$tOrderNo = htmlspecialchars((string) __('Order No'), ENT_QUOTES, 'UTF-8');
|
||||
$tPayChannel = htmlspecialchars((string) __('Pay channel'), ENT_QUOTES, 'UTF-8');
|
||||
$tAmountLabel = htmlspecialchars((string) __('Amount (fiat/pricing)'), ENT_QUOTES, 'UTF-8');
|
||||
$tBonus = htmlspecialchars((string) __('Bonus'), ENT_QUOTES, 'UTF-8');
|
||||
$tCoin = htmlspecialchars((string) __('coin'), ENT_QUOTES, 'UTF-8');
|
||||
$tHint = (string) __('Click the button below to simulate successful third-party payment; the server will callback and settle the deposit.');
|
||||
$tHintEsc = htmlspecialchars($tHint, ENT_QUOTES, 'UTF-8');
|
||||
$tConfirm = htmlspecialchars((string) __('Confirm payment (simulate success)'), ENT_QUOTES, 'UTF-8');
|
||||
|
||||
$html = '<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>' . $tMockPay . '</title></head><body style="font-family:system-ui;padding:1rem">';
|
||||
$html .= '<h2>' . $tCashier . '</h2>';
|
||||
$html .= '<p>' . $tOrderNo . ': ' . $noEsc . '</p>';
|
||||
$html .= '<p>' . $tPayChannel . ': ' . $payChannel . '</p>';
|
||||
$html .= '<p>' . $tAmountLabel . ': ' . htmlspecialchars($amount, ENT_QUOTES, 'UTF-8') . ' + ' . $tBonus . ' ' . htmlspecialchars($bonus, ENT_QUOTES, 'UTF-8') . ' (' . $tCoin . ')</p>';
|
||||
$html .= '<p>' . $tHintEsc . '</p>';
|
||||
$html .= '<form method="post" action="/api/finance/depositMockNotify" style="margin-top:1rem">';
|
||||
$html .= '<input type="hidden" name="order_no" value="' . $noEsc . '">';
|
||||
$html .= '<input type="hidden" name="sign" value="' . $signEsc . '">';
|
||||
$html .= '<button type="submit" style="padding:0.5rem 1rem">确认支付(模拟成功)</button>';
|
||||
$html .= '<button type="submit" style="padding:0.5rem 1rem">' . $tConfirm . '</button>';
|
||||
$html .= '</form></body></html>';
|
||||
|
||||
return response($html, 200, [
|
||||
@@ -373,7 +385,7 @@ class Finance extends MobileBase
|
||||
'channel_code=' . $pc
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
return $this->mobileError(2000, $e->getMessage());
|
||||
return $this->mobileError(2000, (string) __($e->getMessage()));
|
||||
}
|
||||
$fresh = DepositOrder::where('order_no', $orderNo)->find();
|
||||
if (!$fresh) {
|
||||
|
||||
Reference in New Issue
Block a user