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

[P2P Activation] [CRITICAL] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. #29714

Closed
1 of 6 tasks
kbecciv opened this issue Oct 16, 2023 · 21 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Oct 16, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.3.84.9
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @kevinksullivan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697481375175609

Action Performed:

  1. User A: login, navigate to Settings > Wallet
  2. User A: add personal bank account
  3. User B: login, select Request money
  4. User B: enter User A as the person you're requesting from
  5. User A: Navigate to IOU from User B
  6. User A: select Pay with Expensify

Expected Result:

User A should go straight to Additional details step, rather than prompting the user to choose a bank account or debit card if they already have a connected payment method

Actual Result:

User A is prompted to choose between bank account and debit card, even though they have a bank account added. Then, if they choose bank account, they're asked to add a new one.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

image (11)
image (10)

Recording.5023.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f0f7b78b540bf02c
  • Upwork Job ID: 1714019025148497920
  • Last Price Increase: 2023-10-16
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot changed the title Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. [$500] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01f0f7b78b540bf02c

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

@kevinksullivan
Copy link
Contributor

Note: I am also seeing this issue when I try to make a payment while having an upgraded wallet and a bank account.

IMG_78B37CA61763-1

@kevinksullivan kevinksullivan removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 17, 2023
@kevinksullivan kevinksullivan changed the title [$500] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. [P2P Activation] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. Oct 17, 2023
@dylanmwilliams
Copy link

To fix the issue where the "Pay with Expensify" button is prompting the user to choose between a bank account or a debit card, even when they already have an existing bank account linked to their account, you should check if the user has an existing bank account and then add logic to check whether the user already has a linked bank account. If they do, you should automatically select the bank account option instead of prompting them to choose between a bank account and a debit card.

I would update the AddPaymentMethodMenu component and check whether the user has an existing bank account. If they do, automatically select the bank account option and hide the debit card option. You can do this by modifying the menuItems prop based on the user's existing bank account status.

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

📣 @dylanmwilliams! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@dylanmwilliams
Copy link

Contributor details
Your Expensify account email: dylan.mi.williams@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~011e25648c523f48bc

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@hoangzinh
Copy link
Contributor

@dylanmwilliams please follow our proposal template here https://github.com/Expensify/App/blob/main/contributingGuides/PROPOSAL_TEMPLATE.md. Just in case you haven't read it, please read our contributing guidelines here https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md

@hoangzinh
Copy link
Contributor

btw @kevinksullivan this issue is not ready for contributors, isn't it?

@akinwale
Copy link
Contributor

btw @kevinksullivan this issue is not ready for contributors, isn't it?

The Help Wanted label was actually removed so I guess not.

In any case, I have been unable to reproduce the issue on the latest main branch.

@MariaHCD
Copy link
Contributor

I tested on main as well. Adding a PBA and then trying to pay via the wallet opens the KYC flow as expected:

Screen.Recording.2023-10-17.at.4.24.29.PM.mov

@MariaHCD
Copy link
Contributor

We use PaymentUtils.hasExpensifyPaymentMethod to check if there's already a valid bank account. As far as I can see, the isDefault prop in the Onyx bankAccountList data is available so hasExpensifyPaymentMethod should work as expected. Doing some more testing.

@MariaHCD
Copy link
Contributor

Tested on desktop:

Screen.Recording.2023-10-17.at.4.42.17.PM.mov

And android as well:

Screen.Recording.2023-10-17.at.4.43.14.PM.mov

Seems to work as expected. Going to try on staging.

@MariaHCD
Copy link
Contributor

Same on staging, I was redirected to the KYC flow as expected (it's the last step because I started the KYC flow before):

Screen.Recording.2023-10-17.at.4.51.32.PM.mov

@MariaHCD
Copy link
Contributor

Oookay, I was able to reproduce the issue when working on something else. I believe this might be a backend issue because in Onyx, there seems to be a mismatch of data in bankAccountList, the accountData.defaultCredit is false while isDefault is true:

Screenshot 2023-10-17 at 5 38 19 PM

@kevinksullivan kevinksullivan changed the title [P2P Activation] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. [P2P Activation] [CRITICAL] Web - "Pay with Expensify" button is prompting the user to choose bank account or debit card, when they already have an existing bank account linked to their account. Oct 17, 2023
@MariaHCD
Copy link
Contributor

Okay, I believe the isDefault is the correct property we should rely on here as per the backend code: https://github.com/Expensify/Web-Expensify/blob/40ccd2bbbfe54418d84343ced75616b8e64047b4/lib/BankAccountAPI.php#L1956

  • isDefault refers to whether the bank account is linked to the wallet.
  • defaultCredit refers to whether the bank account is the default deposit account for the user.

@MariaHCD
Copy link
Contributor

I think we can get the fix for this included in #29320 (comment)

@melvin-bot melvin-bot bot added the Overdue label Oct 19, 2023
@hoangzinh
Copy link
Contributor

@MariaHCD does it mean we can close this issue?

@melvin-bot melvin-bot bot removed the Overdue label Oct 20, 2023
@MariaHCD
Copy link
Contributor

This one should be fixed by these FE and BE PRs:

I think we are good to close for. We can reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

7 participants