diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-merchant.ts | 31 |
1 files changed, 24 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 733da8394..b39d5f8c1 100644 --- a/packages/taler-wallet-core/src/operations/pay-merchant.ts +++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts @@ -844,7 +844,11 @@ async function handleInsufficientFunds( payInfo.payCoinSelectionUid = encodeCrock(getRandomBytes(32)); await tx.purchases.put(p); await spendCoins(ws, tx, { - allocationId: `txn:proposal:${p.proposalId}`, + // allocationId: `txn:proposal:${p.proposalId}`, + allocationId: constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId: proposalId, + }), coinPubs: payInfo.payCoinSelection.coinPubs, contributions: payInfo.payCoinSelection.coinContributions.map((x) => Amounts.parseOrThrow(x), @@ -1199,7 +1203,10 @@ export async function runPayForConfirmPay( return { type: ConfirmPayResultType.Done, contractTerms: d.contractTermsRaw, - transactionId: makeTransactionId(TransactionType.Payment, proposalId), + transactionId: constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId, + }), }; } case OperationAttemptResultType.Error: { @@ -1210,14 +1217,20 @@ export async function runPayForConfirmPay( return { type: ConfirmPayResultType.Pending, lastError: opRetry?.lastError, - transactionId: makeTransactionId(TransactionType.Payment, proposalId), + transactionId: constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId, + }), }; } case OperationAttemptResultType.Pending: logger.trace("reporting pending as confirmPay response"); return { type: ConfirmPayResultType.Pending, - transactionId: makeTransactionId(TransactionType.Payment, proposalId), + transactionId: constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId, + }), lastError: undefined, }; case OperationAttemptResultType.Longpoll: @@ -1344,7 +1357,11 @@ export async function confirmPay( p.purchaseStatus = PurchaseStatus.Paying; await tx.purchases.put(p); await spendCoins(ws, tx, { - allocationId: `txn:proposal:${p.proposalId}`, + //`txn:proposal:${p.proposalId}` + allocationId: constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId: proposalId, + }), coinPubs: coinSelection.coinPubs, contributions: coinSelection.coinContributions.map((x) => Amounts.parseOrThrow(x), @@ -2072,7 +2089,7 @@ export async function startRefundQueryForUri( await startQueryRefund(ws, proposalId); return { transactionId, - } + }; } export async function startQueryRefund( @@ -2357,6 +2374,6 @@ export function computeRefundTransactionState( case RefundGroupStatus.Pending: return { major: TransactionMajorState.Pending, - } + }; } } |