Skip to content

fix(payments-next): Update Checkout and Upgrade pages to reflect correct amount due #19075

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xlisachan
Copy link
Contributor

@xlisachan xlisachan commented Jun 23, 2025

Because

  • the list price is being displayed instead of the price of the offering
  • on Subscription Management page, the total credit balance is deducted from all subscriptions
  • totals on Success page reflect upcoming invoice

This pull request

  • updates the price of the offering from the list price to the unit amount
  • temporary removes inaccurate upcoming invoice total from Subscription Management
  • updates Success pages for Checkout and Upgrade flow
  • updates Start page for Upgrade
  • updates emails

Issue that this pull request solves

Closes: FXA-11929

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Other information (Optional)

Any other information that is important to this pull request.

@xlisachan xlisachan force-pushed the FXA-11929 branch 4 times, most recently from a6b5467 to fec3155 Compare June 27, 2025 21:28
Comment on lines 27 to 29
const unusedAmountTotal = invoice.lines.data
.filter((line) => line.amount < 0)
.reduce((sum, line) => sum + line.amount, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

invoice.lines can contain a bunch of different things, and IMO it's risky to sum the amounts together on an invoice to get the unusedAmountTotal.

If the intention is to calculate the total proration, maybe consider making use of the invoice.lines.data.proration flag.

Comment on lines 31 to 37
let unitAmount;
if (invoice.lines.data[invoice.lines.data.length - 1]) {
unitAmount = Number(
invoice.lines.data[invoice.lines.data.length - 1]
.unit_amount_excluding_tax
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to assume the last item in invoice.lines will always provide the correct value?

@xlisachan xlisachan force-pushed the FXA-11929 branch 4 times, most recently from 833ab93 to 99f4115 Compare July 3, 2025 15:30
@xlisachan xlisachan changed the title fix(payments-next): Display unit amount of offering instead of list price fix(payments-next): Update Checkout and Upgrade pages to reflect correct amount due Jul 3, 2025
@xlisachan xlisachan force-pushed the FXA-11929 branch 8 times, most recently from cfc3557 to ddaa6ee Compare July 4, 2025 00:16
…ect amount due

Because

- the list price is being displayed instead of the price of the offering
- on Subscription Management page, the total credit balance is deducted from all subscriptions
- totals on Success page reflect upcoming invoice
- emails are not displaying correct amount charged

This pull request

- updates the price of the offering from the list price to the unit amount
- temporary removes inaccurate upcoming invoice total from Subscription Management
- updates charged amount in email

Closes: FXA-11929
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