mirror of
https://gitee.com/bootx/dax-pay-ui
synced 2026-08-12 07:25:39 +08:00
feat(lakala): 服务商配置优化(证书格式标注+orgCode必填+移除sandbox开关)
This commit is contained in:
@@ -8,28 +8,39 @@
|
||||
"enable": "Enable",
|
||||
"lklAppId": "Lakala Application ID",
|
||||
"lklAppIdPlaceholder": "Please enter Lakala application ID",
|
||||
"orgCode": "Organization Code",
|
||||
"orgCodePlaceholder": "Please enter organization code",
|
||||
"mchSerialNo": "Merchant Certificate Serial Number",
|
||||
"mchSerialNoPlaceholder": "Please enter merchant certificate serial number",
|
||||
"privateKey": "Private Key Certificate",
|
||||
"publicKey": "Public Key Certificate",
|
||||
"sm4Key": "SM4 Key",
|
||||
"privateKey": "Private Key Certificate (.pem)",
|
||||
"privateKeyTooltip": "The private_key.pem file provided by Lakala",
|
||||
"publicKey": "Lakala Public Key (.cer)",
|
||||
"publicKeyTooltip": "The publicKey.cer file provided by Lakala",
|
||||
"sm4Key": "Lakala SM4 Key",
|
||||
"sm4KeyPlaceholder": "Please enter SM4 key (for onboarding sensitive fields, optional)",
|
||||
"uploadPublicKey": "Upload Public Key Certificate",
|
||||
"uploadPrivateKey": "Upload Private Key Certificate",
|
||||
"uploadKey": "Upload Private Key",
|
||||
"sandbox": "Sandbox Environment",
|
||||
"sandboxOn": "Sandbox",
|
||||
"sandboxOff": "Production",
|
||||
"uploadPublicKey": "Upload Public Key Cert",
|
||||
"uploadPrivateKey": "Upload Private Key Cert",
|
||||
"uploadKey": "Upload Private Key Cert",
|
||||
"cardMchKey": "ISV Key",
|
||||
"cardMchKeyDesc": "Configure Lakala ISV application ID, private/public key certificates",
|
||||
"validation": {
|
||||
"enable": "Please select whether to enable",
|
||||
"lklAppId": "Please enter Lakala application ID",
|
||||
"orgCode": "Please enter organization code",
|
||||
"mchSerialNo": "Please enter merchant certificate serial number",
|
||||
"privateKey": "Please upload private key certificate",
|
||||
"publicKey": "Please upload public key certificate",
|
||||
"termNo": "Please enter terminal number"
|
||||
"publicKey": "Please upload Lakala public key",
|
||||
"termNo": "Please enter terminal number",
|
||||
"lakalaMchNo": "Please enter Lakala merchant number"
|
||||
},
|
||||
"termNo": "Terminal No",
|
||||
"termNoPlaceholder": "Please enter terminal number"
|
||||
"termNoPlaceholder": "Please enter terminal number",
|
||||
"lakalaMchNo": "Lakala Merchant No",
|
||||
"lakalaMchNoPlaceholder": "Please enter Lakala merchant number",
|
||||
"businessContent": "Business Content",
|
||||
"businessContentPlaceholder": "Please select business content",
|
||||
"groupMchConfig": "Merchant Config",
|
||||
"cardMchConfig": "Merchant Config",
|
||||
"cardMchConfigDesc": "Configure terminal number for channel merchant",
|
||||
"mchConfigTitle": "Merchant Config"
|
||||
}
|
||||
|
||||
@@ -6,32 +6,41 @@
|
||||
"keyConfig": "密钥配置",
|
||||
"advancedConfig": "高级配置",
|
||||
"enable": "是否启用",
|
||||
"lklAppId": "拉卡拉应用编号",
|
||||
"lklAppIdPlaceholder": "请输入拉卡拉应用编号",
|
||||
"lklAppId": "拉卡拉应用号",
|
||||
"lklAppIdPlaceholder": "请输入拉卡拉应用号",
|
||||
"orgCode": "机构代码",
|
||||
"orgCodePlaceholder": "请输入机构代码",
|
||||
"mchSerialNo": "商户证书序列号",
|
||||
"mchSerialNoPlaceholder": "请输入商户证书序列号",
|
||||
"privateKey": "私钥证书",
|
||||
"publicKey": "公钥证书",
|
||||
"sm4Key": "SM4密钥",
|
||||
"privateKey": "私钥证书(.pem格式)",
|
||||
"privateKeyTooltip": "拉卡拉提供的 private_key.pem 文件",
|
||||
"publicKey": "拉卡拉公钥(.cer格式)",
|
||||
"publicKeyTooltip": "拉卡拉提供的 publicKey.cer 文件",
|
||||
"sm4Key": "拉卡拉SM4密钥",
|
||||
"sm4KeyPlaceholder": "请输入SM4密钥(进件敏感字段加密用, 选填)",
|
||||
"uploadPublicKey": "上传公钥证书",
|
||||
"uploadPrivateKey": "上传私钥证书",
|
||||
"uploadKey": "上传私钥",
|
||||
"sandbox": "沙箱环境",
|
||||
"sandboxOn": "沙箱",
|
||||
"sandboxOff": "生产",
|
||||
"uploadPublicKey": "公钥证书上传",
|
||||
"uploadPrivateKey": "私钥证书上传",
|
||||
"uploadKey": "私钥证书上传",
|
||||
"cardMchKey": "服务商密钥",
|
||||
"cardMchKeyDesc": "配置拉卡拉服务商应用编号、私钥公钥证书",
|
||||
"cardMchKeyDesc": "配置拉卡拉服务商应用号、私钥公钥证书",
|
||||
"validation": {
|
||||
"enable": "请选择是否启用",
|
||||
"lklAppId": "请输入拉卡拉应用编号",
|
||||
"lklAppId": "请输入拉卡拉应用号",
|
||||
"orgCode": "请输入机构代码",
|
||||
"mchSerialNo": "请输入商户证书序列号",
|
||||
"privateKey": "请上传私钥证书",
|
||||
"publicKey": "请上传公钥证书",
|
||||
"termNo": "请输入终端号"
|
||||
"publicKey": "请上传拉卡拉公钥",
|
||||
"termNo": "请输入终端号",
|
||||
"lakalaMchNo": "请输入拉卡拉商户编号"
|
||||
},
|
||||
"termNo": "终端号",
|
||||
"termNoPlaceholder": "请输入终端号",
|
||||
"lakalaMchNo": "拉卡拉商户编号",
|
||||
"lakalaMchNoPlaceholder": "请输入拉卡拉商户编号",
|
||||
"businessContent": "经营内容",
|
||||
"businessContentPlaceholder": "请选择经营内容"
|
||||
"businessContentPlaceholder": "请选择经营内容",
|
||||
"groupMchConfig": "商户配置",
|
||||
"cardMchConfig": "商户配置",
|
||||
"cardMchConfigDesc": "配置通道商户终端号",
|
||||
"mchConfigTitle": "商户配置"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import { useFormEdit } from '#/hooks/useFormEdit';
|
||||
import { useMessage } from '#/hooks/useMessage';
|
||||
import { usePermission } from '#/hooks/usePermission';
|
||||
import { readFileAsBase64 } from '#/utils/file';
|
||||
import { readFileAsText } from '#/utils/file';
|
||||
|
||||
defineOptions({ name: 'LakalaIsvConfigEdit' });
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
const rules = {
|
||||
lklAppId: [{ required: true, message: $t('payment.channel.lakalaIsv.validation.lklAppId') }],
|
||||
orgCode: [{ required: true, message: $t('payment.channel.lakalaIsv.validation.orgCode') }],
|
||||
mchSerialNo: [{ required: true, message: $t('payment.channel.lakalaIsv.validation.mchSerialNo') }],
|
||||
privateKey: [{ required: true, message: $t('payment.channel.lakalaIsv.validation.privateKey') }],
|
||||
publicKey: [{ required: true, message: $t('payment.channel.lakalaIsv.validation.publicKey') }],
|
||||
};
|
||||
@@ -71,12 +73,9 @@
|
||||
...diffForm(
|
||||
rawForm,
|
||||
form.value,
|
||||
'lklAppId',
|
||||
'mchSerialNo',
|
||||
'privateKey',
|
||||
'publicKey',
|
||||
'sm4Key',
|
||||
'sandbox',
|
||||
),
|
||||
product: ProductEnum.LAKALA_PAY,
|
||||
})
|
||||
@@ -94,7 +93,7 @@
|
||||
function handleUpload(info: { file: File }, fieldName: string) {
|
||||
const file = info.file;
|
||||
if (!file) return;
|
||||
readFileAsBase64(file).then((content) => {
|
||||
readFileAsText(file).then((content) => {
|
||||
(form.value as Record<string, any>)[fieldName] = content;
|
||||
message.success($t('components.upload.uploadSuccess', { name: file.name }));
|
||||
formRef.value?.validateFields(fieldName);
|
||||
@@ -139,6 +138,16 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.orgCode')" name="orgCode">
|
||||
<a-input
|
||||
v-model:value="form.orgCode"
|
||||
:disabled="!canEdit"
|
||||
:placeholder="$t('payment.channel.lakalaIsv.orgCodePlaceholder')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-divider orientation="left">{{ $t('payment.channel.lakalaIsv.keyConfig') }}</a-divider>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.mchSerialNo')" name="mchSerialNo">
|
||||
<a-input
|
||||
v-model:value="form.mchSerialNo"
|
||||
@@ -147,15 +156,45 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-divider orientation="left">{{ $t('payment.channel.lakalaIsv.keyConfig') }}</a-divider>
|
||||
<a-form-item
|
||||
:label="$t('payment.channel.lakalaIsv.publicKey')"
|
||||
name="publicKey"
|
||||
:tooltip="$t('payment.channel.lakalaIsv.publicKeyTooltip')"
|
||||
>
|
||||
<a-upload
|
||||
v-if="!form.publicKey"
|
||||
:disabled="!canEdit"
|
||||
:multiple="false"
|
||||
:show-upload-list="false"
|
||||
accept=".cer"
|
||||
:before-upload="() => false"
|
||||
@change="(info: any) => handleUpload(info, 'publicKey')"
|
||||
>
|
||||
<a-button :disabled="!canEdit">
|
||||
<template #icon><IconifyIcon icon="ant-design:upload-outlined" class="text-lg" /></template>
|
||||
{{ $t('payment.channel.lakalaIsv.uploadPublicKey') }}
|
||||
</a-button>
|
||||
</a-upload>
|
||||
<a-input v-else value="publicKey.cer" disabled>
|
||||
<template #suffix>
|
||||
<span v-if="canEdit" class="cursor-pointer text-gray-400" @click="form.publicKey = ''">
|
||||
<IconifyIcon icon="ant-design:close-circle-outlined" class="text-lg" />
|
||||
</span>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.privateKey')" name="privateKey">
|
||||
<a-form-item
|
||||
:label="$t('payment.channel.lakalaIsv.privateKey')"
|
||||
name="privateKey"
|
||||
:tooltip="$t('payment.channel.lakalaIsv.privateKeyTooltip')"
|
||||
>
|
||||
<a-upload
|
||||
v-if="!form.privateKey"
|
||||
:disabled="!canEdit"
|
||||
:multiple="false"
|
||||
:show-upload-list="false"
|
||||
accept=".pem,.key,.txt"
|
||||
accept=".pem"
|
||||
:before-upload="() => false"
|
||||
@change="(info: any) => handleUpload(info, 'privateKey')"
|
||||
>
|
||||
@@ -173,32 +212,6 @@
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.publicKey')" name="publicKey">
|
||||
<a-upload
|
||||
v-if="!form.publicKey"
|
||||
:disabled="!canEdit"
|
||||
:multiple="false"
|
||||
:show-upload-list="false"
|
||||
accept=".pem,.cer,.crt,.txt"
|
||||
:before-upload="() => false"
|
||||
@change="(info: any) => handleUpload(info, 'publicKey')"
|
||||
>
|
||||
<a-button :disabled="!canEdit">
|
||||
<template #icon><IconifyIcon icon="ant-design:upload-outlined" class="text-lg" /></template>
|
||||
{{ $t('payment.channel.lakalaIsv.uploadPublicKey') }}
|
||||
</a-button>
|
||||
</a-upload>
|
||||
<a-input v-else value="lakala_public_key.pem" disabled>
|
||||
<template #suffix>
|
||||
<span v-if="canEdit" class="cursor-pointer text-gray-400" @click="form.publicKey = ''">
|
||||
<IconifyIcon icon="ant-design:close-circle-outlined" class="text-lg" />
|
||||
</span>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-divider orientation="left">{{ $t('payment.channel.lakalaIsv.advancedConfig') }}</a-divider>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.sm4Key')" name="sm4Key">
|
||||
<a-input
|
||||
v-model:value="form.sm4Key"
|
||||
@@ -206,15 +219,6 @@
|
||||
:placeholder="$t('payment.channel.lakalaIsv.sm4KeyPlaceholder')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="$t('payment.channel.lakalaIsv.sandbox')" name="sandbox">
|
||||
<a-switch
|
||||
v-model:checked="form.sandbox"
|
||||
:disabled="!canEdit"
|
||||
:checked-children="$t('payment.channel.lakalaIsv.sandboxOn')"
|
||||
:un-checked-children="$t('payment.channel.lakalaIsv.sandboxOff')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user