diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 3 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/refresh.ts | 3 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index 31c1bebb2..3ea02012b 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -188,6 +188,9 @@ export async function spendCoins( Amounts.currencyOf(csi.contributions[0]), refreshCoinPubs, RefreshReason.PayMerchant, + { + originatingTransactionId: csi.allocationId, + }, ); } diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 638dec8a6..5b7bf8d83 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -60,6 +60,7 @@ import { RefreshCoinStatus, RefreshGroupRecord, RefreshOperationStatus, + RefreshReasonDetails, WalletStoresV1, } from "../db.js"; import { TalerError } from "../errors.js"; @@ -853,6 +854,7 @@ export async function createRefreshGroup( currency: string, oldCoinPubs: CoinRefreshRequest[], reason: RefreshReason, + reasonDetails?: RefreshReasonDetails, ): Promise<RefreshGroupId> { const refreshGroupId = encodeCrock(getRandomBytes(32)); @@ -940,6 +942,7 @@ export async function createRefreshGroup( statusPerCoin: oldCoinPubs.map(() => RefreshCoinStatus.Pending), oldCoinPubs: oldCoinPubs.map((x) => x.coinPub), lastErrorPerCoin: {}, + reasonDetails, reason, refreshGroupId, refreshSessionPerCoin: oldCoinPubs.map(() => undefined), diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 12037fe0e..5b6b5adc3 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -600,7 +600,10 @@ function buildTransactionForRefresh( refreshGroupRecord.currency, refreshGroupRecord.inputPerCoin, ).amount; - const outputAmount = Amounts.sumOrZero(refreshGroupRecord.currency, refreshGroupRecord.estimatedOutputPerCoin).amount; + const outputAmount = Amounts.sumOrZero( + refreshGroupRecord.currency, + refreshGroupRecord.estimatedOutputPerCoin, + ).amount; return { type: TransactionType.Refresh, refreshReason: refreshGroupRecord.reason, @@ -612,6 +615,8 @@ function buildTransactionForRefresh( ), refreshInputAmount: Amounts.stringify(inputAmount), refreshOutputAmount: Amounts.stringify(outputAmount), + originatingTransactionId: + refreshGroupRecord.reasonDetails?.originatingTransactionId, extendedStatus: refreshGroupRecord.operationStatus === RefreshOperationStatus.Finished || refreshGroupRecord.operationStatus === |