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

[HOLD for payment 2024-04-09] [$500] Clicking on debit card option on the pay with Expensify button does nothing #38641

Closed
1 of 6 tasks
m-natarajan opened this issue Mar 19, 2024 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

@m-natarajan
Copy link

m-natarajan commented Mar 19, 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: 1.4.54-1
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: @parasharrajat
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710845227712549

Action Performed:

  1. Open app and request money from workspace chat or from other user
  2. Open the IOU report
  3. Click on pay with expensify option from the top right corner of the page
  4. Select option debit card

Expected Result:

User taken to debit card adding flow

Actual Result:

Nothing happens clicking on debit card

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

Recording.2876.mp4
Screen.Recording.2024-03-19.at.4.16.07.PM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d862972a492e6ec4
  • Upwork Job ID: 1770414879181062144
  • Last Price Increase: 2024-03-20
  • Automatic offers:
    • abzokhattab | Contributor | 0
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Mar 19, 2024

Proposal

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

Clicking on debit card option on the pay with Expensify button does nothing

What is the root cause of that problem?

the onItemSelected function is called with the CONST.PAYMENT_METHODS.DEBIT_CARD in case the the debit card option is selected.

onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD),

then here we check if the selected option is debit card, then we navigate to the addDebitCardRoute passed in the props

} else if (paymentMethod === CONST.PAYMENT_METHODS.DEBIT_CARD) {
Navigation.navigate(addDebitCardRoute);

then we use the KYC in the SettlementButton and we pass to it the addDebitCardRoute passed from the component props:

onSuccessfulKYC={onPress}
enablePaymentsRoute={enablePaymentsRoute}
addBankAccountRoute={addBankAccountRoute}
addDebitCardRoute={addDebitCardRoute}
isDisabled={isOffline}
source={CONST.KYC_WALL_SOURCE.REPORT}
chatReportID={chatReportID}
iouReport={iouReport}
anchorAlignment={kycWallAnchorAlignment}
shouldShowPersonalBankAccountOption={shouldShowPersonalBankAccountOption}
>
{(triggerKYCFlow, buttonRef) => (

the issue appears because we dont pass the addDebitCardRoute in the SettlementButton

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

we should add addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD} same as we are doing here to the following files:

we can use the ROUTES.SETTINGS_ADD_DEBIT_CARD instead as well, but since we are using ROUTES.IOU_SEND_ADD_DEBIT_CARD in the MoneyRequestConfirmationList then we should keep it consistent i think.

<SettlementButton
currency={moneyRequestReport.currency}
policyID={moneyRequestReport.policyID}
chatReportID={moneyRequestReport.chatReportID}
iouReport={moneyRequestReport}
// @ts-expect-error TODO: Remove this once IOU (https://github.com/Expensify/App/issues/24926) is migrated to TypeScript.
onPress={(paymentType: PaymentType) => IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport)}
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
shouldHidePaymentOptions={!shouldShowPayButton}
shouldShowApproveButton={shouldShowApproveButton}
formattedAmount={formattedAmount}
isDisabled={!canAllowSettlement}
/>

<SettlementButton
currency={moneyRequestReport.currency}
policyID={moneyRequestReport.policyID}
chatReportID={chatReport?.reportID}
iouReport={moneyRequestReport}
// @ts-expect-error TODO: Remove this once IOU (https://github.com/Expensify/App/issues/24926) is migrated to TypeScript.
onPress={(paymentType: PaymentType) => IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport)}
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
shouldHidePaymentOptions={!shouldShowPayButton}
shouldShowApproveButton={shouldShowApproveButton}
style={[styles.pv2]}
formattedAmount={formattedAmount}
isDisabled={!canAllowSettlement}
/>

<SettlementButton
currency={iouReport?.currency}
policyID={policyID}
chatReportID={chatReportID}
iouReport={iouReport}
onPress={(paymentType?: PaymentMethodType) => chatReport && iouReport && paymentType && IOU.payMoneyRequest(paymentType, chatReport, iouReport)}
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
shouldHidePaymentOptions={!shouldShowPayButton}
shouldShowApproveButton={shouldShowApproveButton}
kycWallAnchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
paymentMethodDropdownAnchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
isDisabled={!canAllowSettlement}
/>

@parasharrajat
Copy link
Member

That's what I was thinking the issue might be.

@allgandalf
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

We have default empty value in settlement button for addDebitCardRoute

