mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
fix: make kyc run on mocks
This commit is contained in:
9001
package-lock.json
generated
9001
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ export class NeoLeapService {
|
|||||||
private readonly zodApiUrl: string;
|
private readonly zodApiUrl: string;
|
||||||
private readonly apiKey: string;
|
private readonly apiKey: string;
|
||||||
private readonly useGateway: boolean;
|
private readonly useGateway: boolean;
|
||||||
|
private readonly useKycMock: boolean;
|
||||||
private readonly institutionCode = '1100';
|
private readonly institutionCode = '1100';
|
||||||
useLocalCert: boolean;
|
useLocalCert: boolean;
|
||||||
constructor(private readonly httpService: HttpService, private readonly configService: ConfigService) {
|
constructor(private readonly httpService: HttpService, private readonly configService: ConfigService) {
|
||||||
@ -37,12 +38,13 @@ export class NeoLeapService {
|
|||||||
this.useGateway = [true, 'true'].includes(this.configService.get<boolean>('USE_GATEWAY', false));
|
this.useGateway = [true, 'true'].includes(this.configService.get<boolean>('USE_GATEWAY', false));
|
||||||
this.useLocalCert = this.configService.get<boolean>('USE_LOCAL_CERT', false);
|
this.useLocalCert = this.configService.get<boolean>('USE_LOCAL_CERT', false);
|
||||||
this.zodApiUrl = this.configService.getOrThrow<string>('ZOD_API_URL');
|
this.zodApiUrl = this.configService.getOrThrow<string>('ZOD_API_URL');
|
||||||
|
this.useKycMock = [true, 'true'].includes(this.configService.get<boolean>('USE_KYC_MOCK', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
async initiateKyc(customerId: string, body: InitiateKycRequestDto) {
|
async initiateKyc(customerId: string, body: InitiateKycRequestDto) {
|
||||||
const responseKey = 'InitiateKycResponseDetails';
|
const responseKey = 'InitiateKycResponseDetails';
|
||||||
|
|
||||||
if (!this.useGateway) {
|
if (this.useKycMock) {
|
||||||
const responseDto = plainToInstance(InitiateKycResponseDto, INITIATE_KYC_MOCK[responseKey], {
|
const responseDto = plainToInstance(InitiateKycResponseDto, INITIATE_KYC_MOCK[responseKey], {
|
||||||
excludeExtraneousValues: true,
|
excludeExtraneousValues: true,
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user