diff options
author | Florian Dold <florian@dold.me> | 2023-05-25 11:59:55 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-05-25 11:59:55 +0200 |
commit | 0b4d900088d3a319c23ce228bfd5cf286dbb44e8 (patch) | |
tree | 6f1e522fdb84864a08925b9c23852cec37ebbf16 /packages/taler-wallet-core/src | |
parent | c3ef842df0ca80c5fe8deb5dabea44d5c817d7ed (diff) | |
download | wallet-core-0b4d900088d3a319c23ce228bfd5cf286dbb44e8.tar.xz |
wallet-core: return transactionId whenever a transaction is created
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer.ts | 16 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 6 |
2 files changed, 22 insertions, 0 deletions
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; |