{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "payment_status",
  "description": "Ödeme durumu (ödemeler açıkken). `payment_id` = telegram_payment_charge_id (bc_<ulid>).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "version",
    "status",
    "amount"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "payment_status"
      ]
    },
    "version": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "tone": {
      "type": "string",
      "enum": [
        "neutral",
        "success",
        "warning",
        "danger",
        "brand"
      ]
    },
    "brand_color": {
      "type": "string",
      "enum": [
        "mavi",
        "turuncu",
        "mor",
        "pembe",
        "altin",
        "yesil",
        "turkuaz"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "paid",
        "pending",
        "failed",
        "refunded",
        "partially_refunded"
      ]
    },
    "amount": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000
        },
        "currency": {
          "type": "string",
          "enum": [
            "TRY",
            "INK",
            "USD",
            "EUR"
          ]
        }
      },
      "required": [
        "amount",
        "currency"
      ],
      "description": "tutar; biçimlendirmeyi (₺, ondalık ayracı) istemci yapar"
    },
    "description": {
      "type": "string",
      "maxLength": 160
    },
    "paid_at": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4102444800,
      "description": "Unix saniye (UTC)"
    },
    "method": {
      "type": "string",
      "enum": [
        "ink",
        "provider"
      ]
    },
    "payment_id": {
      "type": "string",
      "pattern": "^bc_[0-9A-Za-z]{10,40}$"
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action_id": {
            "type": "string",
            "pattern": "^[a-z0-9_-]{1,64}$",
            "description": "düğme eylem kimliği; `values.action_id` olarak geri gelir"
          },
          "label": {
            "type": "string",
            "maxLength": 40,
            "minLength": 1
          },
          "style": {
            "type": "string",
            "enum": [
              "primary",
              "secondary",
              "danger"
            ]
          },
          "disabled": {
            "type": "boolean"
          }
        },
        "required": [
          "action_id",
          "label"
        ],
        "description": "basılınca `inki_component_action{action:\"submit\", values:{action_id}}`"
      }
    }
  },
  "x-inki-eylem": [
    {
      "action": "submit",
      "values": {
        "action_id": "actions[].action_id"
      }
    }
  ]
}
