taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 107c89732ee944844d9b9fb74b727f5a3e3e983c
parent 2819792fd2b22039ed405c32f09ada6334ab0c79
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 19 Jun 2024 08:29:48 -0300

update to the latest doc

Diffstat:
Mpackages/taler-util/src/http-client/merchant.ts | 6+++---
Mpackages/taler-util/src/http-client/types.ts | 27++++++++++++++++-----------
2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/packages/taler-util/src/http-client/merchant.ts b/packages/taler-util/src/http-client/merchant.ts @@ -26,6 +26,7 @@ import { codecForAccountAddResponse, codecForAccountKycRedirects, codecForAccountsSummaryResponse, + codecForBankAccountDetail, codecForBankAccountEntry, codecForClaimResponse, codecForInstancesResponse, @@ -707,7 +708,7 @@ export class TalerMerchantInstanceHttpClient { switch (resp.status) { case HttpStatusCode.Ok: - return opSuccessFromHttp(resp, codecForBankAccountEntry()); + return opSuccessFromHttp(resp, codecForBankAccountDetail()); case HttpStatusCode.Unauthorized: // FIXME: missing in docs return opKnownHttpFailure(resp.status, resp); case HttpStatusCode.NotFound: @@ -882,9 +883,8 @@ export class TalerMerchantInstanceHttpClient { default: return opUnknownFailure(resp, await readTalerErrorResponse(resp)); } - } - + /** * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-products-$PRODUCT_ID */ diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts @@ -572,21 +572,22 @@ export const codecForAccountAddResponse = export const codecForAccountsSummaryResponse = (): Codec<TalerMerchantApi.AccountsSummaryResponse> => buildCodecForObject<TalerMerchantApi.AccountsSummaryResponse>() - .property("accounts", codecForList(codecForBankAccountSummaryEntry())) + .property("accounts", codecForList(codecForBankAccountEntry())) .build("TalerMerchantApi.AccountsSummaryResponse"); -export const codecForBankAccountSummaryEntry = - (): Codec<TalerMerchantApi.BankAccountSummaryEntry> => - buildCodecForObject<TalerMerchantApi.BankAccountSummaryEntry>() - .property("payto_uri", codecForPaytoString()) - .property("h_wire", codecForString()) - .build("TalerMerchantApi.BankAccountSummaryEntry"); - export const codecForBankAccountEntry = (): Codec<TalerMerchantApi.BankAccountEntry> => buildCodecForObject<TalerMerchantApi.BankAccountEntry>() .property("payto_uri", codecForPaytoString()) .property("h_wire", codecForString()) + .property("active", codecOptional(codecForBoolean())) + .build("TalerMerchantApi.BankAccountEntry"); + +export const codecForBankAccountDetail = + (): Codec<TalerMerchantApi.BankAccountDetail> => + buildCodecForObject<TalerMerchantApi.BankAccountDetail>() + .property("payto_uri", codecForPaytoString()) + .property("h_wire", codecForString()) .property("salt", codecForString()) .property("credit_facade_url", codecOptional(codecForURL())) .property("active", codecOptional(codecForBoolean())) @@ -4043,18 +4044,22 @@ export namespace TalerMerchantApi { export interface AccountsSummaryResponse { // List of accounts that are known for the instance. - accounts: BankAccountSummaryEntry[]; + accounts: BankAccountEntry[]; } // TODO: missing in docs - export interface BankAccountSummaryEntry { + export interface BankAccountEntry { // payto:// URI of the account. payto_uri: PaytoString; // Hash over the wire details (including over the salt). h_wire: HashCode; + + // true if this account is active, + // false if it is historic. + active?: boolean; } - export interface BankAccountEntry { + export interface BankAccountDetail { // payto:// URI of the account. payto_uri: PaytoString;