[HOLD for payment 2021-10-13] [P2P in E.cash] Add Debit Card Page
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
- Add a new file
Pages/Settings/Payments/AddDebitCardPage.js - Add a new method to API.js
addBillingCard(data)which calls the Web-Secure commandUser_AddBillingCard - The “Add Debit Card” button should send the data to a new method in actions/PaymentMethods
addBillingCard()- This method should call API.addBillingCard, and then add the returned result to the CARD_LIST array in Onyx
- These are the required fields:
- cardNumber
- cardYear
- cardMonth
- cardCVV
- addressName
- addressZip
- currency
- Add a new route
ROUTES.SETTINGS_ADD_DEBIT_CARD - Add the new page to the modalStackNavigator
- Add navigating to the new page from the "Add Payment Methods" menu

Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/166481 Upwork URL: https://www.upwork.com/jobs/~01f05831da44758d78 View all open jobs on Upwork
Triggered auto assignment to @mitchexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Triggered auto assignment to @Luke9389 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Hello @laurenreidexpensify,
I would love to work on this task.
Proposal:
- Add a new file
Pages/Settings/Payments/AddDebitCardPage.js - Add a new method to API.js addBillingCard(data) which calls the Web-Secure command
User_AddBillingCard - The “Add Debit Card” button should send the data to a new method in
actions/PaymentMethods addBillingCard()- This method should call API.addBillingCard, and then add the returned result to the
CARD_LIST array in Onyx - These are the required fields:
- cardNumber
- cardYear
- cardMonth
- cardCVV
- addressName
- addressZip
- currency
- This method should call API.addBillingCard, and then add the returned result to the
- Add a new route ROUTES.SETTINGS_ADD_DEBIT_CARD
- Add the new page to the modalStackNavigator
- Add navigating to the new page from the "Add Payment Methods" menu
@mikeattara do you have any other details about how you would implement this to consider? Thanks
The price for this has been increased to $500
I'm interested in this one @laurenreidexpensify. The steps in the issue are pretty clear, so I just have a few questions:
- Should we add a new function in
ValidationUtilsto validate if it's a valid debit card number? Or it's okay to send unvalidated numbers to ourUser_AddBillingCardAPI? - What params our
User_AddBillingCardAPI takes?
@Luke9389 can you cover the Qs from @rdjuric while Brandon is OOO today? thanks
Any updates here @Luke9389 @stitesExpensify?
@Luke9389 @stitesExpensify any update here for @rdjuric ?
Hi @rdjuric! Sorry for the delay.
Should we add a new function in ValidationUtils to validate if it's a valid debit card number? Or it's okay to send unvalidated numbers to our User_AddBillingCard API?
I think adding basic validation is a good idea. Our API will throw if the number is not valid, but we should try to prevent unnecessary API calls on the front end if possible.
What params our User_AddBillingCard API takes?
cardNumber, cardYear, cardMonth, cardCVV, addressName, addressZip
addressName is the user's name, not the address. I noticed that the API call doesn't take the city/state/address which is weird, so I asked for some clarity internally on whether those fields are needed.
I noticed that the API call doesn't take the city/state/address which is weird, so I asked for some clarity internally on whether those fields are needed.
We still want those fields as they will be used in the future, but for now we will just throw that data away (not send it to the server)
I think adding basic validation is a good idea. Our API will throw if the number is not valid, but we should try to prevent unnecessary API calls on the front end if possible.
Sounds good! I think that a good basic validation for the front is checking for 16 chars, digits-only.
Apart from the steps in the issue, I think we also want to:
- Wrap our
AddDebitCardPagein aKeyboardAvoidingViewso that our inputs aren't hidden by the keyboard on mobile. We can make theAdd Debit Cardbutton stick at the top of the keyboard like in our other forms - Add the
validateDebitCardmethod that we mentioned - Get an icon from the design team to add to our
Add Payment Methodmenu - like we do for the Paypal option. - Change our check for showing the
Add Payment Methodmenu to account for the new payment method.
Let me know if I can start working on this one or if I'm missing something @stitesExpensify!
Sounds good! I think that a good basic validation for the front is checking for 16 chars, digits-only.
Some credit cards such as amex actually only have 15 chars so we should probably check for 15 or 16. If we want to get fancy we could also do the Luhn algorithm like this solution
Wrap our AddDebitCardPage in a KeyboardAvoidingView so that our inputs aren't hidden by the keyboard on mobile. We can make the Add Debit Card button stick at the top of the keyboard like in our other forms
Add the validateDebitCard method that we mentioned
Sounds good
Get an icon from the design team to add to our Add Payment Method menu - like we do for the Paypal option.
I think we can just use the CreditCard icon that is already in expensicons.js
Change our check for showing the Add Payment Method menu to account for the new payment method.
I'm reverting this to always show the button so don't worry about that part :smile:
I think you're good to go and start working on this!
@rdjuric let me know if you're still taking this one, and I will hire you in Upwork :)
@laurenreidexpensify I've started work on this one already!
@rdjuric can you confirm the PR for this one? Thanks
@rdjuric bump :) can you link the PR pls
Sorry @laurenreidexpensify! Linking it today 😁
@stitesExpensify, @rdjuric, @laurenreidexpensify it looks like no one is assigned to work on this job. Please double the price or add a comment stating why the job isn't being doubled.
@MelvinBot PR is in progress and linked, should be ready for review really soon