#!/usr/bin/env bash # DePay read-only diagnostic example v1.0.0-preview.2. Not a payment SDK. # Requires bash and curl. Usage: bash depay-health-check.sh https://your-authorized-host # Only GET /healthz and /readyz; never submit credentials or payment data. set -eu if [ "$#" -ne 1 ]; then printf '%s\n' 'Usage: bash depay-health-check.sh https://your-authorized-host' >&2 exit 64 fi base="${1%/}" # A host (optional numeric port) only; no credentials, path, query or fragment. if ! [[ "$base" =~ ^https://[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?(:[0-9]{1,5})?$ ]]; then printf '%s\n' 'Use an authorized HTTPS origin without credentials, path, query or fragment.' >&2 exit 64 fi result=0 for path in /healthz /readyz; do printf '\n%s\n' "$path" # TLS verification remains on; no redirects; curl --fail reports HTTP 503 as nonzero. if ! curl --silent --show-error --fail --proto '=https' --connect-timeout 5 --max-time 10 --max-filesize 65536 \ --header 'Accept: application/json' --write-out '\nHTTP %{http_code}\n' "$base$path"; then result=2 fi done printf '\n%s\n' 'Inspect business_ready as well as HTTP status. HTTP 200 liveness is not business readiness.' printf '%s\n' 'Current preview readiness returns HTTP 503. This script never creates accounts, orders or payments.' exit "$result"