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

Fix P2P Debit cards are being displayed twice on the Payments page #12178

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

Justicea83
Copy link
Contributor

@Justicea83 Justicea83 commented Oct 27, 2022

Details

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/233319

Tests

First Add a card

  1. Sign In to NewDot

  2. Navigate to Settings > Payments > Add payment method > Debit card

  3. Fill the form with any details, but use 4242 4242 4242 4242 for the card number

  4. Signin to NewDot.

  5. Click on your profile picture > Payments.

  6. If you have a card is a payment method, ensure it's not duplicated as a bank account.

Tests For RBR handling for payment methods from here:

  1. Modify your Onyx data to include an error in the bank accounts
  2. First start by exposing Onyx to the window by adding window.Onyx = Onyx; to setup/index.js
  3. Then in the console, you should be able to do something like below with an existing bank account
    Onyx.merge('bankAccountList', {"827591": {pendingAction: 'delete', errors: {1: 'This is an error'}}})
  4. Verify that when you go to Settings, you see the error dot on the 'Payments' tab like below, and when you click on the payments tab you see the error
  5. Verify you can click on the x to remove the error
2022-10-27_14-23-32.mp4

QA Steps

First Add a card.

  1. Ensure you have a card added as a payment method.

Tests

  1. Signin to NewDot.
  2. Click on your profile picture > Payments.
  3. If you have a card is a payment method, ensure it's not duplicated as a bank account.

QA for RBR handling for payment methods:

  1. Signin to NewDot.
  2. Go offline.
  3. Click on your profile picture > Payments.
  4. Click on any payment method item on the list > Make default payment method
  5. Enter a wrong password.
  6. Come back online and see the RBR and the error message like in the screenshot below.

Screenshot 2022-10-27 at 3 34 03 PM

  1. Ensure your previous payment method is the one that is still marked as default.

PR Review Checklist

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

Screenshot 2022-10-27 at 12 32 51 PM

Mobile Web - Chrome

Screenshot 2022-10-27 at 12 33 07 PM

Mobile Web - Safari

Screenshot 2022-10-27 at 12 34 41 PM

Desktop

Screenshot 2022-10-27 at 12 42 13 PM

iOS

Screenshot 2022-10-27 at 12 51 04 PM

Android

Screenshot 2022-10-27 at 12 47 56 PM

@Justicea83 Justicea83 self-assigned this Oct 27, 2022
@Justicea83 Justicea83 marked this pull request as ready for review October 27, 2022 12:03
@Justicea83 Justicea83 requested a review from a team as a code owner October 27, 2022 12:03
@Justicea83 Justicea83 requested review from a team and removed request for a team October 27, 2022 12:03
@melvin-bot melvin-bot bot requested review from joelbettner, parasharrajat and Gonals and removed request for a team October 27, 2022 12:03
Copy link
Contributor

@MariaHCD MariaHCD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good but can you also please add tests for the red brick road for payment methods? Example, when you try to set a bank account and/or debit card as your default payment method when offline and entered the wrong password.

In addition, just as a heads up, QA will not be able to add a debit card on staging. So this might need to be tested internally with someone who can add a real US debit card.

@Justicea83 Justicea83 added the InternalQA This pull request required internal QA label Oct 27, 2022
@Justicea83 Justicea83 requested a review from MariaHCD October 27, 2022 13:25
@Justicea83
Copy link
Contributor Author

Updated the PR description

@parasharrajat
Copy link
Member

Let me know if C+ review is needed.

@Justicea83
Copy link
Contributor Author

Please can the reviewers check the PR review checklist, so I can get this merged ASAP?

@Justicea83
Copy link
Contributor Author

@parasharrajat , maybe you can test this and check off the PR reviewer checklist?

@parasharrajat
Copy link
Member

Sure, I will try to test it.

@parasharrajat
Copy link
Member

parasharrajat commented Nov 1, 2022

I can't test it unless someone share instruction to add a debit card.

@Gonals
Copy link
Contributor

Gonals commented Nov 2, 2022

  • Verify that when you go to Settings, you see the error dot on the 'Payments' tab like below, and when you click on the payments tab you see the error

What are you missing? Aren't the instructions on the main post enough?

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 2, 2022

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 2, 2022

Aren't the instructions on the main post enough?

Not quite, C+ and Qa can't test this because there is no way to add a test debit card on staging currently. We're working on it on this internal issue: https://github.com/Expensify/Expensify/issues/237181#issuecomment-1298509438

In addition, I think the test instructions to add a debit card could be more descriptive, @Justicea83. We normally outline the data to be entered in the form.

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 2, 2022

iOS / native

Simulator.Screen.Recording.-.iPhone.14.-.2022-11-02.at.15.05.15.mp4

Android / native

Screen.Recording.2022-11-02.at.3.14.00.PM.mov

iOS / Safari

Simulator.Screen.Recording.-.iPhone.14.-.2022-11-02.at.15.03.48.mp4

Android / Chrome

Screen.Recording.2022-11-02.at.3.17.08.PM.mov

MacOS / Chrome

Screen.Recording.2022-11-02.at.2.37.27.PM.mov

MacOS / Desktop

Screen.Recording.2022-11-02.at.3.23.59.PM.mov

@MariaHCD MariaHCD merged commit 451c971 into main Nov 2, 2022
@MariaHCD MariaHCD deleted the justice-pp-debit-cards-are-being-displayed-twice branch November 2, 2022 11:36
@melvin-bot
Copy link

melvin-bot bot commented Nov 2, 2022

Triggered auto assignment to @amyevans (InternalQA), see https://stackoverflow.com/c/expensify/questions/5042 for more details.

@OSBotify
Copy link
Contributor

OSBotify commented Nov 2, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Nov 2, 2022

🚀 Deployed to staging by @MariaHCD in version: 1.2.23-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@amyevans
Copy link
Contributor

amyevans commented Nov 3, 2022

✅ QA passes

Card is only listed once:
Screen Shot 2022-11-03 at 10 45 40 AM

RBR after coming back online:
Screen Shot 2022-11-03 at 10 47 53 AM

@OSBotify
Copy link
Contributor

OSBotify commented Nov 4, 2022

🚀 Deployed to production by @Julesssss in version: 1.2.23-9 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
InternalQA This pull request required internal QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants