跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://developers-sandbox.uqpaytech.com/llms.txt

Use this file to discover all available pages before exploring further.

本指南将带你在沙盒环境中,通过 Direct API 集成方式受理一笔卡支付。
前置条件
  • 已启用 Global Acquiring 的 UQPAY 沙盒账户
  • 通过 Access Token 接口获取的 API Token
1

使用卡支付方式创建 Payment Intent

向 Create Payment Intent 接口发送请求,并传入一张测试卡号。这样可以在一次调用中完成 payment intent 的创建和支付处理。
curl -X POST https://api-sandbox.uqpaytech.com/api/v2/payment_intents/create \
  -H "Content-Type: application/json" \
  -H "x-auth-token: Bearer {your_access_token}" \
  -H "x-client-id: {your_client_id}" \
  -H "x-idempotency-key: $(uuidgen)" \
  -d '{
    "amount": "8.98",
    "currency": "SGD",
    "payment_method": {
      "type": "card",
      "card": {
        "card_name": "UQPAY",
        "card_number": "5346930100108117",
        "expiry_month": "12",
        "expiry_year": "2026",
        "cvc": "811",
        "network": "mastercard",
        "billing": {
          "first_name": "UQPAY",
          "last_name": "ACQ",
          "email": "[email protected]",
          "phone_number": "0524-91353515",
          "address": {
            "country_code": "SG",
            "state": "Singapore",
            "city": "Singapore",
            "street": "444 Orchard Rd, Midpoint Orchard, Singapore",
            "postcode": "924011"
          }
        },
        "auto_capture": true,
        "authorization_type": "authorization",
        "three_ds_action": "skip_3ds"
      }
    },
    "merchant_order_id": "my-first-order-001",
    "description": "Quickstart test payment",
    "metadata": {},
    "return_url": "https://example.com/callback"
  }'
2

检查响应

支付成功时会立即返回 intent_status: "SUCCEEDED"
{
  "amount": 8.98,
  "currency": "SGD",
  "intent_status": "SUCCEEDED",
  "payment_intent_id": "PI1933438751883661312",
  "latest_payment_attempt": {
    "attempt_id": "PA1933438751988518912",
    "attempt_status": "CAPTURE_REQUESTED",
    "amount": 8.98,
    "captured_amount": 8.98,
    "currency": "SGD",
    "complete_time": "2025-06-13T16:18:14+08:00",
    "create_time": "2025-06-13T16:18:14+08:00"
  },
  "merchant_order_id": "my-first-order-001",
  "complete_time": "2025-06-13T16:18:14+08:00",
  "create_time": "2025-06-13T16:18:14+08:00"
}
需要关注的关键字段:
  • intent_status —— 本次支付的总体结果。完整状态参考见核心概念
  • payment_intent_id —— 本次支付的唯一标识,以 PI 开头
  • latest_payment_attempt.attempt_id —— 具体的支付尝试,以 PA 开头
3

通过 Retrieve 接口验证(可选)

你可以随时查询支付状态:
curl https://api-sandbox.uqpaytech.com/api/v2/payment_intents/{payment_intent_id} \
  -H "x-auth-token: Bearer {your_access_token}" \
  -H "x-client-id: {your_client_id}"

下一步

核心概念

了解 Payment Intent 和 Payment Attempt 的生命周期与状态流转。

Direct API 集成

搭建包含支付方式处理和 3DS 身份验证的完整收银台流程。

沙盒测试

完整的测试卡清单、电子钱包沙盒配置,以及上线前自查清单。

Webhooks

配置 webhook 通知,实时接收支付状态更新。