calculateAmount(e, 100)}
data-testid='dt_percentage_selector_block_id_4'
/>
diff --git a/packages/cashier/src/pages/account-transfer/account-transfer-form/__tests__/account-transfer-form.spec.tsx b/packages/cashier/src/pages/account-transfer/account-transfer-form/__tests__/account-transfer-form.spec.tsx
index f99366f732d2..91ce5030243d 100644
--- a/packages/cashier/src/pages/account-transfer/account-transfer-form/__tests__/account-transfer-form.spec.tsx
+++ b/packages/cashier/src/pages/account-transfer/account-transfer-form/__tests__/account-transfer-form.spec.tsx
@@ -36,6 +36,7 @@ describe('
', () => {
mt5: {},
},
},
+ account_settings: { country_code: 'aq' },
mt5_login_list: [
{
login: 'value',
@@ -142,9 +143,26 @@ describe('
', () => {
renderAccountTransferForm();
expect(screen.getByTestId('dt_account_transfer_form_wrapper')).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Transfers within accounts are only available for trading, not withdrawals. To withdraw funds, use the same method you used to deposit.'
+ )
+ ).toBeInTheDocument();
expect(screen.getByText('Cashier Error')).toBeInTheDocument();
});
+ it('should render inline message and disable transfer button when country code is RU', () => {
+ mockRootStore.client.account_settings.country_code = 'ru';
+ mockRootStore.modules.cashier.account_transfer.selected_to.is_crypto = true;
+
+ renderAccountTransferForm();
+
+ expect(
+ screen.getByText('Transfers from fiat account to crypto accounts are not supported.')
+ ).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Transfer' })).toBeDisabled();
+ });
+
it('should show loader if account_list.length === 0', () => {
mockRootStore.modules.cashier.account_transfer.accounts_list = [];
diff --git a/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.scss b/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.scss
index 481114962999..cca939c28821 100644
--- a/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.scss
+++ b/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.scss
@@ -8,9 +8,24 @@
}
&__header {
- padding: 0 0 3.2rem;
+ padding: 0 0 1.6rem;
+ }
+
+ &__inline-message {
+ max-width: 36rem;
+ width: 100%;
+ margin: 0 auto 2.4rem;
+
+ &.transfer-restriction {
+ margin: 0 auto 1.6rem;
+ }
+
@include mobile-or-tablet-screen {
- padding: 0 0 1.6rem;
+ margin: 0 0 1.6rem;
+ }
+
+ &--text {
+ text-align: start;
}
}
diff --git a/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.tsx b/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.tsx
index f1d2ec8ea802..239a525dd409 100644
--- a/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.tsx
+++ b/packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.tsx
@@ -2,7 +2,9 @@ import React from 'react';
import { Link, useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { Field, FieldProps, Form, Formik } from 'formik';
+
import { Button, Dropdown, InlineMessage, Input, Loading, Money, StatusBadge, Text } from '@deriv/components';
+import { useExchangeRate, useMFAccountStatus } from '@deriv/hooks';
import {
CFD_PLATFORMS,
getCurrencyDisplayCode,
@@ -17,15 +19,16 @@ import {
} from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
import { Localize, localize } from '@deriv/translations';
-import { useMFAccountStatus, useExchangeRate } from '@deriv/hooks';
import { useDevice } from '@deriv-com/ui';
+
import AccountPlatformIcon from '../../../components/account-platform-icon';
import CryptoFiatConverter from '../../../components/crypto-fiat-converter';
import ErrorDialog from '../../../components/error-dialog';
import PercentageSelector from '../../../components/percentage-selector';
import { useCashierStore } from '../../../stores/useCashierStores';
-import { TAccount, TAccountsList, TError, TReactChangeEvent, TradingPlatformStatusResponse } from '../../../types';
+import { TAccount, TAccountsList, TError, TradingPlatformStatusResponse, TReactChangeEvent } from '../../../types';
import AccountTransferReceipt from '../account-transfer-receipt/account-transfer-receipt';
+
import './account-transfer-form.scss';
type TAccountTransferFormProps = {
@@ -154,7 +157,7 @@ const AccountTransferForm = observer(
traders_hub: { closeAccountTransferModal },
} = useStore();
const { isDesktop, isMobile } = useDevice();
- const { account_limits, authentication_status, getLimits: onMount } = client;
+ const { account_limits, account_settings, authentication_status, getLimits: onMount } = client;
const mf_account_status = useMFAccountStatus();
const { account_transfer, crypto_fiat_converter, general_store } = useCashierStore();
@@ -444,6 +447,22 @@ const AccountTransferForm = observer(
selected_from?.status?.includes('poa_failed') &&
authentication_status?.document_status !== 'verified';
+ const is_russia_restricted =
+ account_settings?.country_code?.toLowerCase() === 'ru' &&
+ // specific restriction for fiat CR <=> crypto CR accounts
+ ((selected_from?.is_crypto &&
+ !selected_to?.is_crypto &&
+ !selected_to?.is_ctrader &&
+ !selected_to?.is_derivez &&
+ !selected_to?.is_dxtrade &&
+ !selected_to?.is_mt) ||
+ (!selected_from?.is_crypto &&
+ !selected_from?.is_ctrader &&
+ !selected_from?.is_derivez &&
+ !selected_from?.is_dxtrade &&
+ !selected_from?.is_mt &&
+ selected_to?.is_crypto));
+
const poa_pending_msg = localize(
'You will be able to transfer funds between MT5 accounts and other accounts once your address is verified.'
);
@@ -500,6 +519,31 @@ const AccountTransferForm = observer(
{localize('Transfer between your accounts in Deriv')}
)}
+
+
+
+
+
+ {is_russia_restricted && (
+
+
+
+
+
+ )}
)}
@@ -673,6 +717,7 @@ const AccountTransferForm = observer(
amount={
selected_from.balance ? Number(selected_from.balance) : 0
}
+ disabled={is_russia_restricted}
from_account={selected_from.value}
getCalculatedAmount={setTransferPercentageSelectorResult}
percentage={percentage}
@@ -711,6 +756,7 @@ const AccountTransferForm = observer(
''
)
}
+ disabled={is_russia_restricted}
onChangeConverterFromAmount={onChangeConverterFromAmount}
onChangeConverterToAmount={onChangeConverterToAmount}
resetConverter={resetConverter}
@@ -757,7 +803,8 @@ const AccountTransferForm = observer(
shouldShowTransferButton(values.amount) ||
is_mt5_restricted ||
is_unavailable_status_present ||
- is_maintenance_status_present
+ is_maintenance_status_present ||
+ is_russia_restricted
}
primary
large
diff --git a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/__tests__/withdrawal-crypto-form.spec.tsx b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/__tests__/withdrawal-crypto-form.spec.tsx
index 7f40c25501ab..2966946d74c4 100644
--- a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/__tests__/withdrawal-crypto-form.spec.tsx
+++ b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/__tests__/withdrawal-crypto-form.spec.tsx
@@ -39,6 +39,7 @@ describe('
', () => {
beforeEach(() => {
mockRootStore = mockStore({
client: {
+ account_settings: { country_code: 'aq' },
currency: 'BTC',
verification_code: { payment_withdraw: 'code' },
},
@@ -190,4 +191,18 @@ describe('
', () => {
});
await waitFor(() => expect(mockRootStore.modules.cashier.withdraw.requestWithdraw).toHaveBeenCalled());
});
+
+ it('should render inline message with StaticUrl', () => {
+ render(
+
+
+
+ );
+
+ expect(screen.getByText(/Withdraw using the same payment method you used to deposit/i)).toBeInTheDocument();
+
+ const link = screen.getByRole('link', { name: /available payment methods/i });
+ expect(link).toBeInTheDocument();
+ expect(link).toHaveAttribute('href', expect.stringContaining('/payment-methods'));
+ });
});
diff --git a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.scss b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.scss
index 83b99a1faf6b..c5293f68fcee 100644
--- a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.scss
+++ b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.scss
@@ -75,4 +75,13 @@
list-style-type: disc;
margin-left: 1.6rem;
}
+
+ &__inline-message {
+ width: 100%;
+ }
+
+ &__inline-message-link {
+ text-decoration: underline;
+ cursor: pointer;
+ }
}
diff --git a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.tsx b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.tsx
index 13fb88e8287a..efc65831f804 100644
--- a/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.tsx
+++ b/packages/cashier/src/pages/withdrawal/withdrawal-crypto-form/withdrawal-crypto-form.tsx
@@ -1,10 +1,12 @@
import React from 'react';
import { Field, FieldProps, Formik, FormikProps } from 'formik';
-import { Button, InlineMessage, Input, Loading, Text } from '@deriv/components';
+
+import { Button, InlineMessage, Input, Loading, StaticUrl, Text } from '@deriv/components';
import { useExchangeRate, useGrowthbookIsOn } from '@deriv/hooks';
import { CryptoConfig, getCurrencyName } from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
import { Localize, localize } from '@deriv/translations';
+
import CryptoFiatConverter from '../../../components/crypto-fiat-converter';
import PercentageSelector from '../../../components/percentage-selector';
import { useCashierStore } from '../../../stores/useCashierStores';
@@ -41,8 +43,22 @@ const Header = ({ currency }: THeaderProps) => {
}}
/>
+
+
+ ,
+ ]}
+ />
+
+
-
+