alipay_cn/alipay_hk direct 文档
POST
/api时序图
sequenceDiagram
Customer->>Merchant: 点击支付
Merchant->>UseePay Server: 调用/api接口
UseePay Server->>Merchant: Response[resultCode=pending]
Merchant->>Customer: 展示response[redirectUrl]
Customer->>Alipay Server: 进行支付
Alipay Server ->> UseePay Server: 同步通知支付结果
Alipay Server -->> UseePay Server: 异步支付结果
UseePay Server->>Merchant: 展示支付结果
Merchant->>Customer: 展示支付结果通知请求支付时传输的redirectUrl页面
UseePay Server-->>Merchant: 异步通知notifyUrl接口
Request 请求参数说明
PayerInfo Object
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
paymentMethod | Y | String | alipay_cn/alipay_hk |
osType | Y | String | terminalType为WAP的时候必传IOS/ANDROID |
terminalType | Y | String | WEB/WAP |
UserInfo Object
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
userId | N | string | max=128 用户id |
ip | Y | string | max=128 IPv4或IPv6 |
N | string | max=128用户邮箱 | |
phoneNo | N | string | max=32 用户手机号 |
OrderInfo Object
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
subject | Y | String(128) | 订单标题,可以是商品名称 |
goodsInfo | N | Array Json String (4096) | 商品信息, 请参考 goodsInfo |
goodsInfo
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
name | Y | String | 商品名 |
body | Y | String | 商品描述 |
quantity | Y | number | 商品数量 |
price | Y | String | 商品价格,必须大于0,单位为对应货币的最小货币单位参考货币单位一节 |
url | N | String | 商品链接 |
image | N | String | 商品图片 |
paymentMethodOptions 支付方式
paymentMethodOptions是一个对象,可以通过paymentMethod从中取值
{
"alipay_cn": {
"checkoutUrl": "https://oss-local.marmot-cloud.com/page/simulation-wallet/cn/index.html?url=alipayconnect%3A%2F%2Fplatformapi%2Falipayconnectcode%3Fcode%3D281666040092t2u16IPnh8YNEC7QF1Uv3THA%26pspName%3DALIPAY_CN&webUrl=https%3A%2F%2Fpsp.ac.alipay.com%2Fpage%2Fsimulation-wallet%2Facwallet%2Falipayconnectcode.html%3Fcode%3D281666040092t2u16IPnh8YNEC7QF1Uv3THA%26pspName%3DALIPAY_CN&loadMode=2",
"schemeUrl": "alipayconnect://platformapi/alipayconnectcode.html?code=281666040092t2u16IPnh8YNEC7QF1Uv3THA&pspName=ALIPAY_CN&loadMode=2"
}
}
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
checkoutUrl | Y | String | alipay收银台地址 |
schemeUrl | C | String | WAP返回app可以调用 |
appLinkUrl | C | String | WAP返回app可以调用 |
codeUrl | C | String | WEB 端返回 二维码图片地址 |
codeValue | C | String | WEB端返回二维码的值 |
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/x-www-form-urlencoded
Body 参数application/x-www-form-urlencoded
transactionType
string
交易类型: pay
示例值:
pay
version
string
必需
目前固定为1.0(5)
示例值:
1.0
signType
string
必需
商户生成签名字符串所使用的签名算法类型,目前支持:RSA/MD5
示例值:
MD5
merchantNo
string
商户号
示例值:
500000000007362
transactionId
string
商户订单号
示例值:
202212070142347
transactionExpirationTime
string
可选
单位分钟,不能超过10分钟
示例值:
10
appId
string
网站域名
示例值:
www.pay.com
redirectUrl
string
跳转商户地址
示例值:
https://gatewaytest.useepay.com/gateway-test/redirectV2u0
notifyUrl
string
异步通知
示例值:
https://gatewaytest.useepay.com/gateway-test/notifyV2u0
echoParam
string
可选
回声参数,响应报文会原样返回
示例值:
echoParam
payerInfo
string
付款方信息
示例值:
{ "paymentMethod": "alipay_cn", "osType": "terminalType为WAP的时候必传IOS/ANDROID" , "terminalType": "WEB/WAP"}
orderInfo
string
订单信息
示例值:
{"subject":"order title","goodsInfo":[{"id":"商品编号","name":"商品名称","body":"商品描述","category":"商品类目","categoryTree":"商品类目树,不同级别类目使用”|”分割","brand":"商品品牌","quantity":1,"price":1234,"url":"商品url","sku":"商品sku","image":"商品图片url"}],"shippingAddress":{"email":"haile1y@useepay.com","phoneNo":"123123","firstName":"Victor","lastName":"Yang","street":"Heathcoat House, 20 Savile Row","postalCode":"W1S 3PR","city":"London","state":"LND","country":"GB"}}
userInfo
string
消费者信息
示例值:
{ "userId": "victor007", "ip": "103.25.65.178", "email": "victor.yang@useepay.com", "phoneNo": "(323) 585-4433" }
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
amount
string
必需
resultCode
string
必需
sign
string
必需
errorCode
string
必需
transactionId
string
必需
errorMsg
string
必需
transactionType
string
必需
reference
string
必需
echoParam
string
必需
signType
string
必需
nextAction
string
必需
currency
string
必需
merchantNo
string
必需
示例
成功示例
{
"amount": "100",
"resultCode": "pending",
"sign": "e7bde1f2385ca2b115649d1396f33f2d",
"errorCode": "3200",
"transactionId": "202404240600542",
"errorMsg": "Payment in progress",
"transactionType": "pay",
"reference": "1012404241800712324",
"echoParam": "echoParam",
"signType": "MD5",
"nextAction": "{\"alipay_cn\":{\"checkoutUrl\":\"https://oss-local.marmot-cloud.com/page/simulation-wallet/cn/index.html?url=alipayconnect%3A%2F%2Fplatformapi%2Falipayconnectcode%3Fcode%3D281666040092t2u16IPnh8YNEC7QF1Uv3THA%26pspName%3DALIPAY_CN&webUrl=https%3A%2F%2Fpsp.ac.alipay.com%2Fpage%2Fsimulation-wallet%2Facwallet%2Falipayconnectcode.html%3Fcode%3D281666040092t2u16IPnh8YNEC7QF1Uv3THA%26pspName%3DALIPAY_CN&loadMode=2\",\"schemeUrl\":\"alipayconnect://platformapi/alipayconnectcode.html?code=281666040092t2u16IPnh8YNEC7QF1Uv3THA&pspName=ALIPAY_CN&loadMode=2\"}}",
"currency": "CNY",
"merchantNo": "500000000008901"
}
最后修改时间: 1 个月前