#!/usr/bin/env sh
set -eu

: "${XPAYR_SECRET_KEY:=sk_test_xxx}"
: "${XPAYR_BASE_URL:=https://xpayr.com/api/v1}"

curl -sS -X POST "$XPAYR_BASE_URL/payments" \
  -H "Authorization: Bearer $XPAYR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 49.90,
    "currency": "USDT",
    "network": "tron-mainnet",
    "metadata": {
      "order_id": "ORDER-1001",
      "customer_id": "cus_123"
    },
    "success_url": "https://example.com/paid",
    "cancel_url": "https://example.com/cancel",
    "ipn_callback_url": "https://example.com/webhooks/xpayr"
  }'

