# 免密支付交易接口

最新更新时间:2024.05.16

发起单笔免密支付交易。

# 接口说明

请求URL: https://{domain}/open-api/pay/trade/v1

请求方式: POST

业务请求参数

名称 必填 类型 说明
osMerchantCode string 开放平台为商户生成的唯一编号
osStoreCode string 开放平台为门店(停车场)生成的唯一编号
ownerTradeNo string 商户交易订单号,要求唯一
payChannel string 支付渠道
ALI_PAY:支付宝;
WX_PAY:微信;
CMB:招行一网通;
payProduct string 支付产品类型
APP:手机App客户端;
MINI_APP:小程序;
M_WEB:手机网页支付;
PC_WEB:电脑网页支付;
USER_QR:用户扫描商家二维码支付;
MCH_QR:商家扫描用户付款码支付;
FACE:刷脸付
osPaySettingNo string 支付配置编号
title string 单标题 最长256
remark string 给支付平台的附加信息,支付平台会原封回调给对用方
orderFee int 订单总金额 单位分 范围 1 ~ 1000000000
notifyUrl string 通知地址 通知URL必须为直接可访问的URL,不允许携带查询串,要求必须为https地址。
timeExpire long 绝对超时时间,时间戳,标准北京时间,超时失效
quitUrl 条件必传 string 支付宝手机网页支付必传,用户付款中途退出返回商户网站的地址
ownerBusinessNo string 商户维护:商户创建的订单业务号,商户自传,支付回调原封返回
ownerPayTerminal string 商户支付终端,商户自传,支付回调原封返回
payBusiness string 支付业务,该参数传值必须提前在开放平台登记过,否则会导致交易失败,传入此值校验是否在平台开通,未指定时,不传
channelExtras map 下单自定义参数,例如免密支付需要上送协议号等

业务响应参数

名称 必传 类型 说明
osTradeNo string 开放平台交易记录唯一订单号
ownerTradeNo string 第三方商户创建的唯一订单号
orderFee int 该笔订单的资金总金额 单位为分
timestamp long 时间戳,标准北京时间
sign string 调起支付的签名信息
用户扫码支付:统一返回url链接
支付宝:返回的String可直接调用支付宝sdk拉起支付
微信支付:返回Json字符串

SDK方法

Map<String, Object> channelExtras = new HashMap<>();
channelExtras.put("osAgreementNo", "xxx");
TradeRequest request = TradeRequest
        .builder()
        .osMerchantCode("xxx")
        .osStoreCode("xxx")
        .ownerTradeNo("xxx")
        .payChannel("CMB")
        .payProduct("PASSWORD_FREE")
        .osPaySettingNo("xxx")
        .title("免密支付")
        .remark("免密支付")
        .orderFee(50)
        .notifyUrl("xxx")
        .timeExpire(xxx)
        .payBusiness("xxx")
        .channelExtras(channelExtras)
        .build();
Results<TradeResponse> trade = payServiceRsa2.trade(request);
     

入参格式

{
  "osMerchantCode": "osMerchantCode_53bfff63cc7a",
  "osStoreCode": "osStoreCode_cc3e367feb1c",
  "ownerTradeNo": "ownerTradeNo_0ffc7a9c2977",
  "payChannel": "payChannel_a2a00c0d70f7",
  "payProduct": "payProduct_3c9d2776585a",
  "osPaySettingNo": "osPaySettingNo_a12b60e5faff",
  "title": "title_9d6f5cb79d0e",
  "remark": "remark_29890e569340",
  "orderFee": 0,
  "notifyUrl": "notifyUrl_7abb4d8e9816",
  "timeExpire": 0,
  "quitUrl": "quitUrl_254e35f65877",
  "ownerBusinessNo": "ownerBusinessNo_3895b715e3b3",
  "ownerPayTerminal": "ownerPayTerminal_5fdec5015ad7",
  "ownerAppId": "ownerAppId_afed3dba6371",
  "ownerAppBuyerId": "ownerAppBuyerId_1896a54526a8",
  "payBusiness": "payBusiness_fc2655b6a0fb",
  "channelExtras": {}
}

出参格式

{
  "code": 8888,
  "msg": "处理成功",
  "data": {
    "osTradeNo": "trade_25409336886366208",
    "ownerTradeNo": "owner_trade_32192182",
    "orderFee": 1,
    "timestamp": 1637914727200,
    "sign": "xxx"
  }
}