开发
API

tt.pay 接入常见问题

下面列出了调用 tt.pay 较为常见的问题 case 与排查方案

1. 未拉起收银台

请检查使用的版本是否满足 tt.pay 的版本要求

如果当前版本满足但仍未拉起,请在 小程序开发者社区 提供更详细的信息(录屏,调用代码片段等)帮助我们更好地排查问题

2. 下单失败

下单失败的表现是拉起了收银台,但界面上会展示报错的 toast(展示错误码,如 CD0013);常见下单失败错误码含义详见:附录 下单失败错误码。如果按错误码含义尝试修复后,依然无法解决,请提供 merchant_idout_order_no 帮助我们定位具体原因

2.1 下单报错

下单失败后,提示错误码 CD0402;常见原因为订单已经超过有效时间:重点排查 valid_time 字段设置,注意该字段单位为秒,且需要传入时间长度,传入时间戳会导致订单立即失效。如果尝试以上修复后依然无法解决,请提供 merchant_idout_order_no 帮助我们定位具体原因

3. 拉起支付宝失败

确保支付接口传递的 orderInfo.alipay_url 参数能正常拉起支付宝。

利用 支付宝提供的测试 demo 检测 url 能否正常拉起支付宝 app

3.1 支付宝报错 ALIN10146

请按照如下方法自行排查拉起支付宝 App 支付的参数是否正确:ALIN10146-自查方案

4. 拉起微信支付失败

排查点 1: 确保支付接口传递的 orderInfo.wx_url 正常传入,且 orderInfo.wx_type'MWEB'

排查点 2: 打开调试模式:

tt.pay({
    ...,
    _debug: 1
})

请求微信支付的时候会展示微信的 H5 页面(记得在线上环境去掉该参数)

4.1 商家参数格式有误,请联系商家解决

请确保商户在微信 微信商户平台 申请开通微信 H5 支付,并配置 H5 支付域名为 snssdk.com

4.2 网络环境未能通过安全验证,请稍后再试

该错误与用户侧出口 IP 变化有关;普通家庭 Wi-Fi 或 4G 网络不会出现该问题

5. 没有默认支付方式

tt.pay 中配置默认支付方式(支付宝或微信)

tt.pay({
  service: 1,
  orderInfo: {...},
  payChannel: {
    default_pay_channel: 'alipay' // wx || alipay
  }
})

6. 微信支付成功后怎么检测状态

由于头条无法代为保存商户在微信支付侧的 secret,因此用户在微信支付成功后跳转返回小程序收银台后需商户自行查询订单在微信支付的状态:

tt.pay({
    ...
    getOrderStatus(res) {
        const {out_order_no} = res // 商户侧订单号
        return new Promise((resolve) => {
            // 商前端请求商户后端获取订单在微信支付的状态,方法需商户自行实现
            // ...获取 code
            // 0:支付成功
            // 1:支付超时
            // 2:支付失败
            // 3:支付关闭
            // 9:订单状态未知/未支付
            resolve({code}); // 回传收银台微信支付订单状态
        })
    }
})

附录

下单失败错误码:

