|
@@ -50,7 +50,8 @@ export class KycOpenService extends BaseService {
|
|
|
userId: kyc.mchId,
|
|
|
kycUserId: kyc.userId,
|
|
|
country: kyc.country,
|
|
|
- level: kyc.level
|
|
|
+ level: kyc.level,
|
|
|
+ email: kyc.email
|
|
|
}
|
|
|
}
|
|
|
const outUserId = md5(payload.mchId + '_' + payload.userId + 'v2');
|
|
@@ -62,7 +63,8 @@ export class KycOpenService extends BaseService {
|
|
|
kycUserId: data.kycUserId,
|
|
|
customerId: data.customerId,
|
|
|
level: '1',
|
|
|
- country: data.countryCode
|
|
|
+ country: data.countryCode,
|
|
|
+ email: data.customerEmail
|
|
|
}
|
|
|
await this.kycEntity.insert(kyc)
|
|
|
return {
|
|
@@ -70,6 +72,7 @@ export class KycOpenService extends BaseService {
|
|
|
userId: newKyc.mchId,
|
|
|
kycUserId: newKyc.userId,
|
|
|
country: newKyc.country,
|
|
|
+ email: newKyc.email,
|
|
|
level: newKyc.level
|
|
|
}
|
|
|
} catch (err) {
|
|
@@ -229,6 +232,10 @@ export class KycOpenService extends BaseService {
|
|
|
if (kyc) {
|
|
|
throw new Error('当前客户ID已存在,请勿重复提交');
|
|
|
}
|
|
|
+ const emailKyc = await this.kycEntity.findOneBy({ email: payload.email });
|
|
|
+ if (emailKyc) {
|
|
|
+ throw new CoolCommException('邮箱已被使用');
|
|
|
+ }
|
|
|
const outUserId = md5(payload.mchId + '_' + payload.userId + 'v2');
|
|
|
const { customerId } = await this.sunPayService.createBasic({
|
|
|
outUserId,
|