diff --git a/packages/verify2/__tests__/__dataSets__/verify.ts b/packages/verify2/__tests__/__dataSets__/verify.ts index 605b47b2..42021409 100644 --- a/packages/verify2/__tests__/__dataSets__/verify.ts +++ b/packages/verify2/__tests__/__dataSets__/verify.ts @@ -577,6 +577,86 @@ export default [ requestId: 'cef1c266-d144-485e-8915-bd2d51b06776', }, }, + { + label: 'start request with fruad_check to true', + request: [ + '/v2/verify', + 'POST', + { + brand: 'Vonage', + fraud_check: true, + workflow: [ + { + channel: Channels.SMS, + to: '14152739164', + }, + ], + } as VerificationRequest, + ], + response: [ + 202, + { + request_id: 'cef1c266-d144-485e-8915-bd2d51b06776', + } as VerificationResponse, + ], + method: 'post', + clientMethod: 'newRequest', + parameters: [ + { + brand: 'Vonage', + fraudCheck: true, + workflow: [ + { + channel: Channels.SMS, + to: '14152739164', + } as SMSWorkflow, + ], + } as VerificationRequestParams, + ], + expected: { + requestId: 'cef1c266-d144-485e-8915-bd2d51b06776', + }, + }, + { + label: 'start request with fruad_check to false', + request: [ + '/v2/verify', + 'POST', + { + brand: 'Vonage', + fraud_check: false, + workflow: [ + { + channel: Channels.SMS, + to: '14152739164', + }, + ], + } as VerificationRequest, + ], + response: [ + 202, + { + request_id: 'cef1c266-d144-485e-8915-bd2d51b06776', + } as VerificationResponse, + ], + method: 'post', + clientMethod: 'newRequest', + parameters: [ + { + brand: 'Vonage', + fraudCheck: false, + workflow: [ + { + channel: Channels.SMS, + to: '14152739164', + } as SMSWorkflow, + ], + } as VerificationRequestParams, + ], + expected: { + requestId: 'cef1c266-d144-485e-8915-bd2d51b06776', + }, + }, { label: 'error when request returns conflict', request: [ diff --git a/packages/verify2/lib/types/verifcationRequest.ts b/packages/verify2/lib/types/verifcationRequest.ts index a0bc5eb2..95c1956d 100644 --- a/packages/verify2/lib/types/verifcationRequest.ts +++ b/packages/verify2/lib/types/verifcationRequest.ts @@ -21,4 +21,5 @@ export type VerificationRequest = { channel_timeout?: number client_ref?: string code_length?: 4 | 5 | 6 | 7 | 8 | 9 | 10 + fraud_check?: boolean } diff --git a/packages/verify2/lib/types/verifcationRequestParams.ts b/packages/verify2/lib/types/verifcationRequestParams.ts index 80b8e679..dbd6de57 100644 --- a/packages/verify2/lib/types/verifcationRequestParams.ts +++ b/packages/verify2/lib/types/verifcationRequestParams.ts @@ -21,4 +21,5 @@ export type VerificationRequestParams = { channelTimeout?: number clientRef?: string codeLength?: 4 | 5 | 6 | 7 | 8 | 9 | 10 + fraudCheck?: boolean }