PTHMINT-118: POS receipt and order cancel features#57
Open
zulquer wants to merge 1 commit intoPTHMINT-116from
Open
PTHMINT-118: POS receipt and order cancel features#57zulquer wants to merge 1 commit intoPTHMINT-116from
zulquer wants to merge 1 commit intoPTHMINT-116from
Conversation
Introduce POS receipt models and manager, and add order cancel transaction support with terminal-group scoped auth. - Add PosManager and POS /receipt response models (merchant, order, payment, related_transactions, Receipt) and wire it into the SDK. - Add cancel transaction request/response models and integrate cancel_transaction into OrderManager. - Extend OrderManager.create and cancel_transaction to accept optional terminal_group_id and pass AuthScope to the client; ensure order_id path segments are encoded. - Add unit and integration tests for new behavior (order create scoped auth, cancel_transaction, get_receipt, OrderManager operations) and example scripts (cloud_pos_order, cancel, get_receipt). These changes enable Cloud POS workflows (create, wait/cancel, fetch receipt) and support terminal-group scoped authentication for relevant endpoints.
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.
This pull request introduces support for cancelling Cloud POS orders and improves the example scripts and internal API structure for order cancellation and receipt fetching. The main changes include the addition of a new
cancel_transactionmethod to theOrderManager, new request and response models for order cancellation, and several new and updated example scripts demonstrating Cloud POS order creation, cancellation, and receipt retrieval.New Cloud POS order cancellation support:
OrderManager.cancel_transactionmethod: Adds a new method to cancel POS transactions by order ID, supporting both direct order ID strings and request objects, with optional terminal group scoping.CancelTransactionRequestandCancelTransactionmodels for request and response handling. [1] [2]__init__.pyfiles to expose these models and document their purpose. [1] [2] F37e056cR1)OrderManagerand its response handling. [1] [2]Example scripts for Cloud POS flows:
examples/order_manager/cancel.pyto demonstrate Cloud POS order creation, waiting, and cancellation.examples/order_manager/cloud_pos_order.pyto demonstrate Cloud POS order creation with terminal-group scoped authentication.examples/pos_manager/get_receipt.pyto show both receipt fetching for an existing order and a complete flow including order creation, event monitoring, and receipt retrieval.Improvements to authentication and scoping:
These changes collectively provide a full workflow for Cloud POS order management, including creation, cancellation, and receipt retrieval, with improved code organization and documentation.