From 8b37f6ef4987cb06b4682d5bd2cfc907fd9f8d2d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 23 May 2024 13:09:04 +0200 Subject: wallet-core: clean up logging, fix shepherd typo --- packages/taler-util/src/notifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts index d4dfe7589..a8a8c3299 100644 --- a/packages/taler-util/src/notifications.ts +++ b/packages/taler-util/src/notifications.ts @@ -128,7 +128,7 @@ export enum ObservabilityEventType { TaskStart = "task-start", TaskStop = "task-stop", TaskReset = "task-reset", - ShepherdTaskResult = "sheperd-task-result", + ShepherdTaskResult = "shepherd-task-result", DeclareTaskDependency = "declare-task-dependency", CryptoStart = "crypto-start", CryptoFinishSuccess = "crypto-finish-success", -- cgit v1.2.3 From cdcedf65595393fc186eb2012d3ae6cd55540f59 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 23 May 2024 19:50:59 +0200 Subject: wallet-core: support bank-integrated withdrawal with amount selection by wallet --- packages/taler-util/src/bank-api-client.ts | 2 +- packages/taler-util/src/http-client/types.ts | 4 ++-- packages/taler-util/src/taler-types.ts | 4 ++-- packages/taler-util/src/wallet-types.ts | 31 +++++++++++++++++++--------- 4 files changed, 26 insertions(+), 15 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/bank-api-client.ts b/packages/taler-util/src/bank-api-client.ts index e9f442af6..e1409087f 100644 --- a/packages/taler-util/src/bank-api-client.ts +++ b/packages/taler-util/src/bank-api-client.ts @@ -385,7 +385,7 @@ export class TalerCorebankApiClient { async createWithdrawalOperation( user: string, - amount: string, + amount: string | undefined, ): Promise { const url = new URL(`accounts/${user}/withdrawals`, this.baseUrl); const resp = await this.httpLib.fetch(url.href, { diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index edddf7d94..9268f6387 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -1311,7 +1311,7 @@ export const codecForBankWithdrawalOperationStatus = codecForConstString("confirmed"), ), ) - .property("amount", codecForAmountString()) + .property("amount", codecOptional(codecForAmountString())) .property("sender_wire", codecOptional(codecForPaytoString())) .property("suggested_exchange", codecOptional(codecForString())) .property("confirm_transfer_url", codecOptional(codecForURL())) @@ -2030,7 +2030,7 @@ export namespace TalerBankIntegrationApi { // Amount that will be withdrawn with this operation // (raw amount without fee considerations). - amount: AmountString; + amount: AmountString | undefined; // Bank account of the customer that is withdrawing, as a // payto URI. diff --git a/packages/taler-util/src/taler-types.ts b/packages/taler-util/src/taler-types.ts index e2536b74a..66f98ea9a 100644 --- a/packages/taler-util/src/taler-types.ts +++ b/packages/taler-util/src/taler-types.ts @@ -978,7 +978,7 @@ export class WithdrawOperationStatusResponse { aborted: boolean; - amount: string; + amount: string | undefined; sender_wire?: string; @@ -1557,7 +1557,7 @@ export const codecForWithdrawOperationStatusResponse = .property("selection_done", codecForBoolean()) .property("transfer_done", codecForBoolean()) .property("aborted", codecForBoolean()) - .property("amount", codecForString()) + .property("amount", codecOptional(codecForString())) .property("sender_wire", codecOptional(codecForString())) .property("suggested_exchange", codecOptional(codecForString())) .property("confirm_transfer_url", codecOptional(codecForString())) diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index d472af187..9301a9723 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -663,11 +663,11 @@ export interface CoinDumpJson { withdrawal_reserve_pub: string | undefined; coin_status: CoinStatus; spend_allocation: - | { - id: string; - amount: AmountString; - } - | undefined; + | { + id: string; + amount: AmountString; + } + | undefined; /** * Information about the age restriction */ @@ -801,7 +801,7 @@ export const codecForPreparePayResultPaymentPossible = ) .build("PreparePayResultPaymentPossible"); -export interface BalanceDetails { } +export interface BalanceDetails {} /** * Detailed reason for why the wallet's balance is insufficient. @@ -984,7 +984,8 @@ export interface PreparePayResultAlreadyConfirmed { export interface BankWithdrawDetails { status: WithdrawalOperationStatus; - amount: AmountJson; + currency: string; + amount: AmountJson | undefined; senderWire?: string; suggestedExchange?: string; confirmTransferUrl?: string; @@ -1883,6 +1884,13 @@ export interface AcceptBankIntegratedWithdrawalRequest { talerWithdrawUri: string; exchangeBaseUrl: string; forcedDenomSel?: ForcedDenomSel; + /** + * Amount to withdraw. + * If the bank's withdrawal operation uses a fixed amount, + * this field must either be left undefined or its value must match + * the amount from the withdrawal operation. + */ + amount?: AmountString; restrictAge?: number; } @@ -1892,6 +1900,7 @@ export const codecForAcceptBankIntegratedWithdrawalRequest = .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("talerWithdrawUri", codecForString()) .property("forcedDenomSel", codecForAny()) + .property("amount", codecOptional(codecForAmountString())) .property("restrictAge", codecOptional(codecForNumber())) .build("AcceptBankIntegratedWithdrawalRequest"); @@ -2047,7 +2056,7 @@ export interface CheckPayTemplateRequest { export type CheckPayTemplateReponse = { templateDetails: TalerMerchantApi.WalletTemplateDetails; supportedCurrencies: string[]; -} +}; export const codecForCheckPayTemplateRequest = (): Codec => @@ -2352,7 +2361,8 @@ export interface WithdrawUriInfoResponse { operationId: string; status: WithdrawalOperationStatus; confirmTransferUrl?: string; - amount: AmountString; + currency: string; + amount: AmountString | undefined; defaultExchangeBaseUrl?: string; possibleExchanges: ExchangeListItem[]; } @@ -2371,7 +2381,8 @@ export const codecForWithdrawUriInfoResponse = codecForConstString("confirmed"), ), ) - .property("amount", codecForAmountString()) + .property("amount", codecOptional(codecForAmountString())) + .property("currency", codecForString()) .property("defaultExchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .property("possibleExchanges", codecForList(codecForExchangeListItem())) .build("WithdrawUriInfoResponse"); -- cgit v1.2.3 From 274b72f6ea4ac92e334b97a9cc427d64b2307217 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 23 May 2024 22:11:23 +0200 Subject: wallet-core: implement acceptBankIntegratedWithdrawal via prepare/confirm step This avoids duplication of some subtle logic. --- packages/taler-util/src/wallet-types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 9301a9723..dce811462 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1865,7 +1865,7 @@ export interface PrepareBankIntegratedWithdrawalResponse { export interface ConfirmWithdrawalRequest { transactionId: string; exchangeBaseUrl: string; - amount: AmountString; + amount?: AmountString; forcedDenomSel?: ForcedDenomSel; restrictAge?: number; } @@ -1874,7 +1874,7 @@ export const codecForConfirmWithdrawalRequestRequest = (): Codec => buildCodecForObject() .property("transactionId", codecForString()) - .property("amount", codecForAmountString()) + .property("amount", codecOptional(codecForAmountString())) .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("forcedDenomSel", codecForAny()) .property("restrictAge", codecOptional(codecForNumber())) -- cgit v1.2.3 From ec53ef04777cc1047079285538330de996e7e0f2 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 23 May 2024 22:44:52 +0200 Subject: Revert "wallet-core: implement acceptBankIntegratedWithdrawal via prepare/confirm step" This reverts commit 274b72f6ea4ac92e334b97a9cc427d64b2307217. --- packages/taler-util/src/wallet-types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index dce811462..9301a9723 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1865,7 +1865,7 @@ export interface PrepareBankIntegratedWithdrawalResponse { export interface ConfirmWithdrawalRequest { transactionId: string; exchangeBaseUrl: string; - amount?: AmountString; + amount: AmountString; forcedDenomSel?: ForcedDenomSel; restrictAge?: number; } @@ -1874,7 +1874,7 @@ export const codecForConfirmWithdrawalRequestRequest = (): Codec => buildCodecForObject() .property("transactionId", codecForString()) - .property("amount", codecOptional(codecForAmountString())) + .property("amount", codecForAmountString()) .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("forcedDenomSel", codecForAny()) .property("restrictAge", codecOptional(codecForNumber())) -- cgit v1.2.3 From a976b03cd1917d576d084726529427e709d5fe3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20=C3=81valos?= Date: Fri, 24 May 2024 12:11:59 -0600 Subject: taler-util: cancel http requests via os.fetchHttp --- packages/taler-util/src/http-impl.qtart.ts | 7 ++++++- packages/taler-util/src/qtart.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts index b4e4ebbe7..65e422168 100644 --- a/packages/taler-util/src/http-impl.qtart.ts +++ b/packages/taler-util/src/http-impl.qtart.ts @@ -118,7 +118,11 @@ export class HttpLibImpl implements HttpRequestLibrary { // Just like WHATWG fetch(), the qjs http client doesn't // really support cancellation, so cancellation here just // means that the result is ignored! - const fetchProm = qjsOs.fetchHttp(url, { + const { + requestId, + promise: fetchProm, + cancelFn + } = qjsOs.fetchHttp(url, { method, data, headers: headersList, @@ -135,6 +139,7 @@ export class HttpLibImpl implements HttpRequestLibrary { if (opt?.cancellationToken) { cancelCancelledHandler = opt.cancellationToken.onCancelled(() => { + cancelFn(requestId); cancelPromCap.reject(new RequestCancelledError()); }); } diff --git a/packages/taler-util/src/qtart.ts b/packages/taler-util/src/qtart.ts index e298a157c..373daeae7 100644 --- a/packages/taler-util/src/qtart.ts +++ b/packages/taler-util/src/qtart.ts @@ -17,7 +17,11 @@ export interface QjsHttpOptions { } export interface QjsOsLib { - fetchHttp(url: string, options?: QjsHttpOptions): Promise; + fetchHttp(url: string, options?: QjsHttpOptions): { + requestId: number, + promise: Promise, + cancelFn: (reqId: number) => number, + }; postMessageToHost(s: string): void; setMessageFromHostHandler(h: (s: string) => void): void; rename(oldPath: string, newPath: string): number; -- cgit v1.2.3 From d985c0ba04d06ebc9c584c2e17bed68350d82136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20=C3=81valos?= Date: Fri, 24 May 2024 20:48:05 -0600 Subject: taler-util: remove request id parameter from cancelFn --- packages/taler-util/src/http-impl.qtart.ts | 3 +-- packages/taler-util/src/qtart.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts index 65e422168..f60c82fc3 100644 --- a/packages/taler-util/src/http-impl.qtart.ts +++ b/packages/taler-util/src/http-impl.qtart.ts @@ -119,7 +119,6 @@ export class HttpLibImpl implements HttpRequestLibrary { // really support cancellation, so cancellation here just // means that the result is ignored! const { - requestId, promise: fetchProm, cancelFn } = qjsOs.fetchHttp(url, { @@ -139,7 +138,7 @@ export class HttpLibImpl implements HttpRequestLibrary { if (opt?.cancellationToken) { cancelCancelledHandler = opt.cancellationToken.onCancelled(() => { - cancelFn(requestId); + cancelFn(); cancelPromCap.reject(new RequestCancelledError()); }); } diff --git a/packages/taler-util/src/qtart.ts b/packages/taler-util/src/qtart.ts index 373daeae7..6a5984973 100644 --- a/packages/taler-util/src/qtart.ts +++ b/packages/taler-util/src/qtart.ts @@ -18,9 +18,8 @@ export interface QjsHttpOptions { export interface QjsOsLib { fetchHttp(url: string, options?: QjsHttpOptions): { - requestId: number, promise: Promise, - cancelFn: (reqId: number) => number, + cancelFn: () => number, }; postMessageToHost(s: string): void; setMessageFromHostHandler(h: (s: string) => void): void; -- cgit v1.2.3 From 02ceacd75fa16889925c8eda6b28f181b2ad392c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 28 May 2024 10:37:58 -0300 Subject: fix #8828 --- packages/taler-util/src/invariants.ts | 2 +- packages/taler-util/src/wallet-types.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/invariants.ts b/packages/taler-util/src/invariants.ts index c6e9b8113..113d697c3 100644 --- a/packages/taler-util/src/invariants.ts +++ b/packages/taler-util/src/invariants.ts @@ -33,7 +33,7 @@ export class InvariantViolatedError extends Error { * * A violation of this invariant means that the database is inconsistent. */ -export function checkDbInvariant(b: boolean, m?: string): asserts b { +export function checkDbInvariant(b: boolean, m: string): asserts b { if (!b) { if (m) { throw Error(`BUG: database invariant failed (${m})`); diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 9301a9723..24a48b415 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -54,7 +54,7 @@ import { canonicalizeBaseUrl, } from "./index.js"; import { VersionMatchResult } from "./libtool-version.js"; -import { PaytoUri } from "./payto.js"; +import { PaytoString, PaytoUri, codecForPaytoString } from "./payto.js"; import { AgeCommitmentProof } from "./taler-crypto.js"; import { TalerErrorCode } from "./taler-error-codes.js"; import { @@ -229,11 +229,13 @@ interface GetPlanForWalletInitiatedOperation { export interface ConvertAmountRequest { amount: AmountString; type: TransactionAmountMode; + depositPaytoUri: PaytoString; } export const codecForConvertAmountRequest = buildCodecForObject() .property("amount", codecForAmountString()) + .property("depositPaytoUri", codecForPaytoString()) .property( "type", codecForEither( -- cgit v1.2.3 From 1beb305d231e8e5632d1d3e2072c39bb74049924 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 3 Jun 2024 12:03:48 -0300 Subject: account letter --- packages/taler-util/src/payto.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts index a471d0b87..39c25cffd 100644 --- a/packages/taler-util/src/payto.ts +++ b/packages/taler-util/src/payto.ts @@ -15,7 +15,7 @@ */ import { generateFakeSegwitAddress } from "./bitcoin.js"; -import { Codec, Context, DecodingError, renderContext } from "./codec.js"; +import { Codec, Context, DecodingError, buildCodecForObject, codecForStringURL, renderContext } from "./codec.js"; import { URLSearchParams } from "./url.js"; export type PaytoUri = @@ -291,3 +291,21 @@ export function talerPaytoFromExchangeReserve( return `payto://${proto}/${url.host}${url.pathname}${reservePub}`; } + +/** + * The account letter is all the information + * the merchant backend requires from the + * bank account to check transfer. + * + */ +export type AccountLetter = { + accountURI: PaytoString; + infoURL: string; +}; + +export const codecForAccountLetter = + (): Codec => + buildCodecForObject() + .property("infoURL", codecForStringURL(true)) + .property("accountURI", codecForPaytoString()) + .build("AccountLetter"); -- cgit v1.2.3 From 228324bb4411515675930e68eece2045dcafe12a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 3 Jun 2024 12:42:53 -0300 Subject: support noContent --- packages/taler-util/src/http-client/bank-revenue.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/bank-revenue.ts b/packages/taler-util/src/http-client/bank-revenue.ts index 34afe7d86..8331856a9 100644 --- a/packages/taler-util/src/http-client/bank-revenue.ts +++ b/packages/taler-util/src/http-client/bank-revenue.ts @@ -25,6 +25,7 @@ import { LibtoolVersion } from "../libtool-version.js"; import { FailCasesByMethod, ResultByMethod, + opFixedSuccess, opKnownHttpFailure, opSuccessFromHttp, opUnknownFailure, @@ -117,6 +118,9 @@ export class TalerRevenueHttpClient { switch (resp.status) { case HttpStatusCode.Ok: return opSuccessFromHttp(resp, codecForRevenueIncomingHistory()); + // FIXME: missing in docs + case HttpStatusCode.NoContent: + return opFixedSuccess({incoming_transactions: [], credit_account: "" }); case HttpStatusCode.BadRequest: return opKnownHttpFailure(resp.status, resp); case HttpStatusCode.Unauthorized: -- cgit v1.2.3 From 920595aa3864615c07aba0ecfc233acf05f3e3e6 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 6 Jun 2024 09:24:50 -0300 Subject: update bank api with card fee --- .../taler-util/src/http-client/bank-integration.ts | 4 + packages/taler-util/src/http-client/types.ts | 35 +++++- packages/taler-util/src/taler-error-codes.ts | 124 ++++++++++++++++++++- packages/taler-util/src/wallet-types.ts | 1 + 4 files changed, 160 insertions(+), 4 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/bank-integration.ts b/packages/taler-util/src/http-client/bank-integration.ts index 75e6a627a..08dab58e2 100644 --- a/packages/taler-util/src/http-client/bank-integration.ts +++ b/packages/taler-util/src/http-client/bank-integration.ts @@ -147,6 +147,10 @@ export class TalerBankIntegrationHttpClient { return opKnownTalerFailure(details.code, details); case TalerErrorCode.BANK_ACCOUNT_IS_NOT_EXCHANGE: return opKnownTalerFailure(details.code, details); + case TalerErrorCode.BANK_AMOUNT_DIFFERS: + return opKnownTalerFailure(details.code, details); + case TalerErrorCode.BANK_AMOUNT_REQUIRED: + return opKnownTalerFailure(details.code, details); default: return opUnknownFailure(resp, details); } diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 9268f6387..94f2c7518 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -1312,6 +1312,7 @@ export const codecForBankWithdrawalOperationStatus = ), ) .property("amount", codecOptional(codecForAmountString())) + .property("card_fees", codecOptional(codecForAmountString())) .property("sender_wire", codecOptional(codecForPaytoString())) .property("suggested_exchange", codecOptional(codecForString())) .property("confirm_transfer_url", codecOptional(codecForURL())) @@ -2029,16 +2030,41 @@ export namespace TalerBankIntegrationApi { status: WithdrawalOperationStatus; // Amount that will be withdrawn with this operation - // (raw amount without fee considerations). - amount: AmountString | undefined; + // (raw amount without fee considerations). Only + // given once the amount is fixed and cannot be changed. + // Optional since **vC2EC**. + amount?: AmountString | undefined; + + // Maximum amount that the wallet can choose to withdraw. + // Only applicable when the amount is not fixed. + // @since **vC2EC**. + max_amount?: AmountString | undefined; + + // The non-Taler card fees the customer will have + // to pay to the bank / payment service provider + // they are using to make the withdrawal. + // @since **vC2EC** + card_fees?: AmountString | undefined; // Bank account of the customer that is withdrawing, as a // payto URI. sender_wire?: PaytoString; + // Suggestion for the amount to be withdrawn with this + // operation. Given if a suggestion was made but the + // user may still change the amount. + // Optional since **vC2EC**. + suggested_amount?: AmountString | undefined; + // Suggestion for an exchange given by the bank. suggested_exchange?: string; + // Base URL of an exchange that must be used. Optional, + // not given *unless* a particular exchange is mandatory. + // This value is typically set in the bank's configuration. + // @since **vC2EC** + required_exchange?: string; + // URL that the user needs to navigate to in order to // complete some final confirmation (e.g. 2FA). // It may contain withdrawal operation id @@ -2062,6 +2088,11 @@ export namespace TalerBankIntegrationApi { // Payto address of the exchange selected for the withdrawal. selected_exchange: PaytoString; + + // Selected amount to be transferred. Optional if the + // backend already knows the amount. + // @since **vC2EC** + amount?: AmountString | undefined; } export interface BankWithdrawalOperationPostResponse { diff --git a/packages/taler-util/src/taler-error-codes.ts b/packages/taler-util/src/taler-error-codes.ts index 9985e74b3..c463d94a0 100644 --- a/packages/taler-util/src/taler-error-codes.ts +++ b/packages/taler-util/src/taler-error-codes.ts @@ -354,7 +354,7 @@ export enum TalerErrorCode { /** * The backend could not locate a required template to generate an HTML reply. The system administrator should check if the resource files are installed in the correct location and are readable to the service. - * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500). + * Returned with an HTTP status code of #MHD_HTTP_NOT_ACCEPTABLE (406). * (A value of 0 indicates that the error is generated client-side). */ GENERIC_FAILED_TO_LOAD_TEMPLATE = 74, @@ -1945,7 +1945,7 @@ export enum TalerErrorCode { /** - * The payto-URI hash did not match. Hence the request was denied. + * The KYC authorization signature was invalid. Hence the request was denied. * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). * (A value of 0 indicates that the error is generated client-side). */ @@ -2016,6 +2016,22 @@ export enum TalerErrorCode { EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED = 1938, + /** + * The exchange is unaware of the given requirement row. + * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_KYC_CHECK_REQUEST_UNKNOWN = 1939, + + + /** + * The exchange has no account public key to check the KYC authorization signature against. Hence the request was denied. The user should do a wire transfer to the exchange with the KYC authorization key in the subject. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_KYC_CHECK_AUTHORIZATION_KEY_UNKNOWN = 1940, + + /** * The exchange does not know a contract under the given contract public key. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). @@ -2104,6 +2120,14 @@ export enum TalerErrorCode { MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED = 2002, + /** + * The product category is not known to the backend. + * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). + * (A value of 0 indicates that the error is generated client-side). + */ + MERCHANT_GENERIC_CATEGORY_UNKNOWN = 2003, + + /** * The proposal is not known to the backend. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). @@ -3056,6 +3080,14 @@ export enum TalerErrorCode { MERCHANT_PRIVATE_POST_PRODUCTS_CONFLICT_PRODUCT_EXISTS = 2650, + /** + * A category with the same name exists already. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + MERCHANT_PRIVATE_POST_CATEGORIES_CONFLICT_CATEGORY_EXISTS = 2651, + + /** * The update would have reduced the total amount of product lost, which is not allowed. * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). @@ -3232,6 +3264,22 @@ export enum TalerErrorCode { MERCHANT_PRIVATE_POST_PENDING_WEBHOOKS_CONFLICT_PENDING_WEBHOOK_EXISTS = 2910, + /** + * The auditor refused the connection due to a lack of authorization. + * Returned with an HTTP status code of #MHD_HTTP_UNAUTHORIZED (401). + * (A value of 0 indicates that the error is generated client-side). + */ + AUDITOR_GENERIC_UNAUTHORIZED = 3001, + + + /** + * This method is not allowed here. + * Returned with an HTTP status code of #MHD_HTTP_METHOD_NOT_ALLOWED (405). + * (A value of 0 indicates that the error is generated client-side). + */ + AUDITOR_GENERIC_METHOD_NOT_ALLOWED = 3002, + + /** * The signature from the exchange on the deposit confirmation is invalid. * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). @@ -3632,6 +3680,22 @@ export enum TalerErrorCode { BANK_CONVERSION_AMOUNT_TO_SMALL = 5147, + /** + * Specified amount will not work for this withdrawal. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + BANK_AMOUNT_DIFFERS = 5148, + + + /** + * The backend requires an amount to be specified. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + BANK_AMOUNT_REQUIRED = 5149, + + /** * The sync service failed find the account in its database. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). @@ -4608,6 +4672,62 @@ export enum TalerErrorCode { DONAU_EXCEEDING_DONATION_LIMIT = 8610, + /** + * The Donau is not aware of the donation unit requested for the operation. + * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_GENERIC_DONATION_UNIT_UNKNOWN = 8611, + + + /** + * The Donau failed to talk to the process responsible for its private donation unit keys or the helpers had no donation units (properly) configured. + * Returned with an HTTP status code of #MHD_HTTP_BAD_GATEWAY (502). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_DONATION_UNIT_HELPER_UNAVAILABLE = 8612, + + + /** + * The Donau failed to talk to the process responsible for its private signing keys. + * Returned with an HTTP status code of #MHD_HTTP_BAD_GATEWAY (502). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_SIGNKEY_HELPER_UNAVAILABLE = 8613, + + + /** + * The response from the online signing key helper process was malformed. + * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_SIGNKEY_HELPER_BUG = 8614, + + + /** + * The number of segments included in the URI does not match the number of segments expected by the endpoint. + * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_GENERIC_WRONG_NUMBER_OF_SEGMENTS = 8615, + + + /** + * The signature of the donation receipt is not valid. + * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_DONATION_RECEIPT_SIGNATURE_INVALID = 8616, + + + /** + * The client re-used a unique donor identifier nonce, which is not allowed. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + DONAU_DONOR_IDENTIFIER_NONCE_REUSE = 8617, + + /** * A generic error happened in the LibEuFin nexus. See the enclose details JSON for more information. * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0). diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 24a48b415..a7cd65fa2 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -988,6 +988,7 @@ export interface BankWithdrawDetails { status: WithdrawalOperationStatus; currency: string; amount: AmountJson | undefined; + wireFee: AmountJson | undefined; senderWire?: string; suggestedExchange?: string; confirmTransferUrl?: string; -- cgit v1.2.3 From 60a4640a35be584ee004de5e362f21ed03fa239e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 30 May 2024 13:16:15 -0300 Subject: working #8882 --- packages/taler-util/src/transactions-types.ts | 2 +- packages/taler-util/src/wallet-types.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts index cee3de9fa..db2133944 100644 --- a/packages/taler-util/src/transactions-types.ts +++ b/packages/taler-util/src/transactions-types.ts @@ -324,7 +324,7 @@ export interface TransactionWithdrawal extends TransactionCommon { /** * Exchange of the withdrawal. */ - exchangeBaseUrl: string; + exchangeBaseUrl: string | undefined; /** * Amount that got subtracted from the reserve balance. diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index a7cd65fa2..66b1e9769 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1850,18 +1850,16 @@ export interface GetWithdrawalDetailsForAmountRequest { export interface PrepareBankIntegratedWithdrawalRequest { talerWithdrawUri: string; - selectedExchange?: string; } export const codecForPrepareBankIntegratedWithdrawalRequest = (): Codec => buildCodecForObject() .property("talerWithdrawUri", codecForString()) - .property("selectedExchange", codecOptional(codecForString())) .build("PrepareBankIntegratedWithdrawalRequest"); export interface PrepareBankIntegratedWithdrawalResponse { - transactionId?: string; + transactionId: TransactionIdStr; info: WithdrawUriInfoResponse; } -- cgit v1.2.3 From 2a37575cf6db006431a7d174b85203ae41cc629f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 6 Jun 2024 15:49:36 -0300 Subject: wait for previous task to be cancelled --- packages/taler-util/src/CancellationToken.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/CancellationToken.ts b/packages/taler-util/src/CancellationToken.ts index 3aa576d77..5f38f0c7b 100644 --- a/packages/taler-util/src/CancellationToken.ts +++ b/packages/taler-util/src/CancellationToken.ts @@ -172,7 +172,7 @@ class CancellationToken { } = CancellationToken.create(); let timer: NodeJS.Timeout | null; - timer = setTimeout(() => originalCancel(CancellationToken.timeout), ms); + timer = setTimeout(() => originalCancel(`CancellationToken.timeout ${ms}`), ms); const disposeTimer = () => { if (timer == null) return; clearTimeout(timer); -- cgit v1.2.3 From 472899f066ce29b86bdc6b02a621f755a7c3b260 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Jun 2024 16:04:18 +0200 Subject: wallet-core: introduce finalizing state --- packages/taler-util/src/transactions-types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts index db2133944..a6ac5aec6 100644 --- a/packages/taler-util/src/transactions-types.ts +++ b/packages/taler-util/src/transactions-types.ts @@ -105,8 +105,11 @@ export enum TransactionMajorState { Done = "done", Aborting = "aborting", Aborted = "aborted", - Suspended = "suspended", Dialog = "dialog", + Finalizing = "finalizing", + // Plain suspended is always a suspended pending state. + Suspended = "suspended", + SuspendedFinalizing = "suspended-finalizing", SuspendedAborting = "suspended-aborting", Failed = "failed", Expired = "expired", -- cgit v1.2.3 From 689d58a5c79e98fec733c3cda31146620d8bde1d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 10 Jun 2024 15:25:51 -0300 Subject: fix #8886 --- .../taler-util/src/http-client/bank-integration.ts | 2 +- packages/taler-util/src/http-client/types.ts | 64 +++++++++++++++------- packages/taler-util/src/wallet-types.ts | 13 ++++- 3 files changed, 58 insertions(+), 21 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/bank-integration.ts b/packages/taler-util/src/http-client/bank-integration.ts index 08dab58e2..e07b6c5fa 100644 --- a/packages/taler-util/src/http-client/bank-integration.ts +++ b/packages/taler-util/src/http-client/bank-integration.ts @@ -50,7 +50,7 @@ export type TalerBankIntegrationErrorsByMethod< * The API is used by the wallets. */ export class TalerBankIntegrationHttpClient { - public readonly PROTOCOL_VERSION = "2:0:2"; + public readonly PROTOCOL_VERSION = "2:0:0"; httpLib: HttpRequestLibrary; diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 94f2c7518..f05bbc91a 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -1312,6 +1312,7 @@ export const codecForBankWithdrawalOperationStatus = ), ) .property("amount", codecOptional(codecForAmountString())) + .property("suggested_amount", codecOptional(codecForAmountString())) .property("card_fees", codecOptional(codecForAmountString())) .property("sender_wire", codecOptional(codecForPaytoString())) .property("suggested_exchange", codecOptional(codecForString())) @@ -2029,12 +2030,23 @@ export namespace TalerBankIntegrationApi { // confirmed: the transfer has been confirmed and registered by the bank status: WithdrawalOperationStatus; + // Currency used for the withdrawal. + // MUST be present when amount is absent. + // @since v2, may become mandatory in the future. + currency?: string; + // Amount that will be withdrawn with this operation // (raw amount without fee considerations). Only // given once the amount is fixed and cannot be changed. // Optional since **vC2EC**. amount?: AmountString | undefined; + // Suggestion for the amount to be withdrawn with this + // operation. Given if a suggestion was made but the + // user may still change the amount. + // Optional since **vC2EC**. + suggested_amount?: AmountString | undefined; + // Maximum amount that the wallet can choose to withdraw. // Only applicable when the amount is not fixed. // @since **vC2EC**. @@ -2046,17 +2058,13 @@ export namespace TalerBankIntegrationApi { // @since **vC2EC** card_fees?: AmountString | undefined; - // Bank account of the customer that is withdrawing, as a - // payto URI. + // Bank account of the customer that is debiting, as an + // RFC 8905 payto URI. sender_wire?: PaytoString; - // Suggestion for the amount to be withdrawn with this - // operation. Given if a suggestion was made but the - // user may still change the amount. - // Optional since **vC2EC**. - suggested_amount?: AmountString | undefined; - - // Suggestion for an exchange given by the bank. + // Base URL of the suggested exchange. The bank may have + // neither a suggestion nor a requirement for the exchange. + // This value is typically set in the bank's configuration. suggested_exchange?: string; // Base URL of an exchange that must be used. Optional, @@ -2067,7 +2075,8 @@ export namespace TalerBankIntegrationApi { // URL that the user needs to navigate to in order to // complete some final confirmation (e.g. 2FA). - // It may contain withdrawal operation id + // Only applicable when status is selected or pending. + // It may contain the withdrawal operation id. confirm_transfer_url?: string; // Wire transfer types supported by the bank. @@ -2077,13 +2086,15 @@ export namespace TalerBankIntegrationApi { // only non-null if status is selected or confirmed. selected_reserve_pub?: string; - // Exchange account selected by the wallet + // Exchange account selected by the wallet; // only non-null if status is selected or confirmed. + // @since **v1** selected_exchange_account?: string; } export interface BankWithdrawalOperationPostRequest { - // Reserve public key. + // Reserve public key that should become the wire transfer + // subject to fund the withdrawal. reserve_pub: string; // Payto address of the exchange selected for the withdrawal. @@ -2106,7 +2117,7 @@ export namespace TalerBankIntegrationApi { // URL that the user needs to navigate to in order to // complete some final confirmation (e.g. 2FA). // - // Only applicable when status is selected. + // Only applicable when status is selected or pending. // It may contain withdrawal operation id confirm_transfer_url?: string; } @@ -2181,12 +2192,31 @@ export namespace TalerCorebankApi { // Default to 'iban' is missing // @since v4, may become mandatory in the future. wire_type: string; + + // Wire transfer execution fees. + // @since v4, will become mandatory in the next version. + wire_transfer_fees?: AmountString; } export interface BankAccountCreateWithdrawalRequest { - // Amount to withdraw. - amount: AmountString; + // Amount to withdraw. If given, the wallet + // cannot change the amount. + // Optional since **vC2EC**. + amount?: AmountString; + + // Suggested amount to withdraw. The wallet can + // still change the suggestion. + // @since **vC2EC** + suggested_amount?: AmountString; + + // The non-Taler card fees the customer will have + // to pay to the account owner, bank and/or + // payment service provider + // they are using to make this withdrawal. + // @since **vC2EC** + card_fees?: AmountString; } + export interface BankAccountCreateWithdrawalResponse { // ID of the withdrawal, can be used to view/modify the withdrawal operation. withdrawal_id: string; @@ -2529,10 +2559,6 @@ export namespace TalerCorebankApi { export interface CashoutInfo { cashout_id: number; - /** - * @deprecated since 4, use new 2fa - */ - status?: "pending" | "aborted" | "confirmed"; } export interface GlobalCashouts { // Every string represents a cash-out operation ID. diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 66b1e9769..a7aa4f863 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -988,9 +988,12 @@ export interface BankWithdrawDetails { status: WithdrawalOperationStatus; currency: string; amount: AmountJson | undefined; + editableAmount: boolean; + maxAmount: AmountJson | undefined; wireFee: AmountJson | undefined; senderWire?: string; - suggestedExchange?: string; + exchange?: string; + editableExchange: boolean; confirmTransferUrl?: string; wireTypes: string[]; operationId: string; @@ -2364,7 +2367,11 @@ export interface WithdrawUriInfoResponse { confirmTransferUrl?: string; currency: string; amount: AmountString | undefined; + editableAmount: boolean; + maxAmount: AmountString | undefined; + wireFee: AmountString | undefined; defaultExchangeBaseUrl?: string; + editableExchange: boolean; possibleExchanges: ExchangeListItem[]; } @@ -2383,7 +2390,11 @@ export const codecForWithdrawUriInfoResponse = ), ) .property("amount", codecOptional(codecForAmountString())) + .property("maxAmount", codecOptional(codecForAmountString())) + .property("wireFee", codecOptional(codecForAmountString())) .property("currency", codecForString()) + .property("editableAmount", codecForBoolean()) + .property("editableExchange", codecForBoolean()) .property("defaultExchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .property("possibleExchanges", codecForList(codecForExchangeListItem())) .build("WithdrawUriInfoResponse"); -- cgit v1.2.3 From d96c47a00a34244f790d544aeed29e9880ae578d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 10 Jun 2024 17:54:25 -0300 Subject: fix #8886 actually, fee are added not substracted --- packages/taler-util/src/http-client/types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index f05bbc91a..0ef0bd65a 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -360,6 +360,7 @@ export const codecForCoreBankConfig = (): Codec => ), ) .property("wire_type", codecOptionalDefault(codecForString(), "iban")) + .property("wire_transfer_fees", codecOptional(codecForAmountString())) .build("TalerCorebankApi.Config"); //FIXME: implement this codec @@ -1312,10 +1313,11 @@ export const codecForBankWithdrawalOperationStatus = ), ) .property("amount", codecOptional(codecForAmountString())) + .property("currency", codecOptional(codecForCurrencyName())) .property("suggested_amount", codecOptional(codecForAmountString())) .property("card_fees", codecOptional(codecForAmountString())) .property("sender_wire", codecOptional(codecForPaytoString())) - .property("suggested_exchange", codecOptional(codecForString())) + .property("suggested_exchange", codecOptional(codecForURL())) .property("confirm_transfer_url", codecOptional(codecForURL())) .property("wire_types", codecForList(codecForString())) .property("selected_reserve_pub", codecOptional(codecForString())) -- cgit v1.2.3 From 11648f3bfc7e87b9472602b95a2f05cfdd964a4c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 11 Jun 2024 14:46:04 +0200 Subject: wallet-core: introduce 'missing-tos' tosStatus for exchange entries --- packages/taler-util/src/wallet-types.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index a7aa4f863..d23780145 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1338,6 +1338,7 @@ export enum ExchangeTosStatus { Pending = "pending", Proposed = "proposed", Accepted = "accepted", + MissingTos = "missing-tos", } export enum ExchangeEntryStatus { -- cgit v1.2.3 From 81b4a53a42c23e6f8e6b7e193a173b2c9cc35e83 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 11 Jun 2024 15:39:34 +0200 Subject: wallet-core: fix bank integration API protocol range --- packages/taler-util/src/http-client/bank-integration.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/bank-integration.ts b/packages/taler-util/src/http-client/bank-integration.ts index e07b6c5fa..23740328b 100644 --- a/packages/taler-util/src/http-client/bank-integration.ts +++ b/packages/taler-util/src/http-client/bank-integration.ts @@ -50,7 +50,9 @@ export type TalerBankIntegrationErrorsByMethod< * The API is used by the wallets. */ export class TalerBankIntegrationHttpClient { - public readonly PROTOCOL_VERSION = "2:0:0"; + public static readonly PROTOCOL_VERSION = "2:0:1"; + public readonly PROTOCOL_VERSION = + TalerBankIntegrationHttpClient.PROTOCOL_VERSION; httpLib: HttpRequestLibrary; -- cgit v1.2.3 From 77456187e967a81fe77de59a5df42460d54f0972 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 11 Jun 2024 15:45:09 +0200 Subject: wallet-core: update gana ECs --- packages/taler-util/src/taler-error-codes.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/taler-error-codes.ts b/packages/taler-util/src/taler-error-codes.ts index c463d94a0..f77357407 100644 --- a/packages/taler-util/src/taler-error-codes.ts +++ b/packages/taler-util/src/taler-error-codes.ts @@ -2584,6 +2584,14 @@ export enum TalerErrorCode { MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ENVELOPE_COUNT_MISMATCH = 2182, + /** + * Invalid token because it was already used, is expired or not yet valid. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + MERCHANT_POST_ORDERS_ID_PAY_TOKEN_INVALID = 2183, + + /** * The contract hash does not match the given order ID. * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). @@ -2944,6 +2952,14 @@ export enum TalerErrorCode { MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_SLUG_UNKNOWN = 2533, + /** + * A token family referenced in this order is either expired or not valid yet. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_NOT_VALID = 2534, + + /** * The exchange says it does not know this transfer. * Returned with an HTTP status code of #MHD_HTTP_BAD_GATEWAY (502). @@ -4112,6 +4128,14 @@ export enum TalerErrorCode { WALLET_CORE_REQUEST_CANCELLED = 7036, + /** + * A wallet-core request failed because the user needs to first accept the exchange's terms of service. + * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0). + * (A value of 0 indicates that the error is generated client-side). + */ + WALLET_EXCHANGE_TOS_NOT_ACCEPTED = 7037, + + /** * We encountered a timeout with our payment backend. * Returned with an HTTP status code of #MHD_HTTP_GATEWAY_TIMEOUT (504). -- cgit v1.2.3 From ce89223b51e71dae83d00fa93a0ab1c09b3c190a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 11 Jun 2024 16:39:09 +0200 Subject: wallet-core: check that ToS was accepted for certain requests --- packages/taler-util/src/errors.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/errors.ts b/packages/taler-util/src/errors.ts index 9378d25e8..d68177e4e 100644 --- a/packages/taler-util/src/errors.ts +++ b/packages/taler-util/src/errors.ts @@ -166,6 +166,11 @@ export interface DetailsMap { [TalerErrorCode.WALLET_DB_UNAVAILABLE]: { innerError: TalerErrorDetail | undefined; }; + [TalerErrorCode.WALLET_EXCHANGE_TOS_NOT_ACCEPTED]: { + exchangeBaseUrl: string; + tosStatus: string; + currentEtag: string | undefined; + }; } type ErrBody = Y extends keyof DetailsMap ? DetailsMap[Y] : empty; -- cgit v1.2.3 From 3ae9c9603d1a459e07221c91af324e31033924c8 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 11 Jun 2024 16:45:02 +0200 Subject: wallet-core,backoffice: remove redundant required_currency field --- packages/taler-util/src/http-client/types.ts | 46 ---------------------------- 1 file changed, 46 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 0ef0bd65a..3e6d857cb 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -903,7 +903,6 @@ export const codecForTemplateDetails = .property("template_description", codecForString()) .property("otp_id", codecOptional(codecForString())) .property("template_contract", codecForTemplateContractDetails()) - .property("required_currency", codecOptional(codecForString())) .property( "editable_defaults", codecOptional(codecForTemplateContractDetailsDefaults()), @@ -932,7 +931,6 @@ export const codecForWalletTemplateDetails = (): Codec => buildCodecForObject() .property("template_contract", codecForTemplateContractDetails()) - .property("required_currency", codecOptional(codecForString())) .property( "editable_defaults", codecOptional(codecForTemplateContractDetailsDefaults()), @@ -4752,17 +4750,6 @@ export namespace TalerMerchantApi { // user-editable defaults for this template. // Since protocol **v13**. editable_defaults?: TemplateContractDetailsDefaults; - - // Required currency for payments. Useful if no - // amount is specified in the template_contract - // but the user should be required to pay in a - // particular currency anyway. Merchant backends - // may reject requests if the template_contract - // or editable_defaults do - // specify an amount in a different currency. - // This parameter is optional. - // Since protocol **v13**. - required_currency?: string; } export interface TemplateContractDetails { // Human-readable summary for the template. @@ -4814,17 +4801,6 @@ export namespace TalerMerchantApi { // user-editable defaults for this template. // Since protocol **v13**. editable_defaults?: TemplateContractDetailsDefaults; - - // Required currency for payments. Useful if no - // amount is specified in the template_contract - // but the user should be required to pay in a - // particular currency anyway. Merchant backends - // may reject requests if the template_contract - // or editable_defaults do - // specify an amount in a different currency. - // This parameter is optional. - // Since protocol **v13**. - required_currency?: string; } export interface TemplateSummaryResponse { @@ -4850,17 +4826,6 @@ export namespace TalerMerchantApi { // user-editable defaults for this template. // Since protocol **v13**. editable_defaults?: TemplateContractDetailsDefaults; - - // Required currency for payments. Useful if no - // amount is specified in the template_contract - // but the user should be required to pay in a - // particular currency anyway. Merchant backends - // may reject requests if the template_contract - // or editable_defaults do - // specify an amount in a different currency. - // This parameter is optional. - // Since protocol **v13**. - required_currency?: string; } export interface TemplateDetails { @@ -4879,17 +4844,6 @@ export namespace TalerMerchantApi { // user-editable defaults for this template. // Since protocol **v13**. editable_defaults?: TemplateContractDetailsDefaults; - - // Required currency for payments. Useful if no - // amount is specified in the template_contract - // but the user should be required to pay in a - // particular currency anyway. Merchant backends - // may reject requests if the template_contract - // or editable_defaults do - // specify an amount in a different currency. - // This parameter is optional. - // Since protocol **v13**. - required_currency?: string; } export interface UsingTemplateDetails { // Summary of the template -- cgit v1.2.3