# 统一支付平台--协议支付测试总结
Posted chengtch
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了# 统一支付平台--协议支付测试总结相关的知识,希望对你有一定的参考价值。
统一支付平台--协议支付测试总结
1、相关接口
交易中心接口文档地址:
https://confluence.sui.work/pages/viewpage.action?pageId=20226667
1、/payment-trade-ws/ws/trade/v1/payRequest (代收请求)
2、/payment-trade-ws/ws/trade/v1/payResult (代收结果查询)
3、/payment-trade-ws/ws/trade/v1/remitRequest (代付请求)
4、/payment-trade-ws/ws/trade/v1/remitResult (代付结果查询)
5、/payment-trade-ws/ws/trade/v1/refund (退款请求)
6、/payment-trade-ws/api/v1/refund/result (退款结果查询)
7、/payment-trade-ws/ws/trade/v1/agreePayRequest(协议支付请求)
8、/payment-trade-ws/ws/trade/v1/agreePayConfirm(协议支付请求确认)
9、/payment-trade-ws/ws/trade/v1/agreePayRoute(协议支付预路由)
10、/payment-trade-ws/ws/trade/v1/agreePayCommit(协议支付免验)
实名中心接口文档地址:
https://confluence.sui.work/pages/viewpage.action?pageId=19239738
1、/payment-realname-ws/api/v1/realname/check (用户实名)
2、/payment-realname-ws/api/v1/realname/info (用户实名信息查询,须在绑卡鉴权成功后)
鉴权中心(目前只有离线接口文档):
设计图及设计文档:
https://www.processon.com/view/link/5b24bfc6e4b0723312592259
https://confluence.sui.work/pages/viewpage.action?pageId=19236760
1、/payment-auth-ws/api/v1/auth/request (鉴权请求)
2、/payment-auth-ws/api/v1/auth/con?rm (鉴权确认)
3、/payment-auth-ws/api/v1/card/list (绑卡列表)
4、/payment-auth-ws/api/v1/bankcard/supportStatus (查询银行卡支持情况)
5、/payment-auth-ws/api/v1/card/plaintext/getByTradeAgreeNo (根据交易协议号查询绑定的银行卡信息)
2、测试流程
2.1 用户实名
实名流程:
调用接口:/payment-realname-ws/api/v1/realname/check
1)首次实名
数据入库: 实名流水表和实名信息表finance_payment_realname.t_real_name_flow
、finance_payment_realname.t_user_info
实名验证成功入库流水表t_real_name_flow
及t_user_info
表,实名不通过则仅入库流水表
2)非首次实名
优先查询t_user_info
表中的用户数据是否匹配,匹配则流水表中插入一条实名记录;不匹配则会调用第三方鉴权渠道做实名鉴权,实名验证成功入库流水表t_real_name_flow
及t_user_info
表,实名不通过则仅入库流水表
2.2 绑卡鉴权
P.S:删数据sql脚本
# 抹掉指定手机号对应用户的所有鉴权信息
SELECT @phone:= encrypt_bank_phone from finance_payment_auth.t_user_bank_card where bank_phone like ‘%2905%‘;
SELECT @ta:=trade_account FROM finance_payment_auth.t_bank_card_repo WHERE encrypt_bank_phone = @phone;
SELECT @puid:=puid FROM finance_payment_auth.t_user_bank_card WHERE trade_account = @ta;
DELETE FROM finance_payment_auth.t_bank_card_auth_info WHERE trade_account = @ta;
DELETE FROM finance_payment_auth.t_auth_request where encrypt_bank_phone = @phone;
DELETE FROM finance_payment_auth.t_bank_card_repo WHERE trade_account = @ta;
DELETE FROM finance_payment_auth.t_merchant_trade_account WHERE trade_account = @ta;
DELETE FROM finance_payment_auth.t_platform_trade_account WHERE trade_account = @ta;
DELETE FROM finance_payment_auth.t_user_bank_card WHERE trade_account = @ta;
DELETE FROM finance_payment_user.t_platform_user WHERE [email protected];
DELETE FROM finance_payment_user.t_user WHERE [email protected];
鉴权流程:
1)通用流程(不含adviceToken)-- 适用于卡贷特性
请求鉴权,调用鉴权请求接口:
- 若用户在指定渠道下鉴权过,则通过本地库
finance_payment_auth.t_user_bank_card
校验四要素,校验通过由随手记发短验。 - 若用户在指定渠道未鉴权过,则会调用第三方渠道(目前是通联)做鉴权,校验通过由第三方发送短验。
鉴权确认,调用鉴权确认接口:
- 根据鉴权请求订单号和短验,做鉴权确认即可。
2)非标定制流程(含adviceToken) -- 适用于非标
走预路由—>鉴权请求->鉴权确认
获取非标定制的adviceToken
通过adviceToken做鉴权请求,若对应渠道下已经鉴权通过过,此时绑卡短验由随手记发送
鉴权确认
相关表:
select * from finance_payment_auth.t_auth_request order by id desc limit 10; # 鉴权请求流水表
select * from finance_payment_auth.t_user_bank_card order by id desc limit 10; # 用户绑卡记录表
select * from finance_payment_auth.t_bank_card_auth_info order by id desc limit 10; # 银行卡鉴权信息表
2.3 协议支付交易
1)非标协议支付交易走免短验支付流程
- 调用接口:
/payment-trade-ws/ws/trade/v1/agreePayCommit
- 请求报文: 对应用户的tradeAgreeNo和adviceToken需从
finance_payment_auth.t_auth_request
表中获取
2)通用支付交易流程
调用接口:
支付请求:/payment-trade-ws/ws/trade/v1/agreePayRequest
支付确认:/payment-trade-ws/ws/trade/v1/agreePayConfirm
交易报文:
request
confirm
3) 退款流程(卡贷)
涉及接口:
/payment-trade-ws/ws/trade/v1/refund
/payment-trade-ws/api/v1/refund/result退款只针对收款成功的订单,我们通过查询db获取可退款的订单
请求退款:调退款接口
查询退款结果:状态说明(1-等待,2-成功,3-失败,4-过期)
退款实际上就是走代付流程,因此我们要关注代付中心中的代付结果状态
# 代付中心
select * from finance_account_pay.t_remit_batch order by id desc limit 10;
select * from finance_account_pay.t_remit_detail order by id desc limit 10;
select * from finance_account_pay.t_remit_out_batch order by id desc limit 10;
select * from finance_account_pay.t_remit_out_detail order by id desc limit 10;
3 接口调用顺序图
统一支付平台相关接口
以上是关于# 统一支付平台--协议支付测试总结的主要内容,如果未能解决你的问题,请参考以下文章
***微信公众号支付+微信H5支付+微信扫码支付+小程序支付+APP微信支付解决方案总结