diff options
author | Florian Dold <florian@dold.me> | 2022-10-14 22:47:11 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-14 22:47:11 +0200 |
commit | 0c8e56c32457ea9b9229a8a3607fcf8e7618bc17 (patch) | |
tree | d0b4bbe4e199d62426e722b803fdfa178cd6f3a0 /packages/taler-wallet-core/src/operations/pay-merchant.ts | |
parent | eec6695be0409669fcad36c6cc7ea01f48d41c97 (diff) | |
download | wallet-core-0c8e56c32457ea9b9229a8a3607fcf8e7618bc17.tar.xz |
wallet-core: properly separate different types of IDs
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-merchant.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts index 233038997..6b14b60c6 100644 --- a/packages/taler-wallet-core/src/operations/pay-merchant.ts +++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts @@ -122,7 +122,7 @@ import { scheduleRetry, } from "../util/retries.js"; import { - makeEventId, + makeTransactionId, spendCoins, storeOperationError, storeOperationPending, @@ -858,7 +858,7 @@ async function handleInsufficientFunds( payInfo.payCoinSelectionUid = encodeCrock(getRandomBytes(32)); await tx.purchases.put(p); await spendCoins(ws, tx, { - allocationId: `tx:proposal:${p.proposalId}`, + allocationId: `txn:proposal:${p.proposalId}`, coinPubs: payInfo.payCoinSelection.coinPubs, contributions: payInfo.payCoinSelection.coinContributions, refreshReason: RefreshReason.PayMerchant, @@ -1554,7 +1554,7 @@ export async function runPayForConfirmPay( return { type: ConfirmPayResultType.Done, contractTerms: d.contractTermsRaw, - transactionId: makeEventId(TransactionType.Payment, proposalId), + transactionId: makeTransactionId(TransactionType.Payment, proposalId), }; } case OperationAttemptResultType.Error: { @@ -1580,7 +1580,7 @@ export async function runPayForConfirmPay( return { type: ConfirmPayResultType.Pending, lastError: opRetry?.lastError, - transactionId: makeEventId(TransactionType.Payment, proposalId), + transactionId: makeTransactionId(TransactionType.Payment, proposalId), }; } else { // FIXME: allocate error code! @@ -1599,7 +1599,7 @@ export async function runPayForConfirmPay( ); return { type: ConfirmPayResultType.Pending, - transactionId: makeEventId(TransactionType.Payment, proposalId), + transactionId: makeTransactionId(TransactionType.Payment, proposalId), lastError: undefined, }; case OperationAttemptResultType.Longpoll: @@ -1735,7 +1735,7 @@ export async function confirmPay( p.purchaseStatus = PurchaseStatus.Paying; await tx.purchases.put(p); await spendCoins(ws, tx, { - allocationId: `tx:proposal:${p.proposalId}`, + allocationId: `txn:proposal:${p.proposalId}`, coinPubs: coinSelection.coinPubs, contributions: coinSelection.coinContributions, refreshReason: RefreshReason.PayMerchant, @@ -2549,7 +2549,7 @@ export async function applyRefundFromPurchaseId( return { contractTermsHash: download.contractData.contractTermsHash, proposalId: purchase.proposalId, - transactionId: makeEventId(TransactionType.Payment, proposalId), //FIXME: can we have the tx id of the refund + transactionId: makeTransactionId(TransactionType.Payment, proposalId), //FIXME: can we have the tx id of the refund amountEffectivePaid: Amounts.stringify(summary.amountEffectivePaid), amountRefundGone: Amounts.stringify(summary.amountRefundGone), amountRefundGranted: Amounts.stringify(summary.amountRefundGranted), |