function SettlementButton({
addDebitCardRoute = '',

This in turn doesn't give us any action on click to the add debit card button as we have no route mentioned:

<KYCWall
onSuccessfulKYC={onPress}
enablePaymentsRoute={enablePaymentsRoute}
addBankAccountRoute={addBankAccountRoute}
addDebitCardRoute={addDebitCardRoute}

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

I assume we must always enable the debit card option on every request, so better is to update the default value of addDebitCardRoute to:

function SettlementButton({ 
     addDebitCardRoute ={ROUTES.SETTINGS_ADD_DEBIT_CARD}, 
     

What alternative solutions did you explore? (Optional)

N/A

@allgandalf
Copy link
Contributor

Note

I think we should use SETTINGS_ADD_DEBIT_CARD than IOU_SEND_ADD_DEBIT_CARD, as this would then set the wallet card as well

@abzokhattab
Copy link
Contributor

Updated the proposal: optionally we can use the SETTINGS_ADD_DEBIT_CARD instead of the IOU_SEND_ADD_DEBIT_CARD

@parasharrajat
Copy link
Member

@abzokhattab's proposal makes sense to me. @dylanexpensify Let's roll here.

@allgandalf
Copy link
Contributor

@parasharrajat , what do you think about my proposal?

Doesn’t it make sense to have the route in the base component itself, I guess in the roadmap we plan to add this settlement button in invoices too, so maybe it’s more future proof??

c.c. @dylanexpensify

@parasharrajat
Copy link
Member

@GandalfGwaihir That is better but can not be given more weight regarding proposals. I would call that implementation detail. The main idea still lies around setting the missing param with the correct value.

@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Mar 20, 2024
@melvin-bot melvin-bot bot changed the title Clicking on debit card option on the pay with Expensify button does nothing [$500] Clicking on debit card option on the pay with Expensify button does nothing Mar 20, 2024
Copy link

melvin-bot bot commented Mar 20, 2024

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

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

melvin-bot bot commented Mar 20, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 20, 2024
@dylanexpensify
Copy link
Contributor

rock and roll @parasharrajat

@allgandalf
Copy link
Contributor

@GandalfGwaihir That is better but can not be given more weight regarding proposals. I would call that implementation detail. The main idea still lies around setting the missing param with the correct value.

But i think it would be important to consider right approach over here :)

@parasharrajat
Copy link
Member

I agree that we should move with the right approach but setting a default value or writing a code in a specific way is just implementation details. These things are cleared up in the PRs. I also thought of setting a default value when I found this bug.

@allgandalf
Copy link
Contributor

allgandalf commented Mar 20, 2024

ohh cool, no worries, fine with whatever decision you and the internal engineer take

@parasharrajat
Copy link
Member

parasharrajat commented Mar 20, 2024

@abzokhattab's proposal makes sense to me. IMO, ROUTES.IOU_SEND_ADD_DEBIT_CARD is the correct route for this.

Thanks for the proposal @GandalfGwaihir. There are always new opportunities waiting for solutions. Looking forward to your contributions there.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 20, 2024

Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Mar 21, 2024

📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@parasharrajat
Copy link
Member

@abzokhattab When can we expect the PR?

@abzokhattab
Copy link
Contributor

Thank you Rajat @parasharrajat for the ping, the PR will be ready today.

@abzokhattab
Copy link
Contributor

The PR is ready! please check it out and let me know if you have any comments.

@dylanexpensify
Copy link
Contributor

Bump @stitesExpensify to final review for merge today if you can! ❤️

@stitesExpensify
Copy link
Contributor

Merged!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 2, 2024
@melvin-bot melvin-bot bot changed the title [$500] Clicking on debit card option on the pay with Expensify button does nothing [HOLD for payment 2024-04-09] [$500] Clicking on debit card option on the pay with Expensify button does nothing Apr 2, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Apr 2, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-04-09. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Apr 2, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@parasharrajat] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@parasharrajat] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@parasharrajat
Copy link
Member

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

Regression Test Steps

  1. Open the app and request money from workspace chat or from another user
  2. Login with other user and Open the IOU report
  3. Click on pay with expensify option from the top right corner of the report.
  4. Select debit card.
  5. Verify that the iou debit card page is opened

Do you agree 👍 or 👎 ?

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Apr 8, 2024
@dylanexpensify
Copy link
Contributor

Payment summary:

Please apply or request!

@melvin-bot melvin-bot bot removed the Overdue label Apr 9, 2024
@dylanexpensify
Copy link
Contributor

Done

@parasharrajat
Copy link
Member

Payment requested as per #38641 (comment)

@JmillsExpensify
Copy link

$500 approved for @parasharrajat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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
None yet
Development

No branches or pull requests

8 participants