Skip to content

Feature/19 implement support for receiptrequestcbterminalid#21

Merged
MaximilianFT merged 4 commits into
mainfrom
feature/19-implement-support-for-receiptrequestcbterminalid
May 18, 2026
Merged

Feature/19 implement support for receiptrequestcbterminalid#21
MaximilianFT merged 4 commits into
mainfrom
feature/19-implement-support-for-receiptrequestcbterminalid

Conversation

@turtletramp
Copy link
Copy Markdown
Collaborator

based on #20 which should be reviewed and merged first to simplify this PR

This pull request introduces improvements to how terminal IDs are handled throughout the payment and receipt flows, ensuring consistent naming and usage of cbTerminalID across DTOs and API calls. It also enhances user experience by prompting for the terminal ID at runtime and improves debugging information for delivery responses.

Terminal ID handling and consistency:

  • Standardized the property name to cbTerminalID (from cbTerminalId) in PaymentRequest, RefundCancelRequest, and related API calls, and updated all usages accordingly for consistency. [1] [2] [3] [4]
  • Added or clarified the cbTerminalID property in ReceiptRequest and ensured it is included in the request serialization. [1] [2]
  • Changed the default value for the terminalID parameter in PosAPIPay.PaymentAsync to "term1" and updated all sample usages to allow runtime selection of the terminal ID. [1] [2] [3] [4] [5]

User experience improvements:

  • Added a console prompt in sample programs (HOWTO_01_Payment_csharp/Program.cs, HOWTO_08_pay_sign_issue_csharp/Program.cs) to let users specify the terminal ID at runtime, defaulting to "term1" if left blank. [1] [2]

Debugging and DTO enhancements:

  • Refactored IssueDeliveredResponse to use a Message property (with correct casing and JSON serialization attributes), added support for arbitrary additional properties, and improved logging of delivery details. [1] [2]

…esponse as it is not guaranteed to stay stable in the future
…ue-request-as-it-is-not-final-and-might-change-in-future' into feature/19-implement-support-for-receiptrequestcbterminalid
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the devkit’s POS System API client and samples to consistently use cbTerminalID for terminal routing across payment and receipt flows, and improves delivery-response debug handling.

Changes:

  • Standardizes terminal ID naming from cbTerminalId to cbTerminalID across request DTOs and call sites, and adds cbTerminalID to ReceiptRequest.
  • Updates sample programs to prompt for cbTerminalID at runtime (defaulting to term1) and passes it through payment + receipt issuance.
  • Refactors IssueDeliveredResponse to use a properly-cased Message property and allow additional JSON fields via extension data.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libPosSystemAPI/PosAPIClient/PosAPIPay.cs Changes default terminal ID behavior and maps to cbTerminalID in PaymentRequest.
libPosSystemAPI/ftPosAPIRunner.cs Updates payment request building to use cbTerminalID.
libPosSystemAPI/DTO/PaymentRequest.cs Renames terminal property to cbTerminalID for correct JSON field naming.
libPosSystemAPI/DTO/RefundCancelRequest.cs Renames terminal property to cbTerminalID.
libPosSystemAPI/DTO/ReceiptRequest.cs Adds/activates cbTerminalID serialization on receipt requests.
libPosSystemAPI/DTO/IssueDeliveredResponse.cs Refactors delivery response DTO (but currently introduces a compile error).
HOWTO_01_Payment_csharp/Program.cs Prompts for and uses cbTerminalID; updates commentary (one comment now misleading).
HOWTO_08_pay_sign_issue_csharp/Program.cs Prompts for and uses cbTerminalID in pay + sign/issue flow; updates delivery logging.
.gitignore Ignores *.lscache files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// alongside the known properties.
/// </summary>
[JsonExtensionData]
public Dictionary<string, object?>? AdditionalProperties { get; set; } }
Comment on lines 26 to 36
@@ -32,7 +32,7 @@ public async Task<ExecutedResult<PayResponse>> PaymentAsync(PayItemRequest cbPay
Action = PayAction.payment,
Protocol = protocol,
cbPayItem = cbPayItem,
cbTerminalId = terminalID,
cbTerminalID = terminalID,
};
public string? cbTerminalId { get; set; }
/// <summary>
/// Allows to identify a specific target device/terminal or group that should process the request.
/// </summary>
Comment on lines +68 to 69
// - the terminal ID is defined here ("term1") so the request will be processed by the specified terminal (if the terminal is configured also with a terminal ID)
// IMPORTANT: In a real setup you might want to define a specific terminal ID here to target a specific payment terminal device; especially when multiple payment terminals are registered for the same cashbox!
@MaximilianFT MaximilianFT merged commit 89f82a3 into main May 18, 2026
5 checks passed
@MaximilianFT MaximilianFT deleted the feature/19-implement-support-for-receiptrequestcbterminalid branch May 18, 2026 06:46
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.

[DevKit] POS System API - implement support for ReceiptRequest.cbTerminalID in lib and HOWTOs to demonstrate proper receipt routing

4 participants