Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default {
shuftipro: {
clientId: KYC_SHUFTIPRO_CLIENT_ID,
secretKey: KYC_SHUFTIPRO_SECRET_KEY,
baseUrl: 'https://api.shuftipro.com',
baseUrl: 'https://shuftipro.com',
callbackUrl: KYC_SHUFTIPRO_CALLBACK_URL,
redirectUrl: KYC_SHUFTIPRO_REDIRECT_URL,
allowRecreateSession: (KYC_SHUFTIPRO_ALLOW_RECREATE_SESSION === 'true') || false
Expand Down
26 changes: 19 additions & 7 deletions src/entities/shuftipro.kyc.result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ export class ShuftiproKycResult {
id: ObjectID;

@Column()
statusCode?: string;
event?: string;

@Column()
message: string;
reference?: string;

@Column()
reference?: string;
token?: string;

@Column()
verificationUrl?: string;

@Column()
verificationResult?: string | null;

@Column()
verificationData?: any;

@Column()
signature?: string;
declinedReason?: any;

@Column()
error?: boolean;
Expand All @@ -28,11 +37,14 @@ export class ShuftiproKycResult {

static createShuftiproKycResult(data: ShuftiproInitResult): ShuftiproKycResult {
const kycResult = new ShuftiproKycResult();
kycResult.statusCode = data.status_code;
kycResult.message = data.message;
kycResult.event = data.event;
kycResult.token = data.token;
kycResult.reference = data.reference;
kycResult.signature = data.signature;
kycResult.verificationData = data.verification_data;
kycResult.verificationResult = data.verification_result;
kycResult.verificationUrl = data.verification_url;
kycResult.timestamp = data.timestamp;
kycResult.declinedReason = data.declined_reason;

if (data.error) {
kycResult.error = data.error;
Expand Down
48 changes: 45 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,53 @@ declare interface JumioInitResult extends KycInitResult {
}

declare interface ShuftiproInitResult extends KycInitResult {
status_code?: string;
message: string;
event?: string;
reference?: string;
signature?: string;
error?: boolean;
token?: string;
verification_url?: string;
verification_result?: any;
verification_data?: any;
declined_reason?: any;
}

declare interface ShuftiProName {
first_name: string;
last_name: string;
}

declare interface ShuftiProDocument {
supported_types: string[];
name: ShuftiProName;
dob: string;
}

declare interface ShuftiProBackgroundChecks {
name: ShuftiProName;
dob: string;
}

declare interface ShuftiProVerificationData {
reference: string;
country: string;
callback_url: string;
document: ShuftiProDocument;
background_checks: ShuftiProBackgroundChecks;
}

declare interface ShuftiProVerificationResponse {
reference: string;
event: string;
error: any;
token: string;
verification_url: string;
verification_result: number | null;
verification_data: any;
}

declare interface ShuftiProStatusResponse {
reference: string;
event: string;
}

declare interface KycScanStatus {
Expand Down
5 changes: 5 additions & 0 deletions src/ioc.container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { GatewayController } from './controllers/gateway.controller';
import { EmailTemplateService, EmailTemplateServiceType } from './services/email.template.service';
import { JumioProvider } from './providers/kyc/jumio.provider';
import { ShuftiproProvider } from './providers/kyc/shuftipro.provider';
import { ShuftiProClientInterface, ShuftiProClientType, ShuftiProClient } from './services/shuftipro.client';

let container = new Container();

Expand Down Expand Up @@ -60,6 +61,10 @@ container.bind<CoinpaymentsClientInterface>(CoinpaymentsClientType).to(Coinpayme
container.bind<PaymentsServiceInterface>(PaymentsServiceType).to(PaymentsService).inSingletonScope();
container.bind<IPNServiceInterface>(IPNServiceType).to(IPNService).inSingletonScope();
container.bind<EmailTemplateServiceInterface>(EmailTemplateServiceType).to(EmailTemplateService).inSingletonScope();
container.bind<ShuftiProClientInterface>(ShuftiProClientType).toConstantValue(new ShuftiProClient(
config.kyc.shuftipro.clientId,
config.kyc.shuftipro.secretKey
));

const auth = new Auth(container.get<AuthClientInterface>(AuthClientType));
// middlewares
Expand Down
Loading