Ver código fonte

kyc限制邮箱

test 7 meses atrás
pai
commit
b3a6102b48

+ 1 - 0
src/modules/dj/service/channels/sunpay.ts

@@ -377,6 +377,7 @@ export class SunPayService extends BaseService {
         'SunPay-Sign': sign
       }
     });
+    this.logger.info('查询KYC用户信息', URL, JSON.stringify(res.data));
     const { is_success, msg } = res.data;
     if (is_success && res.data && res.data.data && res.data.data.customer_id) {
       return {

+ 2 - 2
src/modules/dj/service/kyc.ts

@@ -81,7 +81,7 @@ export class KycService extends BaseService {
     if (!orderNo || !order) {
       throw new CoolCommException('Order does not exist');
     }
-    const kyc = await this.kycEntity.findOneBy({ email: payload.email });
+    const kyc = await this.kycEntity.findOneBy({ email: payload.customerEmail });
     if(kyc) {
       throw new CoolCommException('This email has already been used');
     }
@@ -94,7 +94,7 @@ export class KycService extends BaseService {
         kycUserId: payload.outUserId,
         customerId: customerId,
         level: '1',
-        email: payload.email,
+        email: payload.customerEmail,
         country: payload.countryCode
       })
       return { customerId }

+ 2 - 1
src/modules/dj/service/openKyc.ts

@@ -232,7 +232,7 @@ export class KycOpenService extends BaseService {
       if (kyc) {
         throw new Error('当前客户ID已存在,请勿重复提交');
       }
-      const emailKyc = await this.kycEntity.findOneBy({ email: payload.email });
+      const emailKyc = await this.kycEntity.findOneBy({ email: payload.customerEmail });
       if (emailKyc) {
         throw new CoolCommException('邮箱已被使用');
       }
@@ -252,6 +252,7 @@ export class KycOpenService extends BaseService {
           code: 'SUN_CARD',
           kycUserId: outUserId,
           customerId: customerId,
+          email: payload.customerEmail,
           level: '1',
           country: payload.countryCode
         })