Skip to content

fix(sdk): check has_reference_in_store_cb before calling in verify_receipt - #384

Open
aksharprabhudesai wants to merge 1 commit into
google-agentic-commerce:mainfrom
aksharprabhudesai:fix/receipt-client-optional-callback
Open

aksharprabhudesai wants to merge 1 commit into
google-agentic-commerce:mainfrom
aksharprabhudesai:fix/receipt-client-optional-callback

Conversation

@aksharprabhudesai

Copy link
Copy Markdown

Description

has_reference_in_store_cb in ReceiptClient.verify_receipt defaults to None, but was called unconditionally when checking the receipt reference. If omitted or passed as None, it raised a TypeError: 'NoneType' object is not callable.

This ensures the callback is checked for None before being called, and adds test coverage for omitted and explicit None callbacks for payment and checkout receipts.

Fixes #367 🦕

@aksharprabhudesai
aksharprabhudesai requested a review from a team as a code owner October 17, 2026 20:40

This branch has not been deployed

No deployments
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.

[Bug]: ReceiptClient crashes when its documented optional reference callback is omitted

1 participant