Skip to content

Commit

Permalink
Merge pull request binary-com#15 from utkarsha-deriv/utkarsha/TnC-for…
Browse files Browse the repository at this point in the history
…-new-account-creation

[UPM-1375] Add tnc_acceptance field to account creation(real/malta) api req
  • Loading branch information
utkarsha-deriv committed Aug 16, 2024
2 parents 546f01b + 8137b43 commit 23f9c9c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('<TermsOfUse/>', () => {
onSubmit: jest.fn(),
onSave: jest.fn(),
real_account_signup_target: 'svg',
value: { agreed_tos: false, agreed_tnc: false },
value: { agreed_tos: false, tnc_acceptance: false },
residence: 'id',
is_multi_account: false,
};
Expand Down
8 changes: 4 additions & 4 deletions packages/account/src/Components/terms-of-use/terms-of-use.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useDevice } from '@deriv-com/ui';

type TTermsOfUseFormProps = {
agreed_tos: boolean;
agreed_tnc: boolean;
tnc_acceptance: boolean;
fatca_declaration?: '0' | '1';
resident_self_declaration?: boolean;
};
Expand Down Expand Up @@ -132,8 +132,8 @@ const TermsOfUse = observer(
component={CheckboxField}
label_font_size={isDesktop ? 'xs' : 'xxs'}
className='terms-of-use__checkbox'
name='agreed_tnc'
id='agreed_tnc'
name='tnc_acceptance'
id='tnc_acceptance'
label={
<Localize
i18n_default_text='I agree to the <0>terms and conditions</0>.'
Expand Down Expand Up @@ -171,7 +171,7 @@ const TermsOfUse = observer(
is_disabled={
isSubmitting ||
!values.agreed_tos ||
!values.agreed_tnc ||
!values.tnc_acceptance ||
!values.fatca_declaration ||
!(is_residence_self_declaration_required
? values.resident_self_declaration
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/Configs/terms-of-use-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getTermsOfUseConfig = (account_settings: TTermsOfConfigSettings) => ({
supported_in: ['svg', 'maltainvest'],
default_value: false,
},
agreed_tnc: {
tnc_acceptance: {
supported_in: ['svg', 'maltainvest'],
default_value: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ const AccountWizard = observer(props => {
const submitForm = (payload = undefined) => {
let clone = { ...form_values() };
delete clone?.tax_identification_confirm;
delete clone?.agreed_tnc;
delete clone?.agreed_tos;
delete clone?.confirmation_checkbox;
delete clone?.crs_confirmation;
Expand All @@ -314,6 +313,9 @@ const AccountWizard = observer(props => {
delete clone.tax_identification_number;
}

if (clone?.tnc_acceptance) {
clone.tnc_acceptance = 1;
}
clone = processInputData(clone);
modifiedProps.setRealAccountFormData(clone);
if (payload) {
Expand Down

0 comments on commit 23f9c9c

Please sign in to comment.