diff options
Diffstat (limited to 'packages/taler-util/src/bank-api-client.ts')
-rw-r--r-- | packages/taler-util/src/bank-api-client.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/taler-util/src/bank-api-client.ts b/packages/taler-util/src/bank-api-client.ts index 8f51c4b90..e9f442af6 100644 --- a/packages/taler-util/src/bank-api-client.ts +++ b/packages/taler-util/src/bank-api-client.ts @@ -43,8 +43,10 @@ import { import { checkSuccessResponseOrThrow, createPlatformHttpLib, + expectSuccessResponseOrThrow, HttpRequestLibrary, readSuccessResponseJsonOrThrow, + readSuccessResponseTextOrThrow, readTalerErrorResponse, } from "@gnu-taler/taler-util/http"; @@ -437,4 +439,20 @@ export class TalerCorebankApiClient { }); await readSuccessResponseJsonOrThrow(resp, codecForAny()); } + + async abortWithdrawalOperationV2( + username: string, + wopi: WithdrawalOperationInfo, + ): Promise<void> { + const url = new URL( + `accounts/${username}/withdrawals/${wopi.withdrawal_id}/abort`, + this.baseUrl, + ); + const resp = await this.httpLib.fetch(url.href, { + method: "POST", + body: {}, + headers: this.makeAuthHeader(), + }); + await expectSuccessResponseOrThrow(resp); + } } |