错误码描述
TS4113参数错误。订单信息不正确。可能原因:
1. 订单创建时间 + 有效时间必须大于当前时间
TS4106参数错误。订单信息不正确。可能原因:
1. 如果两次支付传入的订单号(out_order_no)相同,则必须保证 trade_time 也相同。 2. trade_time 值非法,trade_time 必须大于 0
TS4104参数错误。订单名称长度要小于 50 字符
PC1350参数错误[PC1350]
CD1805您输入的密码不匹配,请重新输入[CD1805]
MT2004支付验证失败,请前往【钱包】-【支付管理】重新开通指纹支付[MT2004]
PS0401重复订单[PS0401]
AS1400内部错误[AS1400]
MP3008会员创建失败[MP3008]
WS1340卡信息获取失败[WS1340]
CD2112指纹设备数据变更[CD2112]
AS0401重复记录[AS0401]
AS1001账户已经存在[AS1001]
CH9000订单不存在[CH9000]
CD1811当次验证码错误次数超限,请稍后再试
PC1100服务器内部错误[PC1100]
CD1803您输入的证件号同本账户已实名的姓名不匹配[CD1803]
PS1600本次支付存在风险,请更换其他支付方式或稍后重试[PS1600]
CD1815服务暂不可用,请稍后再试
CS1001失败[CS1001]
WS1331操作场景不匹配[WS1331]
MP4006请填写本人支付宝账号[MP4006]
MP4009业务高峰期,系统繁忙,请您稍后再试[MP4009]
PC2000卡券调用成功[PC2000]
WS1500渠道侧明确失败[WS1500]
AS0000成功
AS0420幂等返回失败[AS0420]
MP0000处理成功
MT1006新旧密码不能相同
PS0502回调上游业务方失败[PS0502]
CD0402交易已失效,请您重新下单
-1服务暂不可用,请稍后再试[-1]
PS1310订单已过期[PS1310]
AS0300权限不足[AS0300]
CD0497服务暂不可用,请稍后再试[CD0497]
CS4004获取签约信息失败[CS4004]
GW40007网关内部逻辑错误[GW40007]
MB0004系统错误[MB0004]
MT1008修改用户密码等级错误[MT1008]
PC1000订单失败[PC1000]
PS0000成功
PS1340卡信息获取失败[PS1340]
CD0111服务暂不可用,请稍后再试[CD0111]
CD0120服务器开小差了,请重试[CD0120]
CD2107单日累计支付金额超限[CD2107]
MB4001路由错误[MB4001]
MP8002帐号已绑定银行卡,暂不可注销[MP8002]
MP0003系统错误[MP0003]
PS1601单日支付金额超限[PS1601]
CD0020服务暂不可用,请稍后再试[CD0020]
AS0403非法的记录状态[AS0403]
PC2002卡券使用失败[PC2002]
PS1301需要验证码[PS1301]
CD0013服务暂不可用,请稍后再试[CD0013]
CD1820未成功回调,请重试[CD1820]
WS1601单日提现金额超限[WS1601]
TS3300银行卡余额不足,请使用其他银行卡或添加新卡支付[TS3300]
TS4009业务高峰期,系统繁忙,请您稍后再试[TS4009]
PC1200订单超时[PC1200]
CD0014服务暂不可用,请稍后再试[CD0014]
CD0403服务暂不可用,请稍后再试[CD0403]
CD1823账户注销失败[CD1823]
CD2100本次操作存在风险
CD1901服务暂不可用,请稍后再试[CD1901]
CD2109应用版本低,请先升级至最新版[CD2109]
AS1701非法的资金流动方向[AS1701]
PS0403非法的订单状态[PS0403]
CD0000成功
MP0006参数缺失[MP0006]
MB4002因系统升级,暂不支持新卡支付[MB4002]
CD0017服务暂不可用,请稍后再试[CD0017]
CD2101单日提现金额超限[CD2101]
CH6002支付单不存在[CH6002]
PC1201服务器内部错误[PC1201]
WS1602单日提现笔数超限[WS1602]
40001服务暂不可用,请稍后再试[40001]
AS1401未知的错误码,请向开发者反应[AS1401]
PS1401未知的错误码,请向开发者反应[PS1401]
CD00151. 缺少 orderInfo 必传字段导致,请检查 tt.pay 中必传参数是否完整;
2. total_amount 应是以分为单位的整数
3. 同一订单两次调用 tt.pay 时传入的 trade_time 不一致,请确保同一订单 trade_time 一致;
CD1821一个手机号最多可以绑定 5 个登录账号,请绑定其他手机号码[CD1821]
PC1351处理中[PC1351]
GW40004内部服务错误[GW40004]
OM2001风控拦截[OM2001]
PC1352引擎执行错误[PC1352]
CD1800您尚未实名认证,请先实名认证[CD1800]
CD1819需要校验相同手机号下另一 uid 的支付密码,然后开户[CD1819]
MT1007用户密码过于简单[MT1007]
PS1603单笔支付金额超限[PS1603]
WS1339修单操作成功[WS1339]
CD1804两次输入的支付密码不同,请重新设置
MT1004用户密码已经存在[MT1004]
WS0501发号器错误[WS0501]
WS1401未知的错误码,请向开发者反应[WS1401]
WS1310订单已过期[WS1310]
CD0019服务暂不可用,请稍后再试[CD0019]
CD0113页面停留时间过长,为保障安全,请退出重新发起交易
MB1011绑卡数量超限[MB1011]
MT0002参数校验错误[MT0002]
MT1001密码错误
WS1600风控拦截[WS1600]
CD2110服务暂不可用,请稍后再试[CD2110]
CH8002验证码过期[CH8002]
CD0406交易处理中,请查询订单状态
MB1005解绑卡失败[MB1005]
MP0002系统错误[MP0002]
MP400903业务高峰期,系统繁忙,请您稍后再试[MP400903]
PC1001订单失败[PC1001]
CD0003服务暂不可用,请稍后再试[CD0003]
PC1353回调出错[PC1353]
CD0001尚未登录,请登录后重试
PS1311订单与流水不符[PS1311]
PS1341渠道商户号配置有误[PS1341]
WS1302验证码不对,请重新输入[WS1302]
MP0001参数错误[MP0001]
CD0409服务暂不可用,请稍后再试[CD0409]
AS1600风控拦截[AS1600]
MP6005查询账户失败[MP6005]
MT1003用户不存在[MT1003]
PC1355订单信息异常[PC1355]
PS0402订单不存在[PS0402]
CD1802您输入的证件号同本账户已实名的证件类型不匹配[CD1802]
WS0502回调上游业务方失败[WS0502]
WS0504服务暂不可用,请稍后再试[WS0504]
CH_SUB_0007银行卡号有误或该卡暂不可用,请尝试重新绑定后再试[CH_SUB_0007]
CD2102单日提现笔数超限,请明日再试[CD2102]
CH1000操作成功
PS0504服务暂不可用,请稍后再试[PS0504]
WS0503服务暂不可用,请稍后再试[WS0503]
WS1603单笔提现金额超限[WS1603]
PC1354查无此单[PC1354]
CD2106单笔支付金额超限[CD2106]
AS0505服务暂不可用,请稍后再试[AS0505]
AS1602单日提现笔数超限[AS1602]
CH8001验证码错误[CH8001]
CS0000成功
CH5000超时[CH5000]
AS0200服务暂不可用,请稍后再试[AS0200]
MT1005用户密码不存在[MT1005]
PS1303验证码已过期,请重新发送
TS400903业务高峰期,系统繁忙,请您稍后再试[TS400903]
WS1400内部错误[WS1400]
CD1817当前帐号未绑定手机号,请在账户中绑定手机号[CD1817]
MP6006账户不存在[MP6006]
PS0200参数错误[PS0200]
CD2105请输入短信验证码[CD2105]
AS0201服务暂不可用,请稍后再试[AS0201]
CH7001不支持的支付方式[CH7001]
MB1007解绑卡失败[MB1007]
PC3001当前交易状态不支持该请求[PC3001]
PS1332订单刚修改过请稍候重试[PS1332]
PS1504银行卡可用余额不足(如信用卡则为可透支额度不足),请核实后再试[PS1504]
CD0114服务器开小差了,请重试[CD0114]
AS1603单笔提现金额超限[AS1603]
MB0003参数错误[MB0003]
MB2002服务暂不可用,请稍后再试[MB2002]
MB3001会员不存在[MB3001]
PS1320退款失败[PS1320]
AS1702账户受限,该操作限制进行[AS1702]
PS1510回调状态不一致,本地显示该订单已经成功收款[PS1510]
CD0010您账户密码已经设置,不能再次设置[CD0010]
CD0400交易已成功,请查询订单状态
CD0407交易列表为空[CD0407]
CD1810验证码错误,请重新输入
CS1004参数错误[CS1004]
WS1332订单刚修改过请稍候重试[WS1332]
CD0002需要进行短信验证
CD0121服务器开小差了,请重试[CD0121]
CDI0000终止后续处理[CDI0000]
CH6003支付单不成功[CH6003]
CH6001订单已存在[CH6001]
ID0000成功
MB1001绑卡失败[MB1001]
PC1101并发错误[PC1101]
CD0018验证码错误
CD0115服务器开小差了,请重试[CD0115]
CD1822未找到可用提现银行卡[CD1822]
PC1203内部错误[PC1203]
WS1511回调状态不一致,本地显示该订单已经打款失败[WS1511]
CD1812获取验证码过于频繁,请稍后再试
RT0400因系统升级,暂不支持新卡支付[RT0400]
CD1824请确认输入正确的卡号
CD400920服务繁忙,请稍后再试[CD400920]
AS0020幂等返回成功[AS0020]
PC0200参数错误[PC0200]
CD1001服务暂不可用,请稍后再试[CD1001]
CD0110页面停留时间过长,为保障安全,请重试
CD0405服务暂不可用,请稍后再试[CD0405]
CD2111交易金额超限[CD2111]
MT0003签名验证错误[MT0003]
PC1001Failed
PS1331操作场景不匹配[PS1331]
AT1601Withdraw amount per day exceeds limit
MP8002Account that has been bound to bank card is unable to cancel.
WS0403Illegal order status
AT1340Failed to attain card information
AT0508Failed to call account_zone
AT1602Numbers of withdraw per day exceeds limit
MP0001Incorrect parameter
WS1302Incorrect verification code, please retry
CD2110Something Error
CD0020Failed to call downstream service
WS0000成功
CD1001System error, please retry.
CD1820System exception ,please retry
PC1203Internal error
WS0401Order repeated
CD0010Password has already existed.
PS1341Incorrect configuration of merchant
MP3029Identity information error
AS1001Account exists
AT0200Incorrect parameter
WS1310Order expired
WS1510回调状态不一致,本地显示该订单已经收款成功[WS1510]
CD0121System exception ,please retry
CD1800Please complete identity verification
AT0410Insufficient balance
PC2003Failed to write off
PS1320Failed to refund
AS0405Merchant&ProductId Already opened
CD1821Bind failed, please change phone number
CS4004Failed to attain sign information
MT1004Password already exist
PS1331Operating scenarios mismatch
WS1502渠道订单已存在[WS1502]
CD0401交易已失败,请您重新下单
CD0116业务方未配置支付方式。1. 请参考 支付商户申请流程 申请支付方式
2. wx_urlalipay_url 不可同时为空
WS1301Verification code is required
CD1807Sorry, your password has been locked
WS1303Expired verification code, please resend
AT0000Success
CD1804Password do not match
AT1332Order modifed just now.
MT1005Password not exist
PC1101Concurrency error
CD0404Incorrect account information, please retry
CD1807您的密码已经被锁定[CD1807]
AS0200Incorrect parameter
CD1806Your identity has been verified. Oversea identity is not supported.
CD1819System exception ,please retry
AT1511Inconsistent calling status. Order failed to receipt in system
CD0002SMS verification is required
CD0018Incorrect verification code
AS0300Insufficient permission
AS1601Withdraw amount per day exceeds limit
AT1304Order entrusted paying
MP0003System error
AS0402服务暂不可用,请稍后再试[AS0402]
MB1001Failed to bind card
PS0000Success
CH9000Oder not exist
CD1801ID number do not match
AT1339Success
CD0497System exception ,please retry
CD2102Numbers of withdraw per day exceeds limit
CH2000Failed
MT1006New password should be different from the previous one.
WS0200Incorrect parameter
PC0000成功
CD0011uid 最长支持 32 位

