gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: wallet-core: introduce abortP


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: introduce abortPay request
Date: Wed, 11 Jan 2023 14:35:51 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new c3fdbd291 wallet-core: introduce abortPay request
c3fdbd291 is described below

commit c3fdbd291f3d74d35f524f96ded6e3c6c85712e0
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Jan 11 14:33:35 2023 +0100

    wallet-core: introduce abortPay request
    
    This request supersedes the abortPayWithRefund request, as that's too
    implementation-focused and does not describe well what's happening.
    
    Also, abortPay can be forced to transition a transaction immediately
    into an "aborted" state (either from "paying" or "aborting").
---
 packages/taler-util/src/wallet-types.ts            | 10 ++++++++++
 packages/taler-wallet-core/src/wallet-api-types.ts | 16 +++++++++-------
 packages/taler-wallet-core/src/wallet.ts           |  2 +-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index 367d9c4c9..77c083e45 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -1555,12 +1555,22 @@ export const codecForAcceptTipRequest = (): 
Codec<AcceptTipRequest> =>
 
 export interface AbortPayWithRefundRequest {
   proposalId: string;
+
+  /**
+   * Move the payment immediately into an aborted state.
+   * The UI should warn the user that this might lead
+   * to money being lost.
+   *
+   * Defaults to false.
+   */
+  cancelImmediately?: boolean;
 }
 
 export const codecForAbortPayWithRefundRequest =
   (): Codec<AbortPayWithRefundRequest> =>
     buildCodecForObject<AbortPayWithRefundRequest>()
       .property("proposalId", codecForString())
+      .property("cancelImmediately", codecOptional(codecForBoolean()))
       .build("AbortPayWithRefundRequest");
 
 export interface GetFeeForDepositRequest {
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts 
b/packages/taler-wallet-core/src/wallet-api-types.ts
index 1ea57a27d..ecabb9af0 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -24,7 +24,7 @@
  * Imports.
  */
 import {
-  AbortPayWithRefundRequest,
+  AbortPayWithRefundRequest as AbortPayRequest,
   AcceptBankIntegratedWithdrawalRequest,
   AcceptExchangeTosRequest,
   AcceptManualWithdrawalRequest,
@@ -150,7 +150,7 @@ export enum WalletApiOperation {
   GetExchangeTos = "getExchangeTos",
   GetExchangeDetailedInfo = "getExchangeDetailedInfo",
   RetryPendingNow = "retryPendingNow",
-  AbortFailedPayWithRefund = "abortFailedPayWithRefund",
+  AbortPay = "abortPay",
   ConfirmPay = "confirmPay",
   DumpCoins = "dumpCoins",
   SetCoinSuspended = "setCoinSuspended",
@@ -329,11 +329,13 @@ export type ConfirmPayOp = {
 };
 
 /**
- * Abort a pending payment with a refund.
+ * Abort a pending payment.
+ * Puts the payment into an "aborting" state
+ * that can be cancelled.
  */
-export type AbortPayWithRefundOp = {
-  op: WalletApiOperation.AbortFailedPayWithRefund;
-  request: AbortPayWithRefundRequest;
+export type AbortPayOp = {
+  op: WalletApiOperation.AbortPay;
+  request: AbortPayRequest;
   response: EmptyObject;
 };
 
@@ -827,7 +829,7 @@ export type WalletOperations = {
   [WalletApiOperation.GetContractTermsDetails]: GetContractTermsDetailsOp;
   [WalletApiOperation.WithdrawTestkudos]: WithdrawTestkudosOp;
   [WalletApiOperation.ConfirmPay]: ConfirmPayOp;
-  [WalletApiOperation.AbortFailedPayWithRefund]: AbortPayWithRefundOp;
+  [WalletApiOperation.AbortPay]: AbortPayOp;
   [WalletApiOperation.GetBalances]: GetBalancesOp;
   [WalletApiOperation.GetTransactions]: GetTransactionsOp;
   [WalletApiOperation.GetTransactionById]: GetTransactionByIdOp;
diff --git a/packages/taler-wallet-core/src/wallet.ts 
b/packages/taler-wallet-core/src/wallet.ts
index f73cdac70..b29276a75 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -1163,7 +1163,7 @@ async function dispatchRequestInternal<Op extends 
WalletApiOperation>(
       const req = codecForConfirmPayRequest().decode(payload);
       return await confirmPay(ws, req.proposalId, req.sessionId);
     }
-    case WalletApiOperation.AbortFailedPayWithRefund: {
+    case WalletApiOperation.AbortPay: {
       const req = codecForAbortPayWithRefundRequest().decode(payload);
       await abortFailedPayWithRefund(ws, req.proposalId);
       return {};

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]