Skip to content

Fix missing regular/trial billing line items in recurring payment fallback - #67

Closed
ana-maksimovskikh wants to merge 1 commit into
mainfrom
ana/card-fix-recurring-payment-summary-fallback
Closed

Fix missing regular/trial billing line items in recurring payment fallback#67
ana-maksimovskikh wants to merge 1 commit into
mainfrom
ana/card-fix-recurring-payment-summary-fallback

Conversation

@ana-maksimovskikh

Copy link
Copy Markdown
Contributor

What

`getPaymentSummaryItems()`'s `.recurringPayment` branch only mapped the plain `paymentSummaryItems`, never appending `regularBilling` (or `trialBilling`, when set) — even though `buildPaymentRequest(transaction: RecurringPaymentTransaction)` appends both when constructing the request. PassKit calls this fallback to rebuild the summary list after shipping, payment-method, or coupon-code changes, so the subscription's billing line (and trial line) would silently disappear from the sheet on any of those triggers.

Same class of bug as the automaticReload fallback fixed in #58 (c54e8c3).

Why here, not in #58/#65

This bug is in code that shipped to main in #57, unrelated to the automaticReload/deferred-payment work in #58/#65. Landing it as its own PR against main lets both of those stacked PRs rebase on top and inherit the fix without duplicating it.

Changes

  • Fix in getPaymentSummaryItems()'s .recurringPayment branch.
  • Two regression tests mirroring the existing automaticReload fallback test style.
  • Generalized makeViewForDispositionTests to accept an arbitrary Transaction (shared test infra also needed by Add automatic reload type to iOS #58's automaticReload fix — extracted here so Add automatic reload type to iOS #58 no longer needs to redo it).

Testing

  • swift build clean at iOS 15 floor.
  • Full xcodebuild test suite: 40/40 passing (up from 38, +2 new regression tests) on top of main.

🤖 Generated with Claude Code

buildPaymentRequest(transaction: RecurringPaymentTransaction) appends
regularBilling (and trialBilling, if set) to paymentSummaryItems, but
getPaymentSummaryItems's .recurringPayment branch only mapped the plain
paymentSummaryItems, never appending them. PassKit calls this fallback to
rebuild the summary list after shipping, payment-method, or coupon-code
changes, so the subscription's billing line (and any trial line) would
silently disappear from the sheet on any of those triggers - same class
of bug as the automaticReload fallback fixed in PR #58.

Also generalized makeViewForDispositionTests to accept an arbitrary
Transaction, mirroring the same test-helper change from PR #58, so this
and future fallback regression tests aren't limited to oneOffPayment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ana-maksimovskikh
ana-maksimovskikh requested a review from a team as a code owner August 20, 2026 12:35
@ana-maksimovskikh
ana-maksimovskikh deleted the ana/card-fix-recurring-payment-summary-fallback branch August 20, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant