接口描述
项 | 值 |
url | https://pay.qcloud.com/cpay/deposit_consume |
输入参数
参数名 | 必填 | 类型 | 说明 |
request_content | 是 | String | 请求内容,该 string 可以转为 json 结构,json 格式见本节 RequestContent。 |
authen_info | 是 | AuthenInfo | 认证信息,详见接口调用说明。 |
RequestContent 结构
一级参数名 | 二级参数名 | 三级参数名 | 必填 | 类型 | 说明 |
out_trade_no | - | 是 | String(32) | 由客户端生成的订单号,前缀必须是云支付订单前缀。 | |
| total_fee | - | 是 | Number(32) | 订单总金额,单位:分。 |
| fee_type | - | 是 | String | 货币类型(目前只支持人民币,请填 CNY)。 |
| body | - | 是 | String(128) | 商品或订单简要描述。 商品描述交易字段格式根据不同的应用场景按照以下格式: PC 网站:传入浏览器打开的网站主页 title 名-实际商品名称,例如:腾讯充值中心-QQ 会员充值。 公众号:传入公众号名称-实际商品名称,例如:腾讯形象店-image-QQ 公仔。 H5:应用在浏览器网页上的场景,传入浏览器打开的移动网页的主页 title 名-实际商品名称,例如:腾讯充值中心-QQ 会员充值。 线下门店:门店品牌名-城市分店名-实际商品名称,例如:image 形象店-深圳腾大-QQ 公仔。 App:需传入应用市场上的 App 名字-实际商品名称,天天爱消除-游戏充值。 |
| detail | - | 否 | String | 商品详细列表,由 json 转化而来,json 结构见公共数据结构 Detail。 |
| remark | - | 否 | String(127) | 支付备注信息。 |
| wxpay_pay_content_ext* | attach | 否 | String(127) | 附加数据,记录子商户自定义数据。 |
| | goods_tag | 否 | String(32) | 商品标记,代金券或立减优惠功能的参数。 |
| | product_id | 否 | String(32) | 商品 ID,子商户自定义。 |
| | limit_pay | 否 | String(32) | 定支付方式,目前只能是 no_credit,指定不能使用信用卡支付。 |
| out_freeze_no | - | 是 | String(32) | 冻结押金授权单号。 |
| is_confirm_unfreeze | - | 是 | Bool | 是否解冻用户金额(微信支付目前只能为 true,支付宝可以为 true/false)。 |
pay_mch_key | pay_platform | - | 是 | Number(32) | 第三方支付类型,详见枚举 PayPlatform。 |
| out_mch_id | - | 是 | String(32) | 服务商对外账号。 |
| out_sub_mch_id | - | 是 | String(32) | 子商户对外账号。 |
| out_shop_id | - | 是 | String(32) | 门店对外账号。 |
order_client | device_id | - | 是 | String(64) | 子商户自定义,终端设备号。 |
| staff_id | - | 否 | String(64) | 子商户自定义,店员 ID。 |
| terminal_type | - | 是 | Number(32) | 终端类型,1:Windows,2:Andriod,3:iOS,4:Linux,100:其他。 |
| sdk_version | - | 是 | String(10) | 云支付 SDK 版本号。 |
| spbill_create_ip | - | 是 | String(16) | 调用云支付 API 的机器 IP。 |
| sn_code | - | 否 | String(127) | 设备 sn 号。 |
nonce_str | - | - | 是 | String(32) | 随机字符串。 |
*:微信支付的订单才需要 wxpay_pay_content_ext。
输出参数
参数名 | 必填 | 类型 | 说明 |
response_content | 是 | ResponseContent | 请求内容,详见本节 ResponseContent。 |
authen_info | 否 | AuthenInfo | 认证信息,详见接口调用说明。 |
ResponseContent 结构
参数名 | 必填 | 类型 | 说明 |
status | 是 | Status | 错误码,详见 Status。0:成功;非0:失败。 |
description | 否 | String(255) | 错误描述。 |
log_id | 是 | Number(32) | 消息 ID。 |
internal_status | 是 | Number(32) | 调试使用,调用者可以不予理会。 |
deposit_consume | 否 | DepositConsumeResponse | authen_info 存在时必填。详见 DepositConsumeResponse。 |
DepositConsumeResponse 结构
参数名 | 必填 | 类型 | 说明 |
order_content | 是 | OrderContent | 订单信息,详见公共数据结构 OrderContent。 |
pay_mch_key | 是 | PayMchKey | 支付商户信息,详见公共数据结构 PayMchKey。 |
nonce_str | 是 | String(32) | 随机字符串。 |
示例
输入参数示例:
{"authen_info": {"a": {"authen_type": 1,"authen_code": "88AB365DFF57E383FDF5D189A3177274A0054C38BAAC8549D45E57013E7429EE"}},"request_content": "{"pay_mch_key": {"out_shop_id": "sz011biKxOguirmBqiFR","out_sub_mch_id": "sz01KzuCUOmw8yjtPite","out_mch_id": "sz01lXKA6DKGjNzr2l4B"},"nonce_str": "E94C00688C3F429CA2B0B396BF823548","order_client": {"staff_id": "1206","machine_no": "00-05-9a-3c-7a-00","terminal_type": 1,"sdk_version": "1.0","device_id": "824","spbill_create_ip": "90.0.00.0"},"pay_content": {"body": "body","out_freeze_no": "sz010002cz11566541562","is_confirm_unfreeze": true,"out_trade_no": "sz010002cz11566541614","total_fee": 1,"fee_type": "CNY"}}"}
输出参数示例:
{"response_content": "{"status": 0,"description": "\\u64CD\\u4F5C\\u6210\\u529F\\u3002","log_id": 1915124595,"internal_status": 0,"deposit_consume": {"pay_mch_key": {"pay_platform": 1,"out_mch_id": "sz01lXKA6DKGjNzr2l4B","out_sub_mch_id": "sz01KzuCUOmw8yjtPite","out_shop_id": "sz011biKxOguirmBqiFR","sub_pay_platform": 100,"wxpay_pay_mch_key_ext": {"app_id": "wx998fa95558590e1c","sub_app_id": ""}},"order_content": {"out_trade_no": "sz010002cz11566541614","transaction_id": "4200000377201908231038860810","trade_type": 1,"time_expire": 1566541734,"time_end": 1566541615,"nonce_str": "E94C00688C3F429CA2B0B396BF823548","create_time": 1566541614,"last_update_time": 1566541615,"is_transforming": false,"caller_notify_url": "","total_fee": 1,"fee_type": "CNY","cash_fee": 1,"cash_fee_type": "CNY","settlement_total_fee": 1,"body": "body","wxpay_order_content_ext": {"current_trade_state": 14,"attach": "","bank_type": "CFT","goods_tag": "X293123","limit_pay": ""},"out_freeze_no": "sz010002cz11566541562","freeze_fee": 10,"is_deposit_mode": true,"is_confirm_unfreeze": true,"manual_unfreeze_fee": 9,"freeze_id": "4200000377201908231038860810"},"nonce_str": "3cRILhFBSAK4wsTpy1eHmgJlSThLncdV"}}","authen_info": {"a": {"authen_type": 1,"authen_code": "0F8B6390E46E99D0967F2F15C48D9FB0527A63C9BD3E2D341A3BFECA3EEC7B0A"}}}