Skip to content
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
2 changes: 2 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export default {
billingAddress: 'Billing address',
expensifyTermsOfService: 'Expensify Terms of Service',
growlMessageOnSave: 'Your debit card was successfully added',
expensifyPassword: 'Expensify password',
error: {
invalidName: 'Please enter a valid name',
addressZipCode: 'Please enter a valid zip code',
Expand All @@ -330,6 +331,7 @@ export default {
addressCity: 'Please enter a city',
acceptedTerms: 'You must accept the Terms of Service to continue',
genericFailureMessage: 'An error occurred while adding your card, please try again',
password: 'Please enter your Expensify password',
},
},
paymentsPage: {
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export default {
billingAddress: 'Dirección de envio',
expensifyTermsOfService: 'Expensify Términos de servicio',
growlMessageOnSave: 'Su tarteja de débito se agregó correctamente',
expensifyPassword: 'Contraseña de Expensify',
error: {
invalidName: 'Por favor ingrese un nombre válido',
addressZipCode: 'Por favor ingrese un código postal válido',
Expand All @@ -330,6 +331,7 @@ export default {
addressCity: 'Por favor ingrese una ciudad',
acceptedTerms: 'Debes aceptar los Términos de servicio para continuar',
genericFailureMessage: 'Se produjo un error al agregar su tarjeta. Vuelva a intentarlo',
password: 'Por favor ingrese tu contraseña de Expensify',
},
},
paymentsPage: {
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/PaymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function addBillingCard(params) {
addressName: params.nameOnCard,
addressZip: params.addressZipCode,
currency: CONST.CURRENCY.USD,
isP2PDebitCard: true,
password: params.password,
}).then(((response) => {
let errorMessage = '';
if (response.jsonCode === 200) {
Expand Down
19 changes: 19 additions & 0 deletions src/pages/settings/Payments/AddDebitCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import FormAlertWithSubmitButton from '../../../components/FormAlertWithSubmitBu
import ONYXKEYS from '../../../ONYXKEYS';
import compose from '../../../libs/compose';
import AddressSearch from '../../../components/AddressSearch';
import * as ComponentUtils from '../../../libs/ComponentUtils';
import FormScrollView from '../../../components/FormScrollView';

const propTypes = {
Expand Down Expand Up @@ -57,6 +58,7 @@ class DebitCardPage extends Component {
addressState: '',
addressZipCode: '',
acceptedTerms: false,
password: '',
errors: {},
shouldShowAlertPrompt: false,
};
Expand All @@ -69,6 +71,7 @@ class DebitCardPage extends Component {
'addressStreet',
'addressState',
'addressZipCode',
'password',
'acceptedTerms',
];

Expand All @@ -82,6 +85,7 @@ class DebitCardPage extends Component {
addressState: 'addDebitCardPage.error.addressState',
addressZipCode: 'addDebitCardPage.error.addressZipCode',
acceptedTerms: 'addDebitCardPage.error.acceptedTerms',
password: 'addDebitCardPage.error.password',
};

this.submit = this.submit.bind(this);
Expand Down Expand Up @@ -141,6 +145,10 @@ class DebitCardPage extends Component {
errors.addressState = true;
}

if (_.isEmpty(this.state.password.trim())) {
errors.password = true;
}

if (!this.state.acceptedTerms) {
errors.acceptedTerms = true;
}
Expand Down Expand Up @@ -266,6 +274,17 @@ class DebitCardPage extends Component {
/>
</View>
</View>
<View style={[styles.mt4]}>
<TextInput
label={this.props.translate('addDebitCardPage.expensifyPassword')}
onChangeText={password => this.clearErrorAndSetValue('password', password)}
value={this.state.password}
errorText={this.getErrorText('password')}
textContentType="password"
autoCompleteType={ComponentUtils.PASSWORD_AUTOCOMPLETE_TYPE}
secureTextEntry
/>
</View>
<CheckboxWithLabel
isChecked={this.state.acceptedTerms}
onPress={() => {
Expand Down