Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add id to create token request #205

Merged
merged 1 commit into from Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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