fix 1.26.1: public order settle uses StatusPaidResponse

This commit is contained in:
Hernâni Marques 2026-08-31 21:18:31 +02:00
parent 39e5eccc25
commit bc785f8466
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
6 changed files with 34 additions and 54 deletions

22
lib.sh
View file

@ -22,6 +22,28 @@ taler_mon_resolve_wallet_db() {
printf '%s\n' "$p"
}
# Merchant order JSON is paid? Public GET: StatusPaidResponse (refunded / refund_taken).
# Spec does not put paid / order_status there (those are private CheckPaymentPaidResponse).
merchant_order_json_is_paid() {
python3 -c '
import json, sys
for p in sys.argv[1:]:
try:
d = json.load(open(p))
except Exception:
continue
if not isinstance(d, dict):
continue
if d.get("paid") is True or str(d.get("order_status") or "").lower() == "paid":
raise SystemExit(0)
if d.get("taler_pay_uri"):
continue
if "refunded" in d or "refund_amount" in d or "refund_taken" in d:
raise SystemExit(0)
raise SystemExit(1)
' "$@"
}
# Load host env once (before any := defaults)
if [ "${_TALER_MON_ENV_LOADED:-0}" != "1" ]; then
_mon_cfg="${TALER_MONITORING_ENV:-${XDG_CONFIG_HOME:-$HOME/.config}/taler-monitoring/env}"