支付

列出酒店在线预订接受的支付方式,并根据所选方式启动支付步骤。各支付方式的处理方法见支付流程指南。

列出支付方式#

GET/external/online/payment/type

身份验证: Authorization: Bearer

返回酒店为在线销售启用的支付方式。固定的方式 ID:1 到店付款,3 银行转账,9 信用卡(卡信息随预订一并发送),10 在线支付(虚拟 POS)。

查询参数

hotelIDinteger必填
酒店 ID。

响应

200 成功。

请求
curl "https://test.hms.gen.tr/external/online/payment/type?hotelID=1000" \
  -H "Authorization: Bearer $HMS_TOKEN"
响应 · 200
{
    "success": true,
    "count": 3,
    "items": [
        {
            "title": "到店付款",
            "title_translate": "odeme.otelde_odeme",
            "typeID": 1
        },
        {
            "title": "银行转账",
            "title_translate": "odeme.havale",
            "typeID": 3
        },
        {
            "title": "信用卡在线支付",
            "title_translate": "odeme.online_odeme",
            "typeID": 10
        }
    ]
}

虚拟 POS 信息#

GET/external/payment/company

身份验证: Authorization: Bearer

返回酒店的虚拟 POS 服务商和商户信息。仅在您自行直接对接服务商时才需要;标准流程使用 POST …/payment/type/10 即可。响应包含机密信息,请仅在服务端使用。

查询参数

hotelIDinteger必填
酒店 ID。

响应

200 成功。

错误响应

  • 200 hotel_company_info_could_not_found — 酒店未配置虚拟 POS。
请求
curl "https://test.hms.gen.tr/external/payment/company?hotelID=1000" \
  -H "Authorization: Bearer $HMS_TOKEN"
响应 · 200
{
    "success": true,
    "paymentCompany": {
        "merchant_id": "4000****",
        "store_key": "********",
        "terminal_no": "VP00****",
        "user": "demo_api",
        "password": "********",
        "max_installment": 6,
        "company_id": 3,
        "company_code": "iyzico",
        "company_name": "iyzico"
    }
}

启动支付步骤#

POST/external/online/payment/type/{paymentType}

身份验证: Authorization: Bearer · 请求体: application/json

返回所选支付方式需要执行的操作。方式 1 和 9 只需 hotelID;方式 3 返回银行账户列表;方式 10 需提供客人和购物车信息来发起支付,并将返回的 code(HTML)渲染到客人页面,由此跳转到服务商的支付页面。

路径参数

paymentTypeinteger必填
支付方式 ID。
13910

请求体

hotelIDinteger必填
酒店 ID。
totalPricedecimal
方式 10 必填。应收总金额。
orderIDstring
方式 10 必填。您的订单/预订编号。
returnUrlstring
方式 10 必填。客人支付完成后返回的 URL。
name / surname / email / phonestring
方式 10 必填。付款人信息。
city / addressstring
方式 10 必填。账单地址。
countryIDinteger
方式 10 必填。国家列表中的 id
baskets[]object[]
方式 10 必填,至少一项。每项包含:idnamepieceprice

响应

200 方式 10:code 中包含一段跳转到支付服务商的 HTML 片段(视服务商而定,可能是自动提交的表单、window.location 脚本或内嵌支付表单)。请在客人浏览器中原样渲染。其他方式下,由 message 字段说明需执行的操作。

错误响应

  • 200 required_input_info_not_submitted(+ errors[])— 方式 10 缺少字段;country_info_sent_incorrectlycountryID 无效;there_is_missing_info_in_the_shopping_cart — 购物车项缺少字段;bank_info_is_not_found — 方式 3 未配置银行账户。
  • 404 未知的 paymentType
请求
curl -X POST "https://test.hms.gen.tr/external/online/payment/type/10" \
  -H "Authorization: Bearer $HMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "hotelID": 1000,
    "totalPrice": 2330,
    "orderID": "4811174883",
    "returnUrl": "https://booking.example.com/payment/result",
    "name": "Ayşe",
    "surname": "Demir",
    "email": "[email protected]",
    "phone": "05551112233",
    "city": "Denizli",
    "address": "Kumsal Cad. No: 12",
    "countryID": 1,
    "baskets": [
        {
            "id": 2,
            "name": "标准间 · 含早餐",
            "piece": 1,
            "price": 1930
        },
        {
            "id": 12,
            "name": "晚餐",
            "piece": 1,
            "price": 400
        }
    ]
}'
响应 · 200
{
    "success": true,
    "message": "payment_order_code",
    "code": "<form method=\"post\" action=\"https://vpos.provider.example/3d\"><input type=\"hidden\" name=\"orderId\" value=\"4811174883\"> … </form><script>document.forms[0].submit()</script>"
}
响应 · 200(方式 3,银行转账)
{
    "success": true,
    "message": "payment_by_bank_transfer",
    "banks": [
        {
            "companyName": "Ziraat 银行",
            "holder": "Demo Turizm A.Ş.",
            "branchName": "Denizli",
            "branchNumber": "0123",
            "bankAccountNumber": "12345678-5001",
            "iban": "TR00 0001 0001 2345 6789 5001 01"
        }
    ]
}
响应 · 200(方式 1 / 方式 9)
{
    "success": true,
    "message": "credit_card_info_should_be_requested"
}
最后更新: 2026年9月21日发现错误?请告诉我们