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 ++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'packages/taler-util/src/http-client') 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 { -- cgit v1.2.3