rewrite for eet 2.0 api version v4

This commit is contained in:
2026-10-13 23:28:55 +02:00
parent c926a173ba
commit 3f8e4796b3
55 changed files with 3698 additions and 1611 deletions
+10
View File
@@ -0,0 +1,10 @@
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Command,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$Arguments
)
$playground = if ($env:EETCPP_PLAYGROUND) { $env:EETCPP_PLAYGROUND } else { "EetCppPlayground" }
& $playground $Command @Arguments
exit $LASTEXITCODE
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eu
playground="${EETCPP_PLAYGROUND:-EetCppPlayground}"
exec "$playground" "$@"
+19
View File
@@ -0,0 +1,19 @@
$ErrorActionPreference = "Stop"
$required = @(
"EETCPP_PLAYGROUND",
"EET_ENDPOINT",
"EET_PKCS12_PATH",
"EET_PKCS12_PASSWORD"
)
foreach ($name in $required) {
if (-not (Get-Item "Env:$name" -ErrorAction SilentlyContinue)) {
throw "Set $name before running preflight."
}
}
& $env:EETCPP_PLAYGROUND preflight `
--endpoint $env:EET_ENDPOINT `
--certificate $env:EET_PKCS12_PATH `
--password-env EET_PKCS12_PASSWORD
exit $LASTEXITCODE
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eu
: "${EETCPP_PLAYGROUND:?Set EETCPP_PLAYGROUND}"
: "${EET_ENDPOINT:?Set EET_ENDPOINT}"
: "${EET_PKCS12_PATH:?Set EET_PKCS12_PATH}"
: "${EET_PKCS12_PASSWORD:?Set EET_PKCS12_PASSWORD}"
exec "$EETCPP_PLAYGROUND" preflight \
--endpoint "$EET_ENDPOINT" \
--certificate "$EET_PKCS12_PATH" \
--password-env EET_PKCS12_PASSWORD
+32
View File
@@ -0,0 +1,32 @@
$ErrorActionPreference = "Stop"
$required = @(
"EETCPP_PLAYGROUND",
"EET_ENDPOINT",
"EET_PKCS12_PATH",
"EET_PKCS12_PASSWORD",
"EET_EIC",
"EET_UNIT_ID",
"EET_REGISTER_ID",
"EET_RECEIPT_NUMBER",
"EET_AMOUNT"
)
foreach ($name in $required) {
if (-not (Get-Item "Env:$name" -ErrorAction SilentlyContinue)) {
throw "Set $name before running verification sale."
}
}
$timeout = if ($env:EET_TIMEOUT_MS) { $env:EET_TIMEOUT_MS } else { "30000" }
& $env:EETCPP_PLAYGROUND send-sale `
--endpoint $env:EET_ENDPOINT `
--certificate $env:EET_PKCS12_PATH `
--password-env EET_PKCS12_PASSWORD `
--eic $env:EET_EIC `
--unit $env:EET_UNIT_ID `
--register $env:EET_REGISTER_ID `
--receipt $env:EET_RECEIPT_NUMBER `
--amount $env:EET_AMOUNT `
--timeout $timeout `
--verification
exit $LASTEXITCODE
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eu
: "${EETCPP_PLAYGROUND:?Set EETCPP_PLAYGROUND}"
: "${EET_ENDPOINT:?Set EET_ENDPOINT}"
: "${EET_PKCS12_PATH:?Set EET_PKCS12_PATH}"
: "${EET_PKCS12_PASSWORD:?Set EET_PKCS12_PASSWORD}"
: "${EET_EIC:?Set EET_EIC}"
: "${EET_UNIT_ID:?Set EET_UNIT_ID}"
: "${EET_REGISTER_ID:?Set EET_REGISTER_ID}"
: "${EET_RECEIPT_NUMBER:?Set EET_RECEIPT_NUMBER}"
: "${EET_AMOUNT:?Set EET_AMOUNT}"
exec "$EETCPP_PLAYGROUND" send-sale \
--endpoint "$EET_ENDPOINT" \
--certificate "$EET_PKCS12_PATH" \
--password-env EET_PKCS12_PASSWORD \
--eic "$EET_EIC" \
--unit "$EET_UNIT_ID" \
--register "$EET_REGISTER_ID" \
--receipt "$EET_RECEIPT_NUMBER" \
--amount "$EET_AMOUNT" \
--timeout "${EET_TIMEOUT_MS:-30000}" \
--verification