diff options
author | Florian Dold <florian@dold.me> | 2023-04-24 20:24:23 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-24 20:30:01 +0200 |
commit | e4407f825960554659af276d88eb54cc4e5fde9f (patch) | |
tree | 9ce7e6841254debd508e5489908ccac7518449f4 /packages/taler-util/src | |
parent | 974cd02066edc1a5b8279931d6b019f667051409 (diff) | |
download | wallet-core-e4407f825960554659af276d88eb54cc4e5fde9f.tar.xz |
-refunds for deposit aborts
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/taler-types.ts | 44 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/packages/taler-util/src/taler-types.ts b/packages/taler-util/src/taler-types.ts index 48eb49d22..ab5951112 100644 --- a/packages/taler-util/src/taler-types.ts +++ b/packages/taler-util/src/taler-types.ts @@ -2120,3 +2120,47 @@ export interface MerchantUsingTemplateDetails { summary?: string; amount?: AmountString; } + +export interface ExchangeRefundRequest { + // Amount to be refunded, can be a fraction of the + // coin's total deposit value (including deposit fee); + // must be larger than the refund fee. + refund_amount: AmountString; + + // SHA-512 hash of the contact of the merchant with the customer. + h_contract_terms: HashCodeString; + + // 64-bit transaction id of the refund transaction between merchant and customer. + rtransaction_id: number; + + // EdDSA public key of the merchant. + merchant_pub: EddsaPublicKeyString; + + // EdDSA signature of the merchant over a + // TALER_RefundRequestPS with purpose + // TALER_SIGNATURE_MERCHANT_REFUND + // affirming the refund. + merchant_sig: EddsaPublicKeyString; +} + +export interface ExchangeRefundSuccessResponse { + // The EdDSA :ref:signature (binary-only) with purpose + // TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND over + // a TALER_RecoupRefreshConfirmationPS + // using a current signing key of the + // exchange affirming the successful refund. + exchange_sig: EddsaSignatureString; + + // Public EdDSA key of the exchange that was used to generate the signature. + // Should match one of the exchange's signing keys from /keys. It is given + // explicitly as the client might otherwise be confused by clock skew as to + // which signing key was used. + exchange_pub: EddsaPublicKeyString; +} + +export const codecForExchangeRefundSuccessResponse = + (): Codec<ExchangeRefundSuccessResponse> => + buildCodecForObject<ExchangeRefundSuccessResponse>() + .property("exchange_pub", codecForString()) + .property("exchange_sig", codecForString()) + .build("ExchangeRefundSuccessResponse"); diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 151934f2c..ec53541a5 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -668,6 +668,7 @@ export enum RefreshReason { PayPeerPull = "pay-peer-pull", Refund = "refund", AbortPay = "abort-pay", + AbortDeposit = "abort-deposit", Recoup = "recoup", BackupRestored = "backup-restored", Scheduled = "scheduled", |