fix 1.26.1: public order settle uses StatusPaidResponse
This commit is contained in:
parent
39e5eccc25
commit
bc785f8466
6 changed files with 34 additions and 54 deletions
22
lib.sh
22
lib.sh
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue