commit 80d05cd048b92c1bbcda3b3a00946cc978974058
parent 2a283209602f1f4acaba942b9910041c35a1906d
Author: Florian Dold <florian@dold.me>
Date: Thu, 27 Nov 2025 13:30:22 +0100
harness: also request accounts as xls
Diffstat:
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-tops-aml-pdf.ts b/packages/taler-harness/src/integrationtests/test-tops-aml-pdf.ts
@@ -67,12 +67,27 @@ export async function runTopsAmlPdfTest(t: GlobalTestState) {
{
const res = succeedOrThrow(
- await exchangeClient.getAmlAccountsAsCsv(officerAcc),
+ await exchangeClient.getAmlAccountsAsOtherFormat(
+ officerAcc,
+ "application/pdf",
+ ),
);
const f = t.testDir + `/accounts.csv`;
fs.writeFileSync(f, Buffer.from(res));
console.log(`written to ${f}`);
}
+
+ {
+ const res = succeedOrThrow(
+ await exchangeClient.getAmlAccountsAsOtherFormat(
+ officerAcc,
+ "application/vnd.ms-excel",
+ ),
+ );
+ const f = t.testDir + `/accounts.xls`;
+ fs.writeFileSync(f, Buffer.from(res));
+ console.log(`written to ${f}`);
+ }
}
runTopsAmlPdfTest.suites = ["wallet"];
diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts
@@ -1171,8 +1171,9 @@ export class TalerExchangeHttpClient {
}
}
- async getAmlAccountsAsCsv(
+ async getAmlAccountsAsOtherFormat(
auth: OfficerAccount,
+ mime: string,
): Promise<
| OperationOk<ArrayBuffer>
| OperationFail<
@@ -1186,7 +1187,7 @@ export class TalerExchangeHttpClient {
const resp = await this.fetch(url, {
headers: {
- Accept: "text/csv",
+ Accept: mime,
"Taler-AML-Officer-Signature": encodeCrock(
signAmlQuery(auth.signingKey),
),