Skip to content

[Billing Plans]: Update POST receipt values for transactions with billing plans#6799

Merged
fire-at-will merged 3 commits into
billing-plans-devfrom
update-post-receipt-values
May 15, 2026
Merged

[Billing Plans]: Update POST receipt values for transactions with billing plans#6799
fire-at-will merged 3 commits into
billing-plans-devfrom
update-post-receipt-values

Conversation

@fire-at-will

@fire-at-will fire-at-will commented May 14, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the values sent through POST /receipt when purchasing a product with a billing plan. Specifically, it:

  • Uses StoreProduct.id for product_identifier. This will be something like com.rc.product for purchases without a billing plan, and will be com.rc.product:monthly for a product with a monthly billing plan.
  • Updates the price to be the price of the installment when the billing plan type is monthly, instead of the price of the product, which would be the annual price

Note

Medium Risk
Changes the POST /receipt payload fields used for purchase validation/attribution (product identifier and price), which could affect backend processing and analytics for billing-plan purchases if mismatched.

Overview
Updates ProductRequestData initialization to send billing-plan-aware values when posting receipts: it now uses StoreProduct.id (e.g. product:monthly) as productIdentifier and, on iOS/tvOS/watchOS/macOS/visionOS 26.4+, uses installmentsInfo.installmentBillingPrice for .monthly billing plans instead of the full product price.

Expands unit coverage to validate the new identifier/price behavior and adjusts syncPurchases metadata tests to accept both base and :monthly product identifiers.

Reviewed by Cursor Bugbot for commit e196597. Bugbot is set up for automated code reviews on this repo. Configure here.

@fire-at-will fire-at-will requested a review from a team as a code owner May 14, 2026 19:02
@fire-at-will fire-at-will changed the title [Billing Plans]: Use appropriate values when calling POST receipt with transaction with billing plan [Billing Plans]: Update POST receipt values for transactions with billing plans May 14, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 768fbba. Configure here.

Comment thread Tests/StoreKitUnitTests/PurchasesOrchestratorSK2Tests.swift

let price: Decimal
if #available(iOS 26.4, tvOS 26.4, watchOS 26.4, macOS 26.4, visionOS 26.4, *),
let installmentsInfo = product.installmentsInfo {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

indenting looks slightly off here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the default indentation that you get in Xcode. I think they do it to keep the second line of the if lined up with the first criteria in the line above it, so that the if criteria are aligned for easy reading.

I agree that it looks funky, though 🤷‍♂️

Image

@fire-at-will fire-at-will merged commit 64f6557 into billing-plans-dev May 15, 2026
42 of 43 checks passed
@fire-at-will fire-at-will deleted the update-post-receipt-values branch May 15, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants