From ab9a5e1e8ac60bbf55104e84490e581dfad5de02 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 1 Feb 2023 13:00:12 -0300 Subject: fix #7552, add next_url from the tip information when accepting tips --- packages/taler-wallet-core/src/operations/tip.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/tip.ts') diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index dabde9f62..2bf216102 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -130,6 +130,7 @@ export async function prepareTip( tipAmountRaw: Amounts.stringify(amount), tipExpiration: tipPickupStatus.expiration, exchangeBaseUrl: tipPickupStatus.exchange_url, + next_url: tipPickupStatus.next_url, merchantBaseUrl: res.merchantBaseUrl, createdTimestamp: TalerProtocolTimestamp.now(), merchantTipId: res.merchantTipId, @@ -355,17 +356,21 @@ export async function acceptTip( const tipRecord = await tx.tips.get(tipId); if (!tipRecord) { logger.error("tip not found"); - return false; + return undefined; } tipRecord.acceptedTimestamp = TalerProtocolTimestamp.now(); await tx.tips.put(tipRecord); - return true; + return tipRecord; }); + if (found) { await processTip(ws, tipId); } + //FIXME: if tip is not found the behavior of the function is the same + // as the tip was found and finished return { transactionId: makeTransactionId(TransactionType.Tip, tipId), + next_url: found?.next_url, }; } -- cgit v1.2.3