diff options
author | Florian Dold <florian@dold.me> | 2023-05-16 19:03:22 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-05-16 19:03:22 +0200 |
commit | acf0dda83f3974187cacf58e7d81c2115f6d950d (patch) | |
tree | 6ca65c874d33f21a3a81435ff2429c08e28a03e5 /packages/taler-util/src | |
parent | 72d0230a2ec34d83bfbbd0c7f731e25c76da3a45 (diff) | |
download | wallet-core-acf0dda83f3974187cacf58e7d81c2115f6d950d.tar.xz |
wallet-core: return purchase information in refund if available
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/transactions-types.ts | 20 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 41 |
2 files changed, 22 insertions, 39 deletions
diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts index 02e95c208..aaf527b89 100644 --- a/packages/taler-util/src/transactions-types.ts +++ b/packages/taler-util/src/transactions-types.ts @@ -545,17 +545,31 @@ export interface RefundInfoShort { amountRaw: AmountString; } +/** + * Summary information about the payment that we got a refund for. + */ +export interface RefundPaymentInfo { + summary: string; + summary_i18n?: InternationalizedString; + /** + * More information about the merchant + */ + merchant: MerchantInfo; +} + export interface TransactionRefund extends TransactionCommon { type: TransactionType.Refund; - // ID for the transaction that is refunded - refundedTransactionId: string; - // Amount that has been refunded by the merchant amountRaw: AmountString; // Amount will be added to the wallet's balance after fees and refreshing amountEffective: AmountString; + + // ID for the transaction that is refunded + refundedTransactionId: string; + + paymentInfo: RefundPaymentInfo | undefined; } export interface TransactionTip extends TransactionCommon { diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 82f62ceb7..bc43652d9 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1518,7 +1518,6 @@ export interface WithdrawTestBalanceRequest { forcedDenomSel?: ForcedDenomSel; } - /** * Request to the crypto worker to make a sync signature. */ @@ -1590,36 +1589,6 @@ export const codecForWithdrawTestBalance = .property("bankAccessApiBaseUrl", codecForString()) .build("WithdrawTestBalanceRequest"); -export interface ApplyRefundResponse { - contractTermsHash: string; - - transactionId: string; - - proposalId: string; - - amountEffectivePaid: AmountString; - - amountRefundGranted: AmountString; - - amountRefundGone: AmountString; - - pendingAtExchange: boolean; - - info: OrderShortInfo; -} - -export const codecForApplyRefundResponse = (): Codec<ApplyRefundResponse> => - buildCodecForObject<ApplyRefundResponse>() - .property("amountEffectivePaid", codecForAmountString()) - .property("amountRefundGone", codecForAmountString()) - .property("amountRefundGranted", codecForAmountString()) - .property("contractTermsHash", codecForString()) - .property("pendingAtExchange", codecForBoolean()) - .property("proposalId", codecForString()) - .property("transactionId", codecForString()) - .property("info", codecForOrderShortInfo()) - .build("ApplyRefundResponse"); - export interface SetCoinSuspendedRequest { coinPub: string; suspended: boolean; @@ -1658,11 +1627,11 @@ export interface StartRefundQueryRequest { transactionId: string; } -export const codecForStartRefundQueryRequest = (): Codec<StartRefundQueryRequest> => - buildCodecForObject<StartRefundQueryRequest>() - .property("transactionId", codecForString()) - .build("StartRefundQueryRequest"); - +export const codecForStartRefundQueryRequest = + (): Codec<StartRefundQueryRequest> => + buildCodecForObject<StartRefundQueryRequest>() + .property("transactionId", codecForString()) + .build("StartRefundQueryRequest"); export interface PrepareTipRequest { talerTipUri: string; |