Skip to content

PTHMINT-118: POS receipt and order cancel features#57

Open
zulquer wants to merge 1 commit intoPTHMINT-116from
PTHMINT-118
Open

PTHMINT-118: POS receipt and order cancel features#57
zulquer wants to merge 1 commit intoPTHMINT-116from
PTHMINT-118

Conversation

@zulquer
Copy link
Copy Markdown
Collaborator

@zulquer zulquer commented Apr 23, 2026

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_transaction method to the OrderManager, 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_transaction method: 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.
  • New request/response models and API structure for cancellation:
    • Adds CancelTransactionRequest and CancelTransaction models for request and response handling. [1] [2]
    • Adds corresponding __init__.py files to expose these models and document their purpose. [1] [2] F37e056cR1)
    • Integrates these models into the OrderManager and its response handling. [1] [2]

Example scripts for Cloud POS flows:

  • Adds examples/order_manager/cancel.py to demonstrate Cloud POS order creation, waiting, and cancellation.
  • Adds examples/order_manager/cloud_pos_order.py to demonstrate Cloud POS order creation with terminal-group scoped authentication.
  • Updates and expands examples/pos_manager/get_receipt.py to 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:

  • Updates example scripts and internal APIs to consistently support and document terminal group scoping and environment variable configuration for credentials. [1] [2] [3] [4] [5] [6]

These changes collectively provide a full workflow for Cloud POS order management, including creation, cancellation, and receipt retrieval, with improved code organization and documentation.

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