页面跳转支付

此接口可用于用户前台直接发起支付,使用 form 表单跳转或拼接成 URL 跳转。

接口信息

POST https://epay.trycode.net/api/pay/submit

请求方式:POSTGET(推荐 POST,不容易被劫持)

请求参数

字段名 变量名 必填 类型 说明
商户ID pid Int 商户ID,由系统分配
支付方式 type String 支付方式列表
商户订单号 out_trade_no String 商户系统内的订单号,需确保唯一
异步通知地址 notify_url String 服务器异步通知地址
跳转通知地址 return_url String 页面跳转通知地址
商品名称 name String 商品名称,如超过127字节会自动截取
商品金额 money String 单位:元,最大2位小数
业务扩展参数 param String 支付后原样返回
签名字符串 sign String 签名算法
签名类型 sign_type String RSA2 或 MD5
提示

不传支付方式(type)参数时,会跳转到收银台页面让用户选择支付方式。

代码示例

<form action="https://epay.trycode.net/api/pay/submit" method="post">
    <input type="hidden" name="pid" value="1001">
    <input type="hidden" name="type" value="alipay">
    <input type="hidden" name="out_trade_no" value="20230101120000001">
    <input type="hidden" name="notify_url" value="https://www.example.com/notify.php">
    <input type="hidden" name="return_url" value="https://www.example.com/return.php">
    <input type="hidden" name="name" value="测试商品">
    <input type="hidden" name="money" value="1.00">
    <input type="hidden" name="sign" value="签名字符串">
    <input type="hidden" name="sign_type" value="RSA2">
    <button type="submit">立即支付</button>
</form>