Skip to content

Fix AppTransactionValidator to validate receiptType - #440

Merged
alexanderjordanbaker merged 1 commit into
apple:mainfrom
kavyabhand:fix/app-transaction-receipt-type-validator
Aug 28, 2026
Merged

Fix AppTransactionValidator to validate receiptType#440
alexanderjordanbaker merged 1 commit into
apple:mainfrom
kavyabhand:fix/app-transaction-receipt-type-validator

Conversation

@kavyabhand

Copy link
Copy Markdown
Contributor

Summary

AppTransactionValidator was checking obj['environment'] instead of obj['receiptType']. This change validates the field that the model and Apple docs actually use.

Fixes #439

What changed

  • Updated AppTransactionValidator to validate receiptType instead of environment
  • Added unit tests for deserialization, valid payloads, invalid receiptType types, and missing receiptType

Test plan

  • npm run build
  • npm test (21 suites, 340 tests passed)

The validator was checking the wrong JSON field, so receiptType was never
type-checked during JWS payload validation.

@alexanderjordanbaker alexanderjordanbaker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks!

@alexanderjordanbaker
alexanderjordanbaker merged commit bb0c0f8 into apple:main Aug 28, 2026
3 checks passed
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.

AppTransactionValidator validates environment instead of receiptType

2 participants