如不能解决请在反馈中提供 out_order_no 帮助我们定位具体原因
AT1603Withdraw amount per order exceeds limit
CH5000Timeout
CH6001Order repeated
CD0499Balance not enough
CD2104Live verification is required
AT1310Order expired
PS1330Order exception
WS1600Risk control interception
CD2101Withdraw amount per day exceeds limit
PS1330订单异常[PS1330]
CD2105SMS verification is required
AS1401Unknown error
AS0420Failed
PS1500Channel error
WS0402Order not exist
WS1331Operating scenarios mismatch
AT0401Record repeated
PC0200Incorrect parameter
PC2001Failed to verify
PS1340Failed to attain card information
PS0501发号器错误[PS0501]
AT0302Insufficient user permission
MB1009Card already exist
PS0403Incorrect order status
PS1510Inconsistent calling status. Order has been receipt in system
AT0300Insufficient permission
PC1201Server error
PS1401Unknown error
AS1701Illegal capital flow
AS0505Failed to call account
CH7001Method not supported
CD0112服务器开小差了,请重试
PS0200Incorrect parameter
CD0111Method error, please retry.
CD0407System exception, please retry
CD1814Failed to send SMS, please resend
CD1818Abnormal bank account status, please retry
AS0403Illgeal record status
PS1603Payment amount per order exceeds limit
WS0502Failed to call upstream business
CD0498Order exception, please do not re-order.
AS1600Risk control interception
CD2103单笔提现金额超限[CD2103]
CH6000System error
MT1002Password has been locked
CD1813Verification code is expired, please resend
AS1400Internal error
PS1304Order processing
CD1901Payment method not enabled
CD2103Withdraw amount per order exceeds limit
MB1003Card not exist
WS1602Numbers of withdraw per day exceeds limit
CD1812You are sending message too often. Please try again later.
AS0501发号器错误[AS0501]
CD0402Order expired. Please do not re-order
AS0506Failed to request account
AT1500Channel error
CH6003Failed
PS1504Insufficient balance or insufficient overdraft amount, please check and try again.
MB0000success
PS1400Internal error
WS1340Failed to attain card information
MT0000Success
CD1809Name mismatch
MB1003卡片不存在,请确认卡号后重新尝试解绑[MB1003]
CS1001Failed
CD0112Process error, please retry.
AT1331Operating scenarios mismatch
CD0016Incorrect password
MP3007User not exist
PC1354Order not exist
PS0503Failed to call channel
CD0400Order Success. Please do not re-order.
CD0406The order has been submitted, please view in transaction
MT1001Incorrect password
WS1303验证码已过期,需要重新发送[WS1303]
MT1009当前手机号绑定次数超限[MT1009]
PS1311Order does not match with bills
WS1304Order entrusted paying
CD0014Method error
CD0405Illegal request
PS0507Failed to call merchant
CD0001Please retry after login
CD0013System error, please retry.
CD0114Process error, please re-order
AT1330Order exception
MT1007Password should be more complicated
CH3000权限错误[CH3000]
WS1500Channel error
CD0019Internal exception
CD1810Incorrect verification code
AT0301Insufficient merchant permission
AT0501ID-Generator error
PC1100Server error
PS0401Order repeated
WS1332Order modifed just now.
PS0504Failed to call product member
AS0410Insufficient balance
PS1602单日支付笔数超限[PS1602]
CH6002Order not exist
CH3000Incorrect permission
MP6005Failed to query account
WS1603Withdraw amount per order exceeds limit
CD0110Timeout, please retry
PS0501ID-Generator error
CD0017Decryption error
AS0020Success
MB0005system error
PC1350Incorrect parameter
CD1809您输入的姓名与当前账户实名不一致,请核对[CD1809]
PC1351Processing
CS0000Success
CS1004Incorrect parameter
AT1400Internal error
CH1000Success
MT0002Parameter error
MB0003incorrect parameter
CD1808Please enter payment password
AT0420Failed
PS1600Risk control interception
CD1814服务暂不可用,请稍后再试
CD0113Page expired, please re-order.
AT0402Record not exist
AT0503Failed to call channel
PS1332Order modifed just now.
WS1401Unknown error
AS0201Inconsistent parameter
MT1003User not exist
MB0004system error
CD0401Order failed. Please do not re-order.
CD1817Abnormal bank account status, please retry
10000成功
WS0501ID-Generator error
WS0504Failed to call product member
WS1339Success
CD1805Password do not match
PC1000Failed
CD0012System error, please retry.
CD0120System exception ,please retry
AS1702Restricted operation. The account is restricted.
MT1008Fail to modify password.
PC1353Callback error
AS0411产品用户不存在[AS0411]
PS1602Number of Payment orders per day exceeds limit
PC3001Currect transaction status does not support this request
CD2100Risk Block
AT1303Expired verification code, please resend
AT0502Failed to call upstream business
AT1301Verification code is required
AT1302Incorrect verification code, please retry
AT1502Channel order exists
MP5004Incorrect merchant code
MT0003Signature error
AS1601单日提现金额超限[AS1601]
CD1816SMS exceeds the limit
AS0000Success
AS0402Record not exist
AT0020Success
AT0504Failed to call product_member
AT1600Risk control interception
MT0001System error
PC4001Unknown exception
PS0502Failed to call upstream business
PC1352Engine error
CD0116服务暂不可用,请稍后再试[CD0116]
CD1811Your message's max retries exceeded. Please re-send the message.
CH8002Expired verification code
CD1815Failed to send SMS, please resend
AT1701Illegal capital flow
-1Unknown error
MB1005Failed to unbind card
WS1511Inconsistent calling status. Order failed to receipt in system
WS1601Withdraw amount per day exceeds limit
CD0000Success
AT0403Illgeal record status
MP3007会员不存在[MP3007]
PC1355Order exception
PC2002Failed to use
PS0402Order not exist
PS1601Payment amount per day exceeds limit
CD1802ID type do not match
CD1803ID name do not match
MP6004Failed to create account
PC0000Success
PC2000Success
PS1310Order expired
CD1801您输入的证件号同本账户已实名的证件号不匹配[CD1801]
MP5004商户号错误[MP5004]
AT1702Restricted Profiles
CD0115Process error, please re-order
CD0403Payment confirm eorror, please retry
AS0411User not exist
AT1703The account has been cancelled
MP0002System error
MP6006Account not exist
WS1510Inconsistent calling status. Order has been receipt in system
WS0000Success
AT1401Unknown error
PS0503服务暂不可用,请稍后再试[PS0503]
CH8001Incorrect verification code
MP3008Failed to create member
ID0000Success
PS1303Expired verification code, please resend
OM2001Risk control interception
WS0503Failed to call channel
AS0401Record repeated
PC1200Timeout
PS1301Verification code is required
WS1400Internal error
PS1339修单操作成功[PS1339]
AT1510Inconsistent calling status. O
点击纠错
评价此篇文档