From 75fdf6137fb465d6c6c72b997bc899459f3de66e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Jun 2023 10:58:24 -0300 Subject: move kycurl to commons, make webex aware --- .../src/wallet/Transaction.stories.tsx | 23 +------- .../src/wallet/Transaction.tsx | 67 +++++++++++++--------- 2 files changed, 41 insertions(+), 49 deletions(-) (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index 046757ab0..ecea4afd0 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -232,14 +232,6 @@ const transactionError = { message: "Unexpected error code in response", }; -const kycError = { - code: 7025, - hint: "KYC check required for withdrawal", - kycUrl: - "http://localhost:6666/oauth/v2/login?client_id=taler-exchange&redirect_uri=http%3A%2F%2Flocalhost%3A8081%2F%2Fkyc-proof%2F59WFS5VXXY3CEE25BM45XPB7ZCDQZNZ46PJCMNXK05P65T9M1X90%2FKYC-PROVIDER-MYPROV%2F1", - when: AbsoluteTime.now(), -}; - export const Withdraw = tests.createExample(TestedComponent, { transaction: exampleData.withdraw, }); @@ -285,21 +277,10 @@ export const WithdrawErrorKYC = tests.createExample(TestedComponent, { major: TransactionMajorState.Pending, minor: TransactionMinorState.KycRequired, }, - - // error: kycError, + kycUrl: + "http://localhost:6666/oauth/v2/login?client_id=taler-exchange&redirect_uri=http%3A%2F%2Flocalhost%3A8081%2F%2Fkyc-proof%2F59WFS5VXXY3CEE25BM45XPB7ZCDQZNZ46PJCMNXK05P65T9M1X90%2FKYC-PROVIDER-MYPROV%2F1", }, }); -// export const WithdrawErrorInDevMode = tests.createExampleInCustomContext( -// TestedComponent, -// { -// transaction: { -// ...exampleData.withdraw, -// error: transactionError, -// }, -// }, -// DevContextProviderForTesting, -// { value: true }, -// ); export const WithdrawPendingManual = tests.createExample( TestedComponent, diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index d198893cd..f5ffe4221 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -25,12 +25,14 @@ import { parsePaytoUri, PaytoUri, stringifyPaytoUri, + TalerErrorCode, TalerPreciseTimestamp, TalerProtocolTimestamp, Transaction, TransactionDeposit, TransactionIdStr, TransactionMajorState, + TransactionMinorState, TransactionType, TranslatedString, WithdrawalType, @@ -259,35 +261,44 @@ function TransactionTemplate({ return (
- {transaction?.error ? ( - transaction.error.code === 7025 ? ( - - - Follow this link to the{` `} - KYC verifier - - - ) : ( - i18n.str`No more information has been provided` - ), - }} - /> - ) : ( - - ) + {transaction?.error && + // FIXME: wallet core should stop sending this error on KYC + transaction.error.code !== + TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED ? ( + ) : undefined} + {transaction.txState.minor === TransactionMinorState.KycRequired && ( + + + Follow this link to the{` `} + KYC verifier + + + ) : ( + i18n.str`No more information has been provided` + ), + }} + /> + )} + {transaction.txState.minor === TransactionMinorState.AmlRequired && ( + + + The transaction has been blocked since the account required an AML + check + + + )} {transaction.txState.major === TransactionMajorState.Pending && ( This transaction is not completed -- cgit v1.2.3