aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-19 08:29:48 -0300
committerSebastian <sebasjm@gmail.com>2024-06-19 08:30:45 -0300
commit107c89732ee944844d9b9fb74b727f5a3e3e983c (patch)
tree918181196f61992c35f0ae5314f419c4979c9962 /packages
parent2819792fd2b22039ed405c32f09ada6334ab0c79 (diff)
downloadwallet-core-107c89732ee944844d9b9fb74b727f5a3e3e983c.tar.xz
update to the latest doc
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-util/src/http-client/merchant.ts6
-rw-r--r--packages/taler-util/src/http-client/types.ts27
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
index 892971fee..10afdc8eb 100644
--- 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
index 9024a95d0..57e4511ed 100644
--- 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;