Skip to content

Commit

Permalink
feat(verify 2): added missing fraud check parameter (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
manchuck authored May 23, 2023
1 parent 365d4b8 commit c93bc3d
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
80 changes: 80 additions & 0 deletions packages/verify2/__tests__/__dataSets__/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
1 change: 1 addition & 0 deletions packages/verify2/lib/types/verifcationRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions packages/verify2/lib/types/verifcationRequestParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export type VerificationRequestParams = {
channelTimeout?: number
clientRef?: string
codeLength?: 4 | 5 | 6 | 7 | 8 | 9 | 10
fraudCheck?: boolean
}

0 comments on commit c93bc3d

Please sign in to comment.