Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.34k stars 2.77k forks source link

[$250] Invoice - No option 'Pay via Expensify' for receiver #48486

Closed lanitochka17 closed 2 weeks ago

lanitochka17 commented 2 weeks ago

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.28-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?/cases/view/3073288 Issue reported by: Applause - Internal Team

Action Performed:

Precondition: workspace with a member added

  1. Click FAB > Send invoice
  2. Enter amount
  3. Choose receiver
  4. Choose workspace
  5. Send invoice
  6. As a receiver, open invoice room
  7. Click on invoice preview
  8. Click on Pay button in a header

Expected Result:

There are options 'Pay elsewhere' and 'Pay via Expensify' in a button dropdown

Actual Result:

There are options 'Pay as business' and 'Pay as an individual' in a button dropdown. No 'Pay via Expensify'

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/a302086f-49eb-4d4f-b807-b95023606d3b

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015c21e7f83c78f5bb
  • Upwork Job ID: 1831071012017220335
  • Last Price Increase: 2024-09-03
Issue OwnerCurrent Issue Owner: @jayeshmangwani
melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @twisterdotcom (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.

github-actions[bot] commented 2 weeks ago

@user Your proposal will be dismissed because you did not follow the proposal template.

MuaazArshad commented 2 weeks ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

No option 'Pay via Expensify' for receiver

What is the root cause of that problem?

We are not pushing pay with expensify option in button options https://github.com/Expensify/App/blob/013913357f7bd5844efbc631bba0a2518e5abfb8/src/components/SettlementButton.tsx#L215-L260

What changes do you think we should make in order to solve the problem?

We can push pay with expensify option

if (shouldShowPaywithExpensifyOption) {
            buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.VBBA]);
        }

What alternative solutions did you explore? (Optional)

Tony-MK commented 2 weeks ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Invoice - No option 'Pay via Expensify' for receiver

What is the root cause of that problem?

The subMenuItems for both the pay as a business and individual do not include the settle with Expensify option.

Hence the buttonOptions only includes the option to pay the iou elsewhere.

https://github.com/Expensify/App/blob/013913357f7bd5844efbc631bba0a2518e5abfb8/src/components/SettlementButton.tsx#L223-L239

This also happens in the dropdown for business.

https://github.com/Expensify/App/blob/013913357f7bd5844efbc631bba0a2518e5abfb8/src/components/SettlementButton.tsx#L242-L253

What changes do you think we should make in order to solve the problem?

We should add the settle with Expensify option in the subMenuItems array on this line with the code snippet below.

While checking for shouldShowPaywithExpensifyOption and isExpenseReport like this line.

...(isExpenseReport && shouldShowPaywithExpensifyOption ? [{
    text: translate('iou.settleExpensify', {formattedAmount : ''}),
    icon: Expensicons.Wallet,
    value: CONST.IOU.PAYMENT_TYPE.VBBA,
    onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.VBBA),
}] : []),

Or we can push the settle with Expensify option in the subMenuItems before pushing it to the buttonOptions over here.

jaydamani commented 2 weeks ago

Edited by proposal-police: This proposal was edited at 2023-10-02T00:00:00Z.

Proposal

Please re-state the problem that we are trying to solve in this issue.

No Pay via Expensify option for invoice

What is the root cause of that problem?

The cause is separate for main and staging, In main: The logic for adding "Pay with Expensify" button was removed by this PR which reapplies this PR

In staging (9.0.28-1): The "Pay with Expensify" button is not added if the iouReport is an invoice https://github.com/Expensify/App/blob/a124e4fbbd7a678d3ebae253f3d8fff940c0e528/src/components/SettlementButton.tsx#L198

https://github.com/Expensify/App/blob/a124e4fbbd7a678d3ebae253f3d8fff940c0e528/src/components/SettlementButton.tsx#L209-L211

The check for !isInvoiceReport was added by this commit which is part of previously mentioned PR but the final changes do not show the change, which is weird.

What changes do you think we should make in order to solve the problem?

Add back the changes to bring back the button. Mainly, we need to add back the value in paymentMethod object and the code to push it in buttonOptions. Then remove !isInvoiceReport from canUseWallet.

If the invoice report needs to be part of canUseWallet then we can make a new similar variable for this called showPayViaExpensify.

https://github.com/Expensify/App/pull/37174/files#diff-475fc90a9838cf6b734f4c860eb57036c3fe04ac7b4c429d1b4e361109aaa6f4L175-L179

https://github.com/Expensify/App/pull/37174/files#diff-475fc90a9838cf6b734f4c860eb57036c3fe04ac7b4c429d1b4e361109aaa6f4L175-L179

What alternative solutions did you explore? (Optional)

jaydamani commented 2 weeks ago

Updated proposal

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

twisterdotcom commented 2 weeks ago

Hmm... actually... I wonder if these expected result steps are wrong:

Expected Result:

There are options 'Pay elsewhere' and 'Pay via Expensify' in a button dropdown

Actual Result:

There are options 'Pay as business' and 'Pay as an individual' in a button dropdown. No 'Pay via Expensify'

@davidcardoza is this right now? I feel like this makes more sense.

davidcardoza commented 2 weeks ago

Users can't pay an invoice via Expensify just yet. The options should be

  1. Pay as a business
  2. Pay as an individual

Regardless of the selection "Pay elsewhere" should be the only option. We're prioritizing invoice payments as part of the VIP-Bill-pay project. @madmax330

twisterdotcom commented 2 weeks ago

Okay, I think this is just a bug with an ongoing project right? I don't think we need to open this up to contributors right now.