Skip to content

跳转支付收银台

请求地址:POST /checkout/payment

请求参数

参数类型必填说明
transactionTypeString(32)必填Sale / Authorization (目前默认 Sale)
transactionIdString(128)必填商户交易唯一 ID,一般用于防止一笔订单的重复提交
orderIdString(128)必填商户订单 ID,可以重复但只能存在一笔成功交易
currencyString(3)必填币种 (举例:CNY/USD)
amountNumber(12,3)必填交易金额
transactionIpString(128)必填持卡人交易 IP
appIdNumber(20)必填系统->网站APP菜单->APP ID
domainString(128)选填系统->网站APP菜单->主域名
callbackUrlString(255)必填3D/Checkout 回调 URL(一般用于处理面显示逻辑,比如跳转到原有的商品页面)
notificationUrlString(255)必填异步通知 URL,此参数不为空,交易完成会往此地址发送通知(常用于处理订单状态)
productInfosArray必填商品信息(ProductInfo详情)
transactionMethodString(32)必填支付方式,默认Default(支付方式详情)
billingAddressObject必填注意:国家字段必填 账单信息(BillingAddress详情)
shippingAddressObject选填邮寄信息(ShippingAddress详情)
secureBoolean选填是否请求3D交易,true为走3D交易
browserObject条件必填3D交易必填,请求浏览器参数(Browser详情)
extensionObject条件必填扩展字段,某些交易特定字段(Extension详情)

请求实例

json
{
  "transactionType": "Sale",
  "transactionId": "123456",
  "currency": "USD",
  "amount": "8.88",
  "appId": "123456",
  "callbackUrl": "https://domain/callback",
  "notificationUrl": "https://domain/notification",
  "transactionIp": "127.0.0.1",
  "productInfos": [
    {
      "productName": "Stonebriar Unscented Tea Light Candles with 6-7 Hour Burn Time - White, Pack of 100",
      "currency": "USD",
      "price": "8.88",
      "sku": "123-456-789",
      "quantity": 1,
      "productLink": "https://domain/123-456-789"
    }
  ],
  "billingAddress": {
    "firstName": "Gross",
    "lastName": "Schmidt",
    "country": "CA",
    "email": "kael@gmail.com",
    "city": "Longueuil",
    "address": "3226 rue Saint-Charles",
    "phone": "450-928-5752",
    "state": "Quebec",
    "zipCode": "J4H 1M3"
  },
  "shippingAddress": {
    "firstName": "Gross",
    "lastName": "Schmidt",
    "country": "CA",
    "email": "kael@gmail.com",
    "city": "Longueuil",
    "address": "3226 rue Saint-Charles",
    "phone": "450-928-5752",
    "state": "Quebec",
    "zipCode": "J4H 1M3"
  },
  "browser": {
    "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.24 Safari/537.36 Edg/83.0.478.18",
    "referer": "https://www.domain.com"
  },
  "extension": {
    "code": "zenith_bank",
    "account": "160594538"
  }
}

返回实例

参数详情

请求成功->使用redirectUrl参数跳转到收银台

json
{
  "code": 301,
  "isTest": true,
  "appId": 123456,
  "uniqueId": "1669548151356891137",
  "billDescription": "*Description",
  "message": "order processing",
  "timestamp": 1686886273516,
  "transactionAmount": "8.88",
  "transactionAt": "2023-06-16 11:31:12",
  "transactionCardNumber": "420000******0000",
  "transactionCurrency": "USD",
  "transactionId": "123456",
  "transactionMessage": "Redirect",
  "redirectUrl": "https://domain/checkout/2200040333507540993"
}

请求失败

json
{
  "code": 101,
  "isTest": true,
  "appId": 123456,
  "uniqueId": "1669548151356891137",
  "billDescription": "*Description",
  "message": "transaction failed",
  "timestamp": 1686886273516,
  "transactionAmount": "8.88",
  "transactionAt": "2023-06-16 11:31:12",
  "transactionCardNumber": "420000******0000",
  "transactionCurrency": "USD",
  "transactionId": "123456",
  "transactionMessage": "Do not honor"
}