Checkout

跳转支付/收银台

请求地址:POST /checkout/payment

请求参数

参数
类型
必填
说明

transactionType

String(32)

C

Sale / Authorization (目前默认 Sale)

transactionId

String(128)

M

商户交易唯一 ID

orderId

String(128)

O

商户订单 ID,可以重复但只能存在一笔成功交易

currency

String(3)

M

币种 (CNY/USD)

amount

Number(12,3)

M

交易金额

appId

Number(20)

C

APP ID(domain 二选一)

domain

String(128)

C

请求网站域名 (appId 二选一)

callbackUrl

String(255)

C

3D/Checkout 回调 URL,3D/Checkout 交易必填(一般用于处理面显示逻辑)

notificationUrl

String(255)

C

异步通知 URL,此参数不为空,交易完成会往此地址发送通知(一般用于处理订单状态)

transactionIp

String(128)

M

持卡人交易 IP

productName

String(255)

O

产品名称

productInfos

Array

O

产品详情,详见下表

Object

C

账单信息,JSON 对象,见下表

Object

C

邮寄信息,JSON 对象,见下表

Object

C

3D 交易请求浏览器参数,JSON 对象,见下表

secure

Boolean

O

是否请求 3D 交易 true/false

extension

Object

O

扩展字段,某些交易特定字段

String(32)

O

付款方式,默认 Defaulte,其他支付方式查看下表

ProductInfos 对象

参数
类型
必填

productName

String(128)

O

商品名称

currency

String(3)

O

商品币种

price

Number(12,3)

O

单个商品价格

sku

String(128)

O

商品 SKU

quantity

Number(4)

O

商品个数

productLink

String(255)

O

商品链接

BillingAddress&ShippingAddress 对象

参数
类型
必填
说明

firstName

String(64)

O

lastName

String(64)

O

email

String(255)

O

邮箱

phone

String(32)

O

电话

country

String(2)

O

国家 2 位 CODE

state

String(128)

O

city

String(128)

O

城市

address

String(255)

O

地址

zipCode

String(64)

O

邮编

Browser 浏览器参数

参数
类型
必填
说明

accept

String(128)

O

浏览器参数

userAgent

String(128)

O

浏览器参数

acceptLanguage

String(128)

O

浏览器参数

javaEnabled

Boolean

O

浏览器参数

colorDepth

String(16)

O

浏览器参数

screenHeight

String(16)

O

浏览器参数

screenWidth

String(16)

O

浏览器参数

timeZoneOffset

String(32)

O

浏览器参数

referer

String(128)

O

浏览器参数

Transaction Method 付款方式

收银台支持4种模式: Default/Creditcard/LPM/具体支付方式

  • Default : 收银台可以同时展示信用卡和本地支付供持卡人选择

  • CreditCard : 收银台只展示信用卡支付

  • LPM : 收银台只展示本地支付

  • 具体支付方式 : 例如传入 Paypal 会直接开启Paypal的付款页面

  • CreditCard

  • spei

  • naverpay

  • rakutenpay

  • banktransfer

  • mercadopago

  • kakaopay

  • alipay

  • oxxo

  • klarna

  • linepay

  • wechatpay

  • oxxopay

  • payco

  • paypay

  • upop

  • toss

  • lpay

  • paypal

  • venmo

  • samsungpay

  • alipay+

  • alipay_hk

  • gcash

  • dana

  • rabbit_line_pay

  • tng

  • bpi

  • truemoney

  • lgpay

支付方式
支持币种
支持国家

RapiPago

ARS and USD

AR

PagoFacil

ARS and USD

AR

Cupon

ARS and USD

AR

Pagosnet

BOB and USD

BO

Pix

BRL and USD

BR

PISP

BRL and USD

BR

Boleto

BRL

BR

BankTransfer

BRL and NGN

BR,NG

Servipag

CLP and USD

CL

Sencillito

CLP and USD

CL

Multicaja

CLP and USD

CL

Webpay

PEN and USD

CL

PSE

COP, USD and EUR

CO

Efecty

COP, USD and EUR

CO

Bancolombia

COP

CO

SafetyPayCash

PEN and USD

EC,PE

SafetyPayOnline

PEN and USD

EC,PE

GHS, KES, UGX, TZS, ZMWand EUR

GH,KE,UG,TZ,ZM

UPI

INR

IN

OXXO

MXN and USD

MX

OXXOPAY

MXN and USD

MX

SPEI

MXN and USD

MX

NGN

NG

PagoEfectivo

PEN and USD

PE

Ozow

ZAR

ZA

特殊付款方式

MobileMoney 国家不同,支持的运营商也不同,需要按照下表传入额外参数

在请求参数 extension 中添加 code 字段,传入对应只运营商,参考下表

国家
币种
运营商

GH

GHS

mpesa, airtel and mtn

KE

KES

mpesa, airtel and equitel

UG

UGX

airtel and mtn

TZ

TZS

airtel, vodacom and tigo

ZM

ZMW

airtel, zamtel and mtn

实例

{
    "transactionType": "Sale",
    "transactionId": "123456",
    "currency": "USD",
    "amount": "8.88",
    "transactionMethod": "MobileMoney",
    ...
    "extension": {
        "code": "airtel"
    }
}

请求实例

{
    "transactionType": "Sale",
    "transactionId": "123456",
    "currency": "USD",
    "amount": "8.88",
    "appId": "123456",
    "callbackUrl": "https://domain/callback",
    "notificationUrl": "https://domain/notification",
    "transactionIp": "127.0.0.1",
    "productName": "Stonebriar Unscented Tea Light Candles with 6-7 Hour Burn Time - White, Pack of 100",
    "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": "[email protected]",
        "city": "Longueuil",
        "address": "3226 rue Saint-Charles",
        "phone": "450-928-5752",
        "state": "Quebec",
        "zipCode": "J4H 1M3"
    },
    "shippingAddress": {
        "firstName": "Gross",
        "lastName": "Schmidt",
        "country": "CA",
        "email": "[email protected]",
        "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": {
        "identificationType": "IDENTITY",
        "identificationValue": "1234567890",
        "thirdPartyId": "1234567890",
        "thirdPartyName": "ABC"
    }
}

返回实例

交易成功/跳转收银台

{
    "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/redirect/a6354c630cba488caa56a0113bb0ef34"
}

交易失败

{
    "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"
}

返回参数

参数
类型
必填

code

Number(3)

M

返回码,详见附录

uniqueId

String(32)

M

系统返回唯一交易 ID

appId

Number(20)

M

APP ID

transactionId

String(128)

M

商户支付唯一 ID

transactionCurrency

String(3)

M

交易币种(CNY/USD)

transactionAmount

String(12)

M

交易金额

transactionCardNumber

String(20)

O

交易卡号,前六后四

billDescription

String(128)

O

账单信息

transactionMessage

String(255)

O

交易错误信息,可能是渠道直接返回的错误信息

redirectUrl

String(255)

O

3D 跳转 URL

transactionAt

String(32)

M

交易时间

message

String(255)

M

普通返回信息

timestamp

Number

M

返回时间戳

isTest

Boolean

M

当前交易是否为测试交易,真实交易返回 false

Last updated