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

Customer totals fee calculations #5931

Merged

Conversation

Matt-Yorkley
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley commented Aug 19, 2020

What? Why?

Closes #5915

Adjusts displayed payment fees to only sum "eligible" fees, which excludes adjustments on failed payments.

What should we test?

Payment and shipping fees are correct in customer Totals report. Check and order with payment fees applied, which has both a failed payment and a completed payment. The value should not include the fees for the failed payment.

Release notes

Fixed payment fee display in Customer Totals report.

…garded as applied to an order.

When an order is submitted and the payment fails, the failed payment's adjustments (payment fees) are set to `eligible: false` to indicate they do not apply. These should not be counted as being included in an order's adjustments.
@Matt-Yorkley Matt-Yorkley marked this pull request as ready for review August 20, 2020 07:51
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Superb! 😄

Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

nice!

@filipefurtad0 filipefurtad0 self-assigned this Aug 21, 2020
@filipefurtad0 filipefurtad0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Aug 21, 2020
@filipefurtad0
Copy link
Contributor

Hey @Matt-Yorkley ,

I think I've managed to reproduce this.

The numbers 36 (6 attempts) and 30 (6 attempts) are seen in the report below, from repeated attempts to pay with a transaction fee of 6 pounds, for orders with 1 item:

image

This is seen both in orders placed in the front and back office.

After staging the PR, and re-attempting to pay with invalid cards (before finishing the order with a valid payment) does not result in charging the transaction fee multiple times. Furthermore, this PR seems to correct the previously incorrect reports - this is great news! It would be great to check in production... Pinging @emilyjeanrogers here as well.

See the report below (after staging the PR), in which the previously placed orders (1 item) now have the correct amounts charged (6 pounds). The orders placed after staging the PR contain 10 items in the cart. All orders have the same transaction fee, despite multiple payment failed attempts:

image

Awesome Matt!
Ready to go.

@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Aug 21, 2020
@luisramos0 luisramos0 merged commit e616e32 into openfoodfoundation:master Aug 21, 2020
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.

Payment Method Fee Doubled in O/C Customer Totals Report
4 participants