taler-typescript-core

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

commit b60e7d0c9dc418628635638becefabf557a0159c
parent bdc9d168abf0a74c7b491a0804cc8edf9447cb69
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Mon,  8 Dec 2025 13:06:38 -0300

add support to refund amount on order list

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

diff --git a/packages/taler-util/src/http-client/merchant.ts b/packages/taler-util/src/http-client/merchant.ts @@ -160,7 +160,7 @@ export enum TalerMerchantManagementCacheEviction { * Uses libtool's current:revision:age versioning. */ export class TalerMerchantInstanceHttpClient { - public static readonly PROTOCOL_VERSION = "23:0:0"; + public static readonly PROTOCOL_VERSION = "24:0:1"; readonly httpLib: HttpRequestLibrary; readonly cacheEvictor: CacheEvictor<TalerMerchantInstanceCacheEviction>; diff --git a/packages/taler-util/src/types-taler-merchant.ts b/packages/taler-util/src/types-taler-merchant.ts @@ -2762,6 +2762,17 @@ export interface OrderHistoryEntry { // The amount of money the order is for. amount: AmountString; + // The total amount of refunds granted by the merchant. + // Includes refunds that the wallet did not yet pick up. + // Only available if the order was paid. + // Since **v24**. + refund_amount?: AmountString; + + // The amount of refunds the customer's wallet did not yet + // pick up. Only available if the order was paid. + // Since **v24**. + pending_refund_amount?: AmountString; + // The summary of the order. summary: string; @@ -4069,7 +4080,10 @@ export const codecForPaymentResponse = (): Codec<PaymentResponse> => export const codecForPaymentDeniedLegallyResponse = (): Codec<PaymentDeniedLegallyResponse> => buildCodecForObject<PaymentDeniedLegallyResponse>() - .property("exchange_base_urls", codecOptionalDefault(codecForList(codecForString()),[])) + .property( + "exchange_base_urls", + codecOptionalDefault(codecForList(codecForString()), []), + ) .build("TalerMerchantApi.PaymentDeniedLegallyResponse"); export const codecForStatusPaid = (): Codec<StatusPaid> => @@ -4437,6 +4451,8 @@ export const codecForOrderHistoryEntry = (): Codec<OrderHistoryEntry> => .property("row_id", codecForNumber()) .property("timestamp", codecForTimestamp) .property("amount", codecForAmountString()) + .property("refund_amount", codecOptional(codecForAmountString())) + .property("pending_refund_amount", codecOptional(codecForAmountString())) .property("summary", codecForString()) .property("refundable", codecForBoolean()) .property("paid", codecForBoolean())