Skip to content

支付

支付

/pay/order 订单支付

Method:  
    POST
请求:
    order_ids  M  str  订单号列表,json格式的字符串
    pay_method  M   int 支付方式,1:余额支付 2:微信支付
    client  O   str wx:微信支付 app:app支付 driver:司机支付
    coupon_use  O  list   
响应:
    code     M   int  
    msg      M   str
    data     O   dict
        appId    M   str
        timeStamp   M  int
        nonceStr    M   str
        package     M   str
        signType    M   str
        paySign     M   str
返回示例:
    余额支付时返回
    {
        "code": 0,
        "msg": "ok"
    }
    微信支付时返回
    {
        "code": 0,
        "msg": "ok"
        data:{
            "appId": APPID, 
            "timeStamp": 1599993993, 
            "nonceStr": NOUNCESTR,
            "package": "prepay_id=PREPARE_ID", 
            "signType": "MD5",
            "paySign": PAY_SIGN
        }
    }

/pay/charge 充值

Method: 
    POST
请求:
    amount  M  int  金额
    client  O   str wx:微信支付 app:app支付 driver:司机支付
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 预支付交易会话标识
    {
        'appId' M string 公众号ID
        'timeStamp' M string 时间戳
        'nonceStr' M string 随机字符串
        'package' M string 订单详情扩展字符串(统一下单接口返回的prepay_id参数值,提交格式如:prepay_id=***)
        'signType' M string 签名方式 暂支持MD5
        'paySign' M string 签名
    }
返回示例:
{
    "code": 0,
    "msg": "ok"
    data:{
        "appId": APPID, 
        "timeStamp": 1599993993, 
        "nonceStr": NOUNCESTR,
        "package": "prepay_id=PREPARE_ID", 
        "signType": "MD5",
        "paySign": PAY_SIGN
    }
}

/pay/wx/auth 微信授权

Method:   
    POST
请求:
    pay_info_id  M  str  支付配置id
    page    M   str 授权后跳转页面,限数字和字母,重定向通过参数返回
    attach  O   str 前端attach数据,限数字和字母,重定向时候原样返回
响应:
    重定向到 /#/order/pay_immediately?page=PAGE&attach=ATTACH

/pay/wx/call/(?P.+)/(?P\w+) 公众号登录微信支付

Method:   
    GET
请求:
    pay_info_id  M  str  支付配置id
    page    M   str 授权后跳转页面,限数字和字母,重定向通过参数返回
    code    M   int
    state   M   str
响应:
    重定向到 {}?page=index#/order/pay_immediately?page={}&attach={}

/pay/wx/notify 微信推送支付结果

Method:  
    POST

/pay/wx/notify/(?P\w*) 微信推送支付结果可灰度

Method:  
    POST
请求:
    xml
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息

/pay/gift(判断一个 cms key 是否有充值赠送的功能并返回赠送金额)

接口名: /pay/gift
Method: GET
请求:
    无
响应:
    code M int 0 为成功,其它为失败
    msg M string 错误提示信息
    data M list 预支付交易会话标识
    {
        has_gift:bool,  # 这个 cms key 有无充值赠送的需求
        gift: [
            {
                money: int,     # 充值金额
                gift: int       # 赠送金额
            }, ...
        ]
    }

/pay/close 用户关闭支付

Method:  
    POST
请求:
    order_ids   M  list  订单号列表
    trade_no    M  str   支付流水号
响应:
    code     M   int  
    msg      M   str
    data     O   dict

/pay/hf/notify 汇付支付回调

Method:  
    POST