Skip to content

[MNA-3651] [iOS] Storekit 2 - Add additional transactions and renewal info to v1/receipts API#20

Merged
eduard-stern merged 4 commits intomainfrom
MNA-3651-storekit2
Apr 14, 2026
Merged

[MNA-3651] [iOS] Storekit 2 - Add additional transactions and renewal info to v1/receipts API#20
eduard-stern merged 4 commits intomainfrom
MNA-3651-storekit2

Conversation

@eduard-stern
Copy link
Copy Markdown
Collaborator

@eduard-stern eduard-stern commented Apr 8, 2026

…ipts API

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Storekit 2 - Add additional transactions and renewal info to v1/receipts API

MNA-3651

Description

Extends our purchases-ios-spm fork to augment the existing /v1/receipts proxy call with two additional fields:

transactions — JWS tokens for all verified transactions from StoreKit.Transaction.all
renewal_info — JWS renewal info tokens fetched via Product.SubscriptionInfo.Status for all subscription groups

Unit tests added in the fork:

TransactionPosterTests — stubs the fetcher with known JWS arrays and asserts they reach MockBackend

BackendPostReceiptDataTests — verifies the values pass through the Backend → CustomerAPI layer, that they serialize correctly as transactions/renewal_info in the JSON body, and that both keys are omitted entirely when nil

Comment thread Sources/Purchasing/StoreKit2/StoreKit2TransactionFetcher.swift Outdated
@Seitk
Copy link
Copy Markdown

Seitk commented Apr 10, 2026

Hi @eduard-stern is it possible to have a feature toggle wrapping the logic?

postParamsHeader is part of the signature calculation in RC SDK and our backend. So adding new data might break the signature and failing all the entitlement verification if we didn't handle it well.

@eduard-stern
Copy link
Copy Markdown
Collaborator Author

Hi @eduard-stern is it possible to have a feature toggle wrapping the logic?

postParamsHeader is part of the signature calculation in RC SDK and our backend. So adding new data might break the signature and failing all the entitlement verification if we didn't handle it well.

I can add a feature toggle as a safety net.
On the signature concern: transactions and renewal_info are only added to the JSON body, not to contentForSignature in PostData. So the X-Post-Params-Hash header is computed over the same three fields as before (appUserID, fetchToken, appTransaction) and won't change.
The new fields are invisible to the signature calculation.
For the toggle itself, I can add a flag to InternalDangerousSettingsType (following the existing pattern in the fork), or have it gated on the main app side before the fork is wired in?

@Seitk
Copy link
Copy Markdown

Seitk commented Apr 13, 2026

Hi @eduard-stern is it possible to have a feature toggle wrapping the logic?
postParamsHeader is part of the signature calculation in RC SDK and our backend. So adding new data might break the signature and failing all the entitlement verification if we didn't handle it well.

I can add a feature toggle as a safety net. On the signature concern: transactions and renewal_info are only added to the JSON body, not to contentForSignature in PostData. So the X-Post-Params-Hash header is computed over the same three fields as before (appUserID, fetchToken, appTransaction) and won't change. The new fields are invisible to the signature calculation. For the toggle itself, I can add a flag to InternalDangerousSettingsType (following the existing pattern in the fork), or have it gated on the main app side before the fork is wired in?

That's nice Eduard, I think ultimately we should also add in the new fields into post params hash (maybe also toggled by the flag). It would be good to have more granular control on setting in case there are new changes we will make in the forked SDK

@eduard-stern
Copy link
Copy Markdown
Collaborator Author

add in the new fields into post params hash (maybe also toggled by the flag)

Thanks, Philip, added a sk2AdditionalTransactionDataEnabled flag to InternalDangerousSettingsType. When true both sends the fields in the body and includes them in the X-Post-Params-Hash via contentForSignature. I'll open a PR in Goodnotes to pass the feature flag to RC

@eduard-stern eduard-stern merged commit 7f3f0df into main Apr 14, 2026
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.

3 participants