From 9ab99c1d08d03048329176b575e0aacefa33c8a0 Mon Sep 17 00:00:00 2001 From: nonz250 Date: Mon, 11 Nov 2024 15:37:37 +0900 Subject: [PATCH] feat: add token tds_finish. --- src/token.ts | 4 ++++ test/token.spec.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/token.ts b/src/token.ts index fc9ab94..6cd1f52 100644 --- a/src/token.ts +++ b/src/token.ts @@ -18,4 +18,8 @@ export default class Tokens extends Resource { return this.request('GET', `${this.resource}/${id}`); } + tds_finish(id: string): Promise { + return this.request('POST', `${this.resource}/${id}/tds_finish`); + } + } diff --git a/test/token.spec.js b/test/token.spec.js index 869ae2e..72a8d39 100644 --- a/test/token.spec.js +++ b/test/token.spec.js @@ -28,4 +28,13 @@ describe('Tokens Resource', () => { }); }); + describe('tds_finish', () => { + it('Sends the correct request', () => { + return payjp.tokens.tds_finish('id123').then(([_method, _endpoint]) => { + assert(_method === 'POST'); + assert(_endpoint === 'tokens/id123/tds_finish'); + }); + }); + }); + });