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

fix: Disable mobile payment refunds from ecommerce #8

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

jawad-khan
Copy link

⛔️ MAIN BRANCH WARNING! 2U EMPLOYEES must make branches against the 2u/main BRANCH

  • I have checked the branch to which I would like to merge.

⛔️ DEPRECATION WARNING

This repository is deprecated and in maintainence-only operation while we work on a replacement, please see this announcement for more information.

Although we have stopped integrating new contributions, we always appreciate security disclosures and patches sent to [email protected]

Anyone internally merging to this repository is expected to release and monitor their changes; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.

Required Testing

  • Before deploying this change, complete a purchase in the stage environment.
    (^ We can remove that manual check once REV-2624 is done and the corresponding e2e test runs again)

Description

The process for mobile refunds follows a distinct flow that requires users to visit the relevant app store to receive their refunds. However, there are instances where the support team mistakenly processes refunds through the eCommerce platform, which is not the correct procedure. To address this, the eCommerce refund option for the support team is being disabled in this PR.

Useful information to include:

  • This will effect support team which apply for refunds in ecommerce.

Supporting information

Jira Ticket: https://2u-internal.atlassian.net/browse/LEARNER-9948

Copy link

@christopappas christopappas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved, just 1 comment on an idea to consider, but not blocking

Comment on lines 90 to 91
processor_responses = order.basket.paymentprocessorresponse_set.all()
return any(response.processor_name in MOBILE_PAYMENT_PROCESSORS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect MOBILE_PAYMENT_PROCESSORS is fairly small, but I think iterating over the processor_responses variable will make 1 db call for each item (unless it had been prefetched ahead of time). You might consider doing something like order.basket.paymentprocessorresponse_set.filter(name__in= MOBILE_PAYMENT_PROCESSORS).exists() which I THINK might do it in 1 DB call (untested of course though)

Not a blocking comment by any means, but think it's worth thinking about potentially

@jawad-khan jawad-khan merged commit 505095a into 2u/main Sep 27, 2024
7 checks passed
@jawad-khan jawad-khan deleted the LEARNER-9948 branch September 27, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants