文档中心 平台运营商相关 员工支付

员工支付

1.使用场景

运营商(本身也是商家)与关爱通合作,在商家页面或app内员工选择关爱通资产时使用该接口。需要回调通知的话,请按要求提供接口。

该接口使用前提:

1.运营商需要在关爱通申请应用

2.商家收银台页面加载员工资产,选择去支付

2.接口调用说明

请求URL

https://openapi.guanaitong.tech/platformDealer/employee/pay

HTTP请求方式

POST

输入参数说明

(1)公共参数

发送请求是必须传入公共参数,详见公共参数

(2)私有参数

参数名称 是否必须 参数类型 长度限制 描述
buyer_open_id string 32 下单员工唯一标识
reason string [1,254] 下单原因
total_amount decimal [0.01,99999999.99] 下单金额
outer_trade_no string [2,22] 外部交易号
asset_type string 1积分,4额度 资产拉取接口中的type
asset_open_id string 32 选择的资产
notify_url string [1,254] 通知url,非同步,支付完成时进行通知结果,与同步返回结果一致.如需使用请按照下面的文档提供接口
attach string [1,100] 附加信息,原样返回,复杂参数建议urlencode
请求示例
POST /platformDealer/employee/pay HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

access_token=b983eef183a789a693b91406f38b7e23&attach=测试&
asset_type=1&asset_open_id=a5fad9894edd0d2202639248fa0461ec&
buyer_open_id=d87797eea12a2f80ad72ed93214a0908&outer_trade_no=1000000001&
timestamp=1531039298&reason=午餐支付-金额:100.01积分&total_amount=100.01&
trade_info={"thirdTradeNo":"100001"}&version=1.0.0
                    
返回参数说明
参数名称 描述
code 返回码。详见错误返回码
msg 如果错误,返回错误信息。
data 如果没有错误,返回关爱通交易号
正确返回示例
{
    "code": 0,
    "data": "2020070220000015",
    "msg": "OK"
}
错误返回示例
{
    "code": 1001220005,
    "msg": "外部交易号已存在",
    "data": null
}

3.支付回调

请求URL

调用支付接口时,填写的notify_url

HTTP请求方式

POST

输入参数说明
参数名称 参数类型 描述
appid string 应用appid
outer_trade_no string 外部交易号
buyer_open_id string 下单人open_id
attach string 前面附带的信息
total_amount decimal 下单金额
trade_no string 关爱通交易号(支付结果)不为空时,表示支付成功;为空时,表示支付失败
timestamp string 时间戳,其值为1970-1-01 00:00:00.000到当前时刻的时间距离,单位是秒,时区为GMT+8(东八区)。如1469691921。关爱通接口允许的时间戳偏差为5分钟,偏差超过5分钟的请求将被拒绝。
sign string 签名
请求示例
POST 商家URI,如:/syncPay/notify HTTP/1.1
Host: 商家域名,如:test.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

appid=20110698&outer_trade_no=1000000005&total_amount=100.00&
buyer_open_id=d87797eea12a2f80ad72ed93214a0908&trade_no=2018070920000005&
timestamp=1531120153&sign=31f531d0ca40e6d7fb02688564f637f458e63ec8
                    
返回参数说明

(1)商家在收到了请求、校验通过后,即时更新订单状态,并返回success(不要带任何其他源码内容);

(2)若关爱通请求无响应或者接收的内容不是“success”,则认为通知失败,等一段时间后会再次请求(notify请求会在此后24小时内按递增时间间隔继续发送通知,通知次数最多为10次,超过10次就放弃);

(3)notify仅为通知,不论成功或失败都不会改变关爱通的订单状态;

正确返回示例
success
错误返回示例
fail