Skip to content

Add subtotal as SUBTOTAL DisplayItem in Google Pay#13403

Draft
cttsai-stripe wants to merge 3 commits into
masterfrom
cttsai/mobilesdk-4641-gpay-subtotal
Draft

Add subtotal as SUBTOTAL DisplayItem in Google Pay#13403
cttsai-stripe wants to merge 3 commits into
masterfrom
cttsai/mobilesdk-4641-gpay-subtotal

Conversation

@cttsai-stripe

Copy link
Copy Markdown
Contributor

Summary

Add total.subtotal from CheckoutSession as a SUBTOTAL DisplayItem row in the Google Pay payment request.

The subtotal (pre-discount, pre-tax sum of line items) was already available on TotalSummary but not being surfaced to the Google Pay sheet. This wires it in via the existing GooglePayDisplayItemsFactory, positioned after line items and before discounts/taxes — matching receipt conventions.

Motivation

MOBILESDK-4641. The Google Pay payment sheet shows a line-item breakdown; showing the subtotal helps customers understand the price adjustments (discounts, taxes) that follow it.

Testing

  • Added tests
  • Modified tests

Updated 3 existing tests in GooglePayDisplayItemsFactoryTest to assert SUBTOTAL appears in the correct position. Added 1 new test for the case where totalSummary has no discounts or taxes.

Screenshots

N/A — DisplayItems are rendered by the Google Pay SDK sheet, not by Stripe UI.

Changelog

@cttsai-stripe cttsai-stripe changed the title [EwCS] Add subtotal as SUBTOTAL DisplayItem in Google Pay Add subtotal as SUBTOTAL DisplayItem in Google Pay Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant