App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-10-13] [P2P in E.cash] Add Debit Card Page

Open laurenreidexpensify opened this issue 5 years ago • 43 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


  1. Add a new file Pages/Settings/Payments/AddDebitCardPage.js
  2. Add a new method to API.js addBillingCard(data) which calls the Web-Secure command User_AddBillingCard
  3. 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
  4. Add a new route ROUTES.SETTINGS_ADD_DEBIT_CARD
  5. Add the new page to the modalStackNavigator
  6. Add navigating to the new page from the "Add Payment Methods" menu

2021-07-07_11-25-27

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

laurenreidexpensify avatar Jul 07 '21 10:07 laurenreidexpensify

Triggered auto assignment to @mitchexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Jul 07 '21 10:07 MelvinBot

Triggered auto assignment to @Luke9389 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Jul 07 '21 10:07 MelvinBot

Hello @laurenreidexpensify,

I would love to work on this task.

Proposal:

  1. Add a new file Pages/Settings/Payments/AddDebitCardPage.js
  2. Add a new method to API.js addBillingCard(data) which calls the Web-Secure command User_AddBillingCard
  3. 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
  4. Add a new route ROUTES.SETTINGS_ADD_DEBIT_CARD
  5. Add the new page to the modalStackNavigator
  6. Add navigating to the new page from the "Add Payment Methods" menu

attaradev avatar Jul 07 '21 20:07 attaradev

@mikeattara do you have any other details about how you would implement this to consider? Thanks

laurenreidexpensify avatar Jul 12 '21 13:07 laurenreidexpensify

The price for this has been increased to $500

laurenreidexpensify avatar Jul 19 '21 11:07 laurenreidexpensify

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 ValidationUtils to validate if it's a valid debit card number? Or it's okay to send unvalidated numbers to our User_AddBillingCard API?
  • What params our User_AddBillingCard API takes?

rdjuric avatar Jul 19 '21 12:07 rdjuric

@Luke9389 can you cover the Qs from @rdjuric while Brandon is OOO today? thanks

laurenreidexpensify avatar Jul 19 '21 13:07 laurenreidexpensify

Any updates here @Luke9389 @stitesExpensify?

rdjuric avatar Jul 23 '21 23:07 rdjuric

@Luke9389 @stitesExpensify any update here for @rdjuric ?

laurenreidexpensify avatar Jul 26 '21 09:07 laurenreidexpensify

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.

stitesExpensify avatar Jul 26 '21 22:07 stitesExpensify

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)

stitesExpensify avatar Jul 27 '21 15:07 stitesExpensify

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 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
  • Get an icon from the design team to add to our Add Payment Method menu - like we do for the Paypal option.
  • Change our check for showing the Add Payment Method menu 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!

rdjuric avatar Jul 27 '21 16:07 rdjuric

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!

stitesExpensify avatar Jul 27 '21 16:07 stitesExpensify

@rdjuric let me know if you're still taking this one, and I will hire you in Upwork :)

laurenreidexpensify avatar Jul 28 '21 19:07 laurenreidexpensify

@laurenreidexpensify I've started work on this one already!

rdjuric avatar Jul 28 '21 22:07 rdjuric

@rdjuric can you confirm the PR for this one? Thanks

laurenreidexpensify avatar Aug 02 '21 13:08 laurenreidexpensify

@rdjuric bump :) can you link the PR pls

laurenreidexpensify avatar Aug 03 '21 10:08 laurenreidexpensify

Sorry @laurenreidexpensify! Linking it today 😁

rdjuric avatar Aug 03 '21 11:08 rdjuric

@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 avatar Aug 04 '21 19:08 MelvinBot

@MelvinBot PR is in progress and linked, should be ready for review really soon

rdjuric avatar Aug 04 '21 19:08 rdjuric