-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): verify response types (#794)
- Loading branch information
Showing
57 changed files
with
1,132 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Command, CheckStatus } from '../../lib/enums/index'; | ||
import { | ||
VerifyCancelResponse, | ||
VerifyControlErrorResponse, | ||
} from '../../lib/interfaces/Response/index'; | ||
import { VerifyControl, VerifyControlError } from '../../lib/interfaces/index'; | ||
|
||
export default [ | ||
{ | ||
label: 'cancel a verify request', | ||
request: [ | ||
'/verify/control/json', | ||
'POST', | ||
{ | ||
api_key: '12345', | ||
api_secret: 'ABCDE', | ||
request_id: 'abcdef0123456789abcdef0123456789', | ||
cmd: 'cancel', | ||
}, | ||
], | ||
response: [ | ||
200, | ||
{ | ||
status: CheckStatus.SUCCESS, | ||
command: Command.CANCEL, | ||
} as VerifyCancelResponse, | ||
], | ||
method: 'post', | ||
clientMethod: 'cancel', | ||
parameters: ['abcdef0123456789abcdef0123456789'], | ||
expected: { | ||
status: CheckStatus.SUCCESS, | ||
command: Command.CANCEL, | ||
} as VerifyControl, | ||
}, | ||
{ | ||
label: 'cancel a verify request with an error', | ||
request: [ | ||
'/verify/control/json', | ||
'POST', | ||
{ | ||
api_key: '12345', | ||
api_secret: 'ABCDE', | ||
request_id: 'abcdef0123456789abcdef0123456789', | ||
cmd: 'cancel', | ||
}, | ||
], | ||
response: [ | ||
200, | ||
{ | ||
status: CheckStatus.THROTTLED, | ||
error_text: 'Your request is throttled', | ||
} as VerifyControlErrorResponse, | ||
], | ||
method: 'post', | ||
clientMethod: 'cancel', | ||
parameters: ['abcdef0123456789abcdef0123456789'], | ||
expected: { | ||
status: CheckStatus.THROTTLED, | ||
error_text: 'Your request is throttled', | ||
errorText: 'Your request is throttled', | ||
} as VerifyControlError, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { VerifyCheckResponse, VerifyCheck } from '../../lib/interfaces/index'; | ||
|
||
export default [ | ||
{ | ||
label: 'check a verify request', | ||
request: [ | ||
'/verify/check/json', | ||
'POST', | ||
{ | ||
api_key: '12345', | ||
api_secret: 'ABCDE', | ||
request_id: 'abcdef0123456789abcdef0123456789', | ||
code: '1234', | ||
}, | ||
], | ||
response: [ | ||
200, | ||
{ | ||
request_id: 'abcdef0123456789abcdef0123456789', | ||
event_id: '0A00000012345678', | ||
status: '0', | ||
price: '0.10000000', | ||
currency: 'EUR', | ||
estimated_price_messages_sent: '0.03330000', | ||
} as VerifyCheckResponse, | ||
], | ||
method: 'post', | ||
clientMethod: 'check', | ||
parameters: ['abcdef0123456789abcdef0123456789', '1234'], | ||
expected: { | ||
request_id: 'abcdef0123456789abcdef0123456789', | ||
requestId: 'abcdef0123456789abcdef0123456789', | ||
event_id: '0A00000012345678', | ||
eventId: '0A00000012345678', | ||
status: '0', | ||
price: '0.10000000', | ||
currency: 'EUR', | ||
estimated_price_messages_sent: '0.03330000', | ||
estimatedPriceMessagesSent: '0.03330000', | ||
} as VerifyCheck, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import checkTests from './check'; | ||
import cancelTests from './cancel'; | ||
import searchTests from './search'; | ||
import startTests from './start'; | ||
|
||
export default [ | ||
{ | ||
label: 'Verify Check', | ||
tests: checkTests, | ||
}, | ||
{ | ||
label: 'Verify Cancel', | ||
tests: cancelTests, | ||
}, | ||
{ | ||
label: 'Verify Search', | ||
tests: searchTests, | ||
}, | ||
{ | ||
label: 'Verify Start', | ||
tests: startTests, | ||
}, | ||
]; |
Oops, something went wrong.