Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional wallet terms based on program ID #28433

Merged
merged 5 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,11 @@ const CONST = {
STATEMENT: 'STATEMENT_NAVIGATE',
CONCIERGE: 'CONCIERGE_NAVIGATE',
},
MTL_WALLET_PROGRAM_ID: '760',
PROGRAM_ISSUERS: {
EXPENSIFY_PAYMENTS: 'Expensify Payments LLC',
BANCORP_BANK: 'The Bancorp Bank',
},
},

PLAID: {
Expand Down
11 changes: 6 additions & 5 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import type {
RequestedAmountMessageParams,
TagSelectionParams,
TranslationBase,
WalletProgramParams,
} from './types';
import * as ReportActionsUtils from '../libs/ReportActionsUtils';

Expand Down Expand Up @@ -909,7 +910,7 @@ export default {
phrase2: 'Terms of Service',
phrase3: 'and',
phrase4: 'Privacy',
phrase5: 'Money transmission is provided by Expensify Payments LLC (NMLS ID:2017010) pursuant to its',
phrase5: `Money transmission is provided by ${CONST.WALLET.PROGRAM_ISSUERS.EXPENSIFY_PAYMENTS} (NMLS ID:2017010) pursuant to its`,
phrase6: 'licenses',
},
validateCodeForm: {
Expand Down Expand Up @@ -1170,7 +1171,7 @@ export default {
electronicFundsWithdrawal: 'Electronic funds withdrawal',
standard: 'Standard',
shortTermsForm: {
expensifyPaymentsAccount: 'The Expensify Wallet is issued by The Bancorp Bank.',
expensifyPaymentsAccount: ({walletProgram}: WalletProgramParams) => `The Expensify Wallet is issued by ${walletProgram}.`,
perPurchase: 'Per purchase',
atmWithdrawal: 'ATM withdrawal',
cashReload: 'Cash reload',
Expand Down Expand Up @@ -1212,10 +1213,10 @@ export default {
'several minutes. The fee is 1.5% of the transfer amount (with a minimum fee of $0.25).',
fdicInsuranceBancorp:
'Your funds are eligible for FDIC insurance. Your funds will be held at or ' +
'transferred to The Bancorp Bank, an FDIC-insured institution. Once there, your funds are insured up ' +
'to $250,000 by the FDIC in the event The Bancorp Bank fails. See',
`transferred to ${CONST.WALLET.PROGRAM_ISSUERS.BANCORP_BANK}, an FDIC-insured institution. Once there, your funds are insured up ` +
`to $250,000 by the FDIC in the event ${CONST.WALLET.PROGRAM_ISSUERS.BANCORP_BANK} fails. See`,
fdicInsuranceBancorp2: 'for details.',
contactExpensifyPayments: 'Contact Expensify Payments by calling +1 833-400-0904, by email at',
contactExpensifyPayments: `Contact ${CONST.WALLET.PROGRAM_ISSUERS.EXPENSIFY_PAYMENTS} by calling +1 833-400-0904, by email at`,
contactExpensifyPayments2: 'or sign in at',
generalInformation: 'For general information about prepaid accounts, visit',
generalInformation2: 'If you have a complaint about a prepaid account, call the Consumer Financial Protection Bureau at 1-855-411-2372 or visit',
Expand Down
11 changes: 6 additions & 5 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import type {
RequestedAmountMessageParams,
TagSelectionParams,
EnglishTranslation,
WalletProgramParams,
} from './types';

/* eslint-disable max-len */
Expand Down Expand Up @@ -905,7 +906,7 @@ export default {
phrase2: 'Términos de Servicio',
phrase3: 'y',
phrase4: 'Privacidad',
phrase5: 'El envío de dinero es brindado por Expensify Payments LLC (NMLS ID:2017010) de conformidad con sus',
phrase5: `El envío de dinero es brindado por ${CONST.WALLET.PROGRAM_ISSUERS.EXPENSIFY_PAYMENTS} (NMLS ID:2017010) de conformidad con sus`,
phrase6: 'licencias',
},
validateCodeForm: {
Expand Down Expand Up @@ -1187,7 +1188,7 @@ export default {
electronicFundsWithdrawal: 'Retiro electrónico de fondos',
standard: 'Estándar',
shortTermsForm: {
expensifyPaymentsAccount: 'La billetera Expensify es emitida por The Bancorp Bank.',
expensifyPaymentsAccount: ({walletProgram}: WalletProgramParams) => `La billetera Expensify es emitida por ${walletProgram}.`,
perPurchase: 'Por compra',
atmWithdrawal: 'Retiro de cajero automático',
cashReload: 'Recarga de efectivo',
Expand Down Expand Up @@ -1230,10 +1231,10 @@ export default {
'transferencia (con una tarifa mínima de $ 0.25). ',
fdicInsuranceBancorp:
'Sus fondos son elegibles para el seguro de la FDIC. Sus fondos se mantendrán en o ' +
'transferido a The Bancorp Bank, una institución asegurada por la FDIC. Una vez allí, sus fondos ' +
'están asegurados a $ 250,000 por la FDIC en caso de que The Bancorp Bank quiebre. Ver',
`transferido a ${CONST.WALLET.PROGRAM_ISSUERS.BANCORP_BANK}, una institución asegurada por la FDIC. Una vez allí, sus fondos ` +
`están asegurados a $ 250,000 por la FDIC en caso de que ${CONST.WALLET.PROGRAM_ISSUERS.BANCORP_BANK} quiebre. Ver`,
fdicInsuranceBancorp2: 'para detalles.',
contactExpensifyPayments: 'Comuníquese con Expensify Payments llamando al + 1833-400-0904, por correoelectrónico a',
contactExpensifyPayments: `Comuníquese con ${CONST.WALLET.PROGRAM_ISSUERS.EXPENSIFY_PAYMENTS} llamando al + 1833-400-0904, por correoelectrónico a`,
contactExpensifyPayments2: 'o inicie sesión en',
generalInformation: 'Para obtener información general sobre cuentas prepagas, visite',
generalInformation2: 'Si tiene una queja sobre una cuenta prepaga, llame al Consumer Financial Oficina de Protección al 1-855-411-2372 o visite',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ type FormattedMaxLengthParams = {formattedMaxLength: string};

type TagSelectionParams = {tagName: string};

type WalletProgramParams = {walletProgram: string};

/* Translation Object types */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type TranslationBaseValue = string | string[] | ((...args: any[]) => string);
Expand Down Expand Up @@ -307,4 +309,5 @@ export type {
RemovedTheRequestParams,
FormattedMaxLengthParams,
TagSelectionParams,
WalletProgramParams,
};
2 changes: 1 addition & 1 deletion src/pages/EnablePayments/EnablePaymentsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function EnablePaymentsPage({userWallet}) {
case CONST.WALLET.STEP.ONFIDO:
return <OnfidoStep />;
case CONST.WALLET.STEP.TERMS:
return <TermsStep />;
return <TermsStep userWallet={userWallet} />;
case CONST.WALLET.STEP.ACTIVATE:
return <ActivateStep userWallet={userWallet} />;
default:
Expand Down
21 changes: 19 additions & 2 deletions src/pages/EnablePayments/TermsPage/ShortTermsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ import Text from '../../../components/Text';
import * as Localize from '../../../libs/Localize';
import CONST from '../../../CONST';
import TextLink from '../../../components/TextLink';
import userWalletPropTypes from '../userWalletPropTypes';

function ShortTermsForm() {
const propTypes = {
/** The user's wallet */
userWallet: userWalletPropTypes,
};

const defaultProps = {
userWallet: {},
};

function ShortTermsForm(props) {
return (
<>
<Text style={styles.mb5}>{Localize.translateLocal('termsStep.shortTermsForm.expensifyPaymentsAccount')}</Text>
<Text style={styles.mb5}>
{Localize.translateLocal('termsStep.shortTermsForm.expensifyPaymentsAccount', {
walletProgram:
props.userWallet.walletProgramID === CONST.WALLET.MTL_WALLET_PROGRAM_ID ? CONST.WALLET.PROGRAM_ISSUERS.EXPENSIFY_PAYMENTS : CONST.WALLET.PROGRAM_ISSUERS.BANCORP_BANK,
})}
</Text>

<View style={[styles.shortTermsBorder, styles.p2, styles.mb6]}>
<View style={[styles.shortTermsRow, styles.mb4]}>
Expand Down Expand Up @@ -132,6 +147,8 @@ function ShortTermsForm() {
);
}

ShortTermsForm.propTypes = propTypes;
ShortTermsForm.defaultProps = defaultProps;
ShortTermsForm.displayName = 'ShortTermsForm';

export default ShortTermsForm;
7 changes: 6 additions & 1 deletion src/pages/EnablePayments/TermsStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ import LongTermsForm from './TermsPage/LongTermsForm';
import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton';
import walletTermsPropTypes from './walletTermsPropTypes';
import * as ErrorUtils from '../../libs/ErrorUtils';
import userWalletPropTypes from './userWalletPropTypes';

const propTypes = {
/** The user's wallet */
userWallet: userWalletPropTypes,

/** Comes from Onyx. Information about the terms for the wallet */
walletTerms: walletTermsPropTypes,

...withLocalizePropTypes,
};

const defaultProps = {
userWallet: {},
walletTerms: {},
};

Expand Down Expand Up @@ -59,7 +64,7 @@ function TermsStep(props) {
style={styles.flex1}
contentContainerStyle={styles.ph5}
>
<ShortTermsForm />
<ShortTermsForm userWallet={props.userWallet} />
<LongTermsForm />
<CheckboxWithLabel
accessibilityLabel={props.translate('termsStep.haveReadAndAgree')}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/EnablePayments/userWalletPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ export default PropTypes.shape({

/** Whether we should show the ActivateStep success view after the user finished the KYC flow */
shouldShowWalletActivationSuccess: PropTypes.bool,

/** The wallet's programID, used to show the correct terms. */
walletProgramID: PropTypes.string,
});
3 changes: 3 additions & 0 deletions src/types/onyx/UserWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type UserWallet = {
/** The type of the linked account (debitCard or bankAccount) */
walletLinkedAccountType: WalletLinkedAccountType;

/** The wallet's programID, used to show the correct terms. */
walletProgramID?: string;

/** The user's bank account ID */
bankAccountID?: number;

Expand Down