Fix originalTransactionIdentifier to strip Google Play recurrence suffix - #454
Draft
claude[bot] wants to merge 3 commits into
Draft
Fix originalTransactionIdentifier to strip Google Play recurrence suffix#454claude[bot] wants to merge 3 commits into
claude[bot] wants to merge 3 commits into
Conversation
Google Play appends a recurrence suffix (..N) to order ids for subscription renewals, e.g. GPA.1234-1234-1234-12345..1. The original transaction id was being reported as the renewal's own order id. Strip the trailing ..N wherever an original transaction id is expected, while keeping the untouched order id for current-transaction fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
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.
Requested by Ian Rumac · Slack thread
Changes in this pull request
Before:
StoreTransaction.originalTransactionIdentifierreported the current transaction's own Google Play order id. For subscription renewals Google Play appends a recurrence suffix to the order id (GPA.1234-1234-1234-12345..0,..1,..2, ...), so a renewal reported an id likeGPA.1234-1234-1234-12345..2as its "original" transaction id instead of the first period's id.After:
originalTransactionIdentifierreports the base order id (GPA.1234-1234-1234-12345) by stripping the trailing..Nrecurrence suffix, matching how the server side already normalizes these ids. Fields that represent the current transaction (storeTransactionId,EntitlementTransaction.transactionId, the redeem request'sorderId) are unchanged.How: Added an internal
GoogleBillingPurchaseTransaction.originalOrderId(orderId)helper that strips a trailing..N(\.\.\d+$) and applied it at the two sites that map a Play order id into an original-transaction field: thePurchaseconstructor inGoogleBillingPurchaseTransaction.ktand theTransactionReceipt.originalTransactionIdcollection inReceiptManager.kt. Unit tests inGoogleBillingPurchaseTransactionTest.ktcover no-suffix,..0,..1, multi-digit..12, single-dot ids that must not be truncated, and null.Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues.Generated by Claude Code