[EXTERNAL] feat: expose revocationDate and revocationReason on StoreTransaction#6962
Merged
Conversation
rickvdl
approved these changes
Jun 16, 2026
rickvdl
left a comment
Member
There was a problem hiding this comment.
Looking great! Will make a slight change to the RevocationReason type before merging in order to keep Objc support, but other than that it's great as it is.
Thanks for your contribution! 🙌
79aedef
into
RevenueCat:external/feat-storetransaction-revocation
3 checks passed
rickvdl
added a commit
that referenced
this pull request
Jun 16, 2026
…ransaction via @mvanhorn (#7012) * feat: expose revocationDate and revocationReason on StoreTransaction (#6515) (#6962) Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> * Add Objc support to the RevocationReason type * Add RevocationReason to xcodeproj * Fix RevocationReason StoreKit 2 compatibility * Use canonical RevocationReason values for SK2 mapping * Update baseline swiftinterface files * Fix RevocationReason identity test --------- Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: RCGitBot <dev+RCGitBot@revenuecat.com>
Contributor
Author
|
Appreciate you merging this, @rickvdl. Exposing revocationDate and revocationReason gives callers the refund signal they were missing. |
Contributor
Author
|
Thanks @rickvdl. Exposing revocationDate and revocationReason on StoreTransaction fills a real gap for anyone reconciling refunds against StoreKit 2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
purchases-androidand hybridsMotivation
Resolves #6515.
StoreKit 2 exposes
Transaction.revocationDateandTransaction.revocationReason, butStoreTransactiondoes not surface either. Apps usingCustomEntitlementComputation, transaction-history UIs, and custom refund analytics need to read revocation data directly off the transaction. A maintainer responded positively to the reporter's proposal.Description
Adds
revocationDateandrevocationReasontoStoreTransaction, mirroring the existingTransactionReasonpattern.revocationDateis exposed as@objc public var revocationDate: Date?.revocationReasonis a new publicRevocationReasonvalue type. Per the repo'sno_new_public_enumsrule, it is aRawRepresentablestruct (not an enum) with.developerIssue/.otherconstants, so adding cases later stays source-compatible. Because it is a Swift struct it cannot be@objc, so the property is Swift-only (documented inline);revocationDateremains Obj-C accessible.SK2StoreTransaction(iOS 15+);nilfor SK1, test, simulated, and mock conformers.Both fields are additive and
nil-defaulted — no breaking change.swift buildof theRevenueCattarget passes.Note: I was not able to regenerate the
api/*.swiftinterfacebaselines locally (they require the multi-platform API digester). Thecheck-api-changesjob will flag the additive public surface; the baselines need to be regenerated for these intentional additions.This PR scopes to
revocationReason(.developerIssue/.other, iOS 15+). The separate iOS 26.4Transaction.RevocationType(.proratedRefundetc.) is intentionally left for a follow-up.AI was used for assistance.
Note
Low Risk
Additive, nil-defaulted public API with no changes to purchase or entitlement logic; only surfaces existing SK2 metadata.
Overview
StoreTransactionnow exposesrevocationDateandrevocationReasonso apps can read App Store refund/revocation metadata from StoreKit 2, matching the existingTransactionReasonpattern.A new public
RevocationReasonRawRepresentablestruct (.developerIssue,.other) maps from SK2 and logs unknown values viask2_unknown_revocation_reason.SK2StoreTransactioncopiesrevocationDateand mappedrevocationReasonfrom the underlying transaction; SK1, mocks, simulated, test, and deprecated backend-parsed transactions returnnil.revocationDateis@objc;revocationReasonis Swift-only. API testers and unit tests cover the new surface.Reviewed by Cursor Bugbot for commit 2986c95. Bugbot is set up for automated code reviews on this repo. Configure here.