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

[$250] Approvers Flow - Admin gets error when paying expense to employee without bank account #48545

Closed
6 tasks done
IuliiaHerets opened this issue Sep 4, 2024 · 9 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 4, 2024

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: 9.0.29-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4922007
Email or phone of affected tester (no customers): fischer9966+090324badm@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition NewDot:

  1. Create admin account with Gmail
  2. Create Collect workspace, set Workflows to enabled
  3. Invite Employee with Gmail accounts to this workspace
  4. Enable Approvals in Workflows and set Admin as Approver
  5. Enable Workflows > Delay submissions and set it to Manually
  6. Login as the employee and submit a report
  7. Login as the admin and approve this report

Precondition OldDot:

  1. Login to OD as Admin
  2. Go to Collect workspace > Reimbursements
  3. Select "Direct" and connect Bank account

Steps NewDot:

  1. Go to staging.new.expensify.com or open App
  2. Login as the admin and pay report from precondition steps with bank account

Expected Result:

Admin gets a message "Payment is on hold until Employee One adds a bank account." Report in approved state. No payment button.

Actual Result:

Admin gets an error message "An unexpected error occurred. Please try again." Expense remains unpaid. "Pay with bank account" button is present.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6592476_1725422494666.Web-Admin-gets-error-pay-expense-to-employee-without-BA.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021831395256513073087
  • Upwork Job ID: 1831395256513073087
  • Last Price Increase: 2024-09-04
Issue OwnerCurrent Issue Owner: @akinwale
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@sakluger FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Sep 4, 2024
@melvin-bot melvin-bot bot changed the title Approvers Flow - Admin gets error when paying expense to employee without bank account [$250] Approvers Flow - Admin gets error when paying expense to employee without bank account Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

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

@trjExpensify
Copy link
Contributor

@IuliiaHerets it would be super helpful to open the JS console > network, then press the button to hit the error, and check the response of the failed API command.

@trjExpensify
Copy link
Contributor

Internal logs

Throw ExpException - d1cbd3c64a46b9acc503d06b59a1e863 ~~ message: '403 Invalid payment type' exceptionMessage: 'Auth PayMoneyRequest returned an error' exceptionFile: '/git/releases/expensify.com/544aee4/lib/Auth.php' exceptionLine: '128' exceptionCode: '403'
API threw ExpError Expensify\Libs\Error\ExpError - 85427d9f-f33a-47af-ae93-2249272d9fa6 ~~ onyxData: '[0: '[onyxMethod: 'merge' key: 'reportActions_1878202399790691' value: '[8653849744632496594: '[errors: '[1725421051483334: 'An unexpected error occurred. Please try again.']']']']']' exceptionJsonCode: '666' exceptionUserMessage: 'An unexpected error occurred. Please try again.' exceptionMessage: 'An unexpected error occurred. Please try again.' exceptionFile: '/git/releases/expensify.com/544aee4/lib/ReportAPI.php' exceptionLine: '5085' exceptionCode: '666'

That's throwing in Auth here: https://github.com/Expensify/Auth/blob/47faeb84d60f0f9b7a56f99dc5f4e8e533c7ee54/auth/command/PayMoneyRequest.cpp#L138-L142

    paymentType = request["paymentType"];
    const set<string> allowedPaymentTypes = {Report::PAYMENT_TYPE_ELSEWHERE, Report::PAYMENT_TYPE_ACH};
    if (!SContains(allowedPaymentTypes, paymentType)) {
        STHROW("403 Invalid payment type");
    }

I suspect this is another bug coming from changes made in this issue and this PR.

We can see here in the payMoneyRequest request that the paymentMethodType is businessBankAccount and that's not valid, so we're hitting the error paying expense reports.

Processing 'PayMoneyRequest' for 'expensify.com' from '50.88.198.46' ~~ browserGUID: '66d7c963cdbeb' initialReferer: '<REDACTED>' command: 'PayMoneyRequest' iouReportID: '1878202399790691' chatReportID: '7261543974099434' reportActionID: '8653849744632496594' paymentMethodType: 'businessBankAccount' full: 'true' amount: '11000' pusherSocketID: '766448.11880468' authToken: '<REDACTED>' referer: 'ecash' platform: 'ios' api_setCookie: 'false' email: 'fischer9966+090324badm@gmail.com' isFromDevEnv: 'false' appversion: '9.0.29-0' clientUpdateID: '1599539467' partnerName: 'expensify.com' HTTP_CF_BOT_SCORE: '99' HTTP_CF_JA3_HASH: 'b76d503360ae441d410a85a7f8d648ab'

@trjExpensify
Copy link
Contributor

Going to fix this with a revert here: #48639 (comment)

@trjExpensify trjExpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 5, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 9, 2024
@mountiny
Copy link
Contributor

mountiny commented Sep 9, 2024

Do we need to keep this opened? Or assigned someone who is leading charge on the refactor?

@melvin-bot melvin-bot bot removed the Overdue label Sep 9, 2024
@trjExpensify
Copy link
Contributor

Nah, we can use the parent issue for the PR that tried to introduce these changes.

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 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants