Skip to content

Commit

Permalink
feat: add id to create token request (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 committed Jun 30, 2022
1 parent 4834bfd commit 087e326
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/types/models/tokens.ts
Expand Up @@ -65,6 +65,7 @@ type CreateToken<DataType = Primitive> = Pick<
| 'mask'
> & {
deduplicateToken?: boolean;
id?: string;
};

type UpdateToken<DataType = Primitive> = Partial<
Expand Down
3 changes: 2 additions & 1 deletion test/tokenize.test.ts
Expand Up @@ -41,6 +41,7 @@ describe('Tokenize', () => {
first_name: chance.string(),
last_name: chance.string(),
card: {
id: chance.string(),
type: 'card',
data: {
number: chance.string(),
Expand Down Expand Up @@ -78,7 +79,7 @@ describe('Tokenize', () => {
first_name: chance.guid(),
last_name: chance.guid(),
card: {
id: chance.guid(),
id: chance.string(),
type: 'card',
data: {
number: chance.string(),
Expand Down
2 changes: 1 addition & 1 deletion test/tokens.test.ts
Expand Up @@ -581,6 +581,7 @@ describe('Tokens', () => {

/* eslint-disable camelcase */
const createPayload: CreateToken = {
id: _chance.string(),
type: 'token',
data: {
camelCaseParameter: _chance.string(),
Expand Down Expand Up @@ -614,7 +615,6 @@ describe('Tokens', () => {
const _chance = new Chance();
const expectedContentType = 'application/merge-patch+json';


test('should update a token', async () => {
const id = _chance.guid();

Expand Down

0 comments on commit 087e326

Please sign in to comment.