diff options
author | Florian Dold <florian@dold.me> | 2023-11-09 14:54:15 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-11-09 14:54:27 +0100 |
commit | f1e6fe17303ae21000b596b05dfb8b24163b0880 (patch) | |
tree | 3f0e3493cccc803ef6329d72e407ac739eee9a85 /packages/taler-wallet-core/src/operations | |
parent | 7e3d6938bf5184b88ab4d0b75e4dc3d10af7c60a (diff) | |
download | wallet-core-f1e6fe17303ae21000b596b05dfb8b24163b0880.tar.xz |
wallet-core: deliver kyc URL via experimental user data
Currently only needed by iOS, might be removed in the future.
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 2 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 33ee2b424..a30120baa 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -1934,6 +1934,7 @@ export function notifyTransition( ws: InternalWalletState, transactionId: string, transitionInfo: TransitionInfo | undefined, + experimentalUserData: any = undefined, ): void { if ( transitionInfo && @@ -1947,6 +1948,7 @@ export function notifyTransition( oldTxState: transitionInfo.oldTxState, newTxState: transitionInfo.newTxState, transactionId, + experimentalUserData, }); } ws.workAvailable.trigger(); diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 5b8d101b1..c83993816 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -781,6 +781,8 @@ async function handleKycRequired( throw Error(`unexpected response from kyc-check (${kycStatusRes.status})`); } + let notificationKycUrl: string | undefined = undefined; + const transitionInfo = await ws.db .mktx((x) => [x.planchets, x.withdrawalGroups]) .runReadWrite(async (tx) => { @@ -813,10 +815,12 @@ async function handleKycRequired( amlStatus === AmlStatus.normal || amlStatus === undefined ? WithdrawalGroupStatus.PendingKyc : amlStatus === AmlStatus.pending - ? WithdrawalGroupStatus.PendingAml - : amlStatus === AmlStatus.fronzen - ? WithdrawalGroupStatus.SuspendedAml - : assertUnreachable(amlStatus); + ? WithdrawalGroupStatus.PendingAml + : amlStatus === AmlStatus.fronzen + ? WithdrawalGroupStatus.SuspendedAml + : assertUnreachable(amlStatus); + + notificationKycUrl = kycUrl; await tx.withdrawalGroups.put(wg2); const newTxState = computeWithdrawalTransactionStatus(wg2); @@ -829,7 +833,7 @@ async function handleKycRequired( return undefined; } }); - notifyTransition(ws, transactionId, transitionInfo); + notifyTransition(ws, transactionId, transitionInfo, notificationKycUrl); } /** @@ -1102,7 +1106,7 @@ async function processPlanchetVerifyAndStoreCoin( return false; } p.planchetStatus = PlanchetStatus.WithdrawalDone; - p.lastError = undefined + p.lastError = undefined; await tx.planchets.put(p); await makeCoinAvailable(ws, tx, coin); return true; @@ -1150,7 +1154,8 @@ export async function updateWithdrawalDenoms( denom.verificationStatus === DenominationVerificationStatus.Unverified ) { logger.trace( - `Validating denomination (${current + 1}/${denominations.length + `Validating denomination (${current + 1}/${ + denominations.length }) signature of ${denom.denomPubHash}`, ); let valid = false; @@ -1775,7 +1780,7 @@ export async function getExchangeWithdrawalInfo( ) { logger.warn( `wallet's support for exchange protocol version ${WALLET_EXCHANGE_PROTOCOL_VERSION} might be outdated ` + - `(exchange has ${exchangeDetails.protocolVersionRange}), checking for updates`, + `(exchange has ${exchangeDetails.protocolVersionRange}), checking for updates`, ); } } |