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] Invoice - No option 'Pay via Expensify' for receiver #48486

Closed
1 of 6 tasks
lanitochka17 opened this issue Sep 3, 2024 · 11 comments
Closed
1 of 6 tasks

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

lanitochka17 opened this issue Sep 3, 2024 · 11 comments
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 3, 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.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?

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6591768_1725371898335.pay_invoice.mp4

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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

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.

Copy link
Contributor

github-actions bot commented Sep 3, 2024

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

@MuaazArshad
Copy link
Contributor

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

if (canUseWallet || (isExpenseReport && shouldShowPaywithExpensifyOption)) {
buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
}
if (shouldShowPayElsewhereOption) {
buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]);
}
if (isInvoiceReport) {
if (ReportUtils.isIndividualInvoiceRoom(chatReport)) {
buttonOptions.push({
text: translate('iou.settlePersonal', {formattedAmount}),
icon: Expensicons.User,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
backButtonText: translate('iou.individual'),
subMenuItems: [
{
text: translate('iou.payElsewhere', {formattedAmount: ''}),
icon: Expensicons.Cash,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
},
],
});
}
if (PolicyUtils.isPolicyAdmin(primaryPolicy) && PolicyUtils.isPaidGroupPolicy(primaryPolicy)) {
buttonOptions.push({
text: translate('iou.settleBusiness', {formattedAmount}),
icon: Expensicons.Building,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
backButtonText: translate('iou.business'),
subMenuItems: [
{
text: translate('iou.payElsewhere', {formattedAmount: ''}),
icon: Expensicons.Cash,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, true),
},
],
});
}
}
if (shouldShowApproveButton) {
buttonOptions.push(approveButtonOption);

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
Copy link
Contributor

Tony-MK commented Sep 3, 2024

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.

if (isInvoiceReport) {
if (ReportUtils.isIndividualInvoiceRoom(chatReport)) {
buttonOptions.push({
text: translate('iou.settlePersonal', {formattedAmount}),
icon: Expensicons.User,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
backButtonText: translate('iou.individual'),
subMenuItems: [
{
text: translate('iou.payElsewhere', {formattedAmount: ''}),
icon: Expensicons.Cash,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
},
],
});
}

This also happens in the dropdown for business.

buttonOptions.push({
text: translate('iou.settleBusiness', {formattedAmount}),
icon: Expensicons.Building,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
backButtonText: translate('iou.business'),
subMenuItems: [
{
text: translate('iou.payElsewhere', {formattedAmount: ''}),
icon: Expensicons.Cash,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, true),
},

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
Copy link
Contributor

jaydamani commented Sep 3, 2024

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

const canUseWallet = !isExpenseReport && !isInvoiceReport && currency === CONST.CURRENCY.USD;

if (canUseWallet) {
buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]);
}

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
Copy link
Contributor

Updated proposal

  • Added explicit mention of change in canUseWallet for clarification

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Sep 3, 2024
@melvin-bot melvin-bot bot changed the title Invoice - No option 'Pay via Expensify' for receiver [$250] Invoice - No option 'Pay via Expensify' for receiver Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

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

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

melvin-bot bot commented Sep 3, 2024

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

@twisterdotcom
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

7 participants