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: return transacti


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: return transactionId whenever a transaction is created
Date: Thu, 25 May 2023 11:59:58 +0200

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 0b4d90008 wallet-core: return transactionId whenever a transaction is 
created
0b4d90008 is described below

commit 0b4d900088d3a319c23ce228bfd5cf286dbb44e8
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu May 25 11:59:55 2023 +0200

    wallet-core: return transactionId whenever a transaction is created
---
 packages/taler-util/src/wallet-types.ts               | 12 ++++++++++++
 packages/taler-wallet-core/src/operations/pay-peer.ts | 16 ++++++++++++++++
 packages/taler-wallet-core/src/operations/tip.ts      |  6 ++++++
 3 files changed, 34 insertions(+)

diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index d20eb5173..1ede15919 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -396,9 +396,16 @@ export interface PrepareTipResult {
   /**
    * Unique ID for the tip assigned by the wallet.
    * Typically different from the merchant-generated tip ID.
+   * 
+   * @deprecated use transactionId instead
    */
   walletTipId: string;
 
+  /**
+   * Tip transaction ID.
+   */
+  transactionId: string;
+
   /**
    * Has the tip already been accepted?
    */
@@ -447,6 +454,7 @@ export const codecForPrepareTipResult = (): 
Codec<PrepareTipResult> =>
     .property("merchantBaseUrl", codecForString())
     .property("expirationTimestamp", codecForTimestamp)
     .property("walletTipId", codecForString())
+    .property("transactionId", codecForString())
     .build("PrepareTipResult");
 
 export interface BenchmarkResult {
@@ -2150,6 +2158,8 @@ export interface PreparePeerPushCreditResponse {
   amountRaw: AmountString;
   amountEffective: AmountString;
   peerPushPaymentIncomingId: string;
+
+  transactionId: string;
 }
 
 export interface PreparePeerPullDebitResponse {
@@ -2163,6 +2173,8 @@ export interface PreparePeerPullDebitResponse {
   amountEffective: AmountString;
 
   peerPullPaymentIncomingId: string;
+
+  transactionId: string;
 }
 
 export const codecForPreparePeerPushCreditRequest =
diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts 
b/packages/taler-wallet-core/src/operations/pay-peer.ts
index d9db60e83..108be7339 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer.ts
@@ -825,6 +825,10 @@ export async function preparePeerPushCredit(
       contractTerms: existing.existingContractTerms,
       peerPushPaymentIncomingId:
         existing.existingPushInc.peerPushPaymentIncomingId,
+      transactionId: constructTransactionIdentifier({
+        tag: TransactionType.PeerPushCredit,
+        peerPushPaymentIncomingId: 
existing.existingPushInc.peerPushPaymentIncomingId,
+      }),
     };
   }
 
@@ -907,6 +911,10 @@ export async function preparePeerPushCredit(
     amountRaw: purseStatus.balance,
     contractTerms: dec.contractTerms,
     peerPushPaymentIncomingId,
+    transactionId: constructTransactionIdentifier({
+      tag: TransactionType.PeerPushCredit,
+      peerPushPaymentIncomingId,
+    }),
   };
 }
 
@@ -1363,6 +1371,10 @@ export async function preparePeerPullDebit(
       contractTerms: existingPullIncomingRecord.contractTerms,
       peerPullPaymentIncomingId:
         existingPullIncomingRecord.peerPullPaymentIncomingId,
+      transactionId: constructTransactionIdentifier({
+        tag: TransactionType.PeerPullDebit,
+        peerPullPaymentIncomingId: 
existingPullIncomingRecord.peerPullPaymentIncomingId,
+      }),
     };
   }
 
@@ -1451,6 +1463,10 @@ export async function preparePeerPullDebit(
     amountRaw: contractTerms.amount,
     contractTerms: contractTerms,
     peerPullPaymentIncomingId,
+    transactionId: constructTransactionIdentifier({
+      tag: TransactionType.PeerPullDebit,
+      peerPullPaymentIncomingId: peerPullPaymentIncomingId,
+    }),
   };
 }
 
diff --git a/packages/taler-wallet-core/src/operations/tip.ts 
b/packages/taler-wallet-core/src/operations/tip.ts
index a6e1a8fec..417f06dc2 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -176,6 +176,11 @@ export async function prepareTip(
     tipRecord = newTipRecord;
   }
 
+  const transactionId = constructTransactionIdentifier({
+    tag: TransactionType.Tip,
+    walletTipId: tipRecord.walletTipId,
+  })
+
   const tipStatus: PrepareTipResult = {
     accepted: !!tipRecord && !!tipRecord.acceptedTimestamp,
     tipAmountRaw: Amounts.stringify(tipRecord.tipAmountRaw),
@@ -184,6 +189,7 @@ export async function prepareTip(
     expirationTimestamp: tipRecord.tipExpiration,
     tipAmountEffective: Amounts.stringify(tipRecord.tipAmountEffective),
     walletTipId: tipRecord.walletTipId,
+    transactionId,
   };
 
   return tipStatus;

-- 
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]