账户会话

GET /core/v1/billing/stripe-test

隔离环境Stripe测试支付能力;真实收款保持关闭

Stripe 仍关闭,其接口仅支持测试模式。全局 payment_enabled 不能证明 Stripe 可用。webhook 必须由服务端校验官方签名和未经改写的原始字节,不可由前端伪造。

身份要求

账户会话. 会话/管理写操作不在公共 Playground 执行。

接口

curl --request GET 'https://api.oneaster.ai/core/v1/billing/stripe-test' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

参数

—

响应

200

隔离环境Stripe测试支付能力;真实收款保持关闭

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "mode": {
              "const": "test"
            },
            "currency": {
              "const": "usd"
            },
            "micro_per_usd_cent": {
              "const": "10000"
            },
            "min_amount_usd_cents": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$",
                  "maxLength": 6,
                  "description": "USD整数美分;不是积分。1美分=10000 OneAster整数账务单位。"
                },
                {
                  "type": "null"
                }
              ]
            },
            "max_amount_usd_cents": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$",
                  "maxLength": 6,
                  "description": "USD整数美分;不是积分。1美分=10000 OneAster整数账务单位。"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "enabled",
            "mode",
            "currency",
            "micro_per_usd_cent",
            "min_amount_usd_cents",
            "max_amount_usd_cents"
          ]
        }
      },
      "required": [
        "success",
        "data"
      ]
    }
  }
}

default

错误代码见 core-api.md;供应商/数据库错误已隐藏。

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "type": {
              "const": "oneaster_error"
            }
          },
          "required": [
            "code",
            "message",
            "type"
          ]
        },
        "data": {
          "type": "null"
        }
      },
      "required": [
        "success",
        "error",
        "data"
      ]
    }
  }
}