Skip to content

Fix originalTransactionIdentifier to strip Google Play recurrence suffix - #454

Draft
claude[bot] wants to merge 3 commits into
developfrom
fix/original-transaction-id-suffix
Draft

Fix originalTransactionIdentifier to strip Google Play recurrence suffix#454
claude[bot] wants to merge 3 commits into
developfrom
fix/original-transaction-id-suffix

Conversation

@claude

@claude claude Bot commented Aug 12, 2026

Copy link
Copy Markdown

Requested by Ian Rumac · Slack thread

Changes in this pull request

Before: StoreTransaction.originalTransactionIdentifier reported 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 like GPA.1234-1234-1234-12345..2 as its "original" transaction id instead of the first period's id.

After: originalTransactionIdentifier reports the base order id (GPA.1234-1234-1234-12345) by stripping the trailing ..N recurrence suffix, matching how the server side already normalizes these ids. Fields that represent the current transaction (storeTransactionId, EntitlementTransaction.transactionId, the redeem request's orderId) 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: the Purchase constructor in GoogleBillingPurchaseTransaction.kt and the TransactionReceipt.originalTransactionId collection in ReceiptManager.kt. Unit tests in GoogleBillingPurchaseTransactionTest.kt cover no-suffix, ..0, ..1, multi-digit ..12, single-dot ids that must not be truncated, and null.

Checklist

  • All unit tests pass.
  • All UI tests pass.
  • Demo project builds and runs.
  • I added/updated tests or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have run ktlint in the main directory and fixed any issues.
  • I have updated the SDK documentation as well as the online docs.
  • I have reviewed the contributing guide

Generated by Claude Code

claude and others added 3 commits August 12, 2026 18:14
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
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.

1 participant