接口描述
项 | 值 |
url | https://pay.qcloud.com/cpay/micro_pay |
输入参数
参数名 | 必填 | 类型 | 说明 |
request_content | 是 | String | 请求内容,该 string 可以转为 json 结构,json 格式见本节 RequestContent。 |
authen_info | 是 | AuthenInfo | 认证信息,详见接口调用说明。 |
RequestContent 结构
一级参数名 | 二级参数名 | 三级参数名 | 必填 | 类型 | 说明 |
out_trade_no | - | 是 | String(32) | 由客户端生成的订单号,前缀必须是云支付订单前缀。 | |
? | author_code | - | 是 | String(256) | 刷卡支付授权码。 |
? | total_fee | - | 是 | Number(32) | 订单总金额,单位:分。 |
? | fee_type | - | 是 | String | 货币类型(目前只支持人民币,请填 CNY)。 |
? | client_flow_id | - | 否 | String | 客户端流水号。 |
? | 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) | 商品标记,代金券或立减优惠功能的参数。 |
? | ? | limit_pay | 否 | String(32) | 定支付方式,目前只能是 no_credit,指定不能使用信用卡支付。 |
pay_mch_key | pay_platform | - | 是 | Number(32) | 第三方支付类型,详见枚举 PayPlatform。 |
? | sub_pay_platform | - | 否 | Number(32) | 第三方支付子类型,详见枚举 SubPayPlatform。 |
? | 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:其他。 |
? | machine_no | - | 是 | String(32) | 每个收银终端的唯一码。 |
? | sdk_version | - | 是 | String(10) | 云支付 SDK 版本号。 |
? | spbill_create_ip | - | 是 | String(16) | 调用云支付 API 的机器 IP。 |
? | sn_code | - | 否 | String(127) | 设备 sn 号。 |
nonce_str | - | - | 是 | String(32) | 随机字符串。 |
*只有微信支付时才使用。
输出参数
参数名 | 必填 | 类型 | 说明 |
response_content | 是 | ResponseContent | 请求内容,详见本节 ResponseContent。 |
authen_info | 否 | AuthenInfo | 认证信息,详见接口调用说明。 |
ResponseContent 结构
参数名 | 必填 | 类型 | 说明 |
status | 是 | Status | 错误码,详见枚举值 Status。此字段仅表示接口调用成功状态,订单状态请以 current_trade_state 字段为准。 |
description | 否 | String(255) | 错误描述。 |
log_id | 是 | Number(32) | 消息 ID。 |
internal_status | 是 | Number(32) | 调试使用,调用者可以不予理会。 |
micro_pay | 否 | MicroPayResponse | authen_info 存在时必填。详见 MicroPayResponse。 |
MicroPayResponse 结构
参数名 | 必填 | 类型 | 说明 |
order_content | 是 | OrderContent | 订单信息,详见公共数据结构 OrderContent。 |
pay_mch_key | 是 | PayMchKey | 支付商户信息,详见公共数据结构 PayMchKey。 |
nonce_str | 是 | String(32) | 随机字符串。 |
示例
输入参数示例:
{??????"authen_info":?{??????????"a":?{??????????????"authen_type":?1,??????????????"authen_code":?"0AFB7AA87F09A295EDC5229470B82CC21345F0BBF1E69187948B9A92B6DCA183"??????????}??????},??????"request_content":?"{?????????????"pay_mch_key":?{??????????????????"pay_platform":?1,??????????????????"sub_pay_platform":?100,??????????????????"out_shop_id":?"sz011biKxOguirmBqiFR",??????????????????"out_sub_mch_id":?"sz01KzuCUOmw8yjtPite",??????????????????"out_mch_id":?"sz01lXKA6DKGjNzr2l4B"??????????????},??????????????"nonce_str":?"E94C00688C3F429CA2B0B396BF823548",??????????????"order_client":?{??????????????????"staff_id":?"1206",??????????????????"machine_no":?"1111",??????????????????"terminal_type":?1,??????????????????"sdk_version":?"1.0",??????????????????"device_id":?"824",??????????????????"spbill_create_ip":?"90.0.00.0"??????????????},??????????????"pay_content":?{??????????????????"author_code":?"134520273825387649",??????????????????"body":?"body",??????????????????"fee_type":?"CNY",??????????????????"out_trade_no":?"sz010002cz11566803216",??????????????????"total_fee":?1??????????????}??????????}"??}??
输出参数示例:
{??????"response_content":?"{??????????????"status":?0,??????????????"description":?"\\u64CD\\u4F5C\\u6210\\u529F\\u3002",??????????????"log_id":?1310856473,??????????????"internal_status":?0,??????????????"micro_pay":?{??????????????????"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":?"",??????????????????????????"open_id":?"ovJrDwsjamQql-k7Zr1Q-EaKFQ0k"??????????????????????}??????????????????},??????????????????"order_content":?{??????????????????????"out_trade_no":?"sz010002cz11566803216",??????????????????????"transaction_id":?"4200000400201908267240992395",??????????????????????"trade_type":?1,??????????????????????"author_code":?"134520273825387649",??????????????????????"time_expire":?1566803336,??????????????????????"time_end":?1566803217,??????????????????????"nonce_str":?"E94C00688C3F429CA2B0B396BF823548",??????????????????????"create_time":?1566803216,??????????????????????"last_update_time":?1566803218,??????????????????????"is_transforming":?false,??????????????????????"total_fee":?1,??????????????????????"fee_type":?"CNY",??????????????????????"cash_fee":?1,??????????????????????"cash_fee_type":?"CNY",??????????????????????"settlement_total_fee":?1,??????????????????????"body":?"body",??????????????????????"detail":?"",??????????????????????"wxpay_order_content_ext":?{??????????????????????????"current_trade_state":?2,??????????????????????????"bank_type":?"CFT",??????????????????????????"goods_tag":?"X293123",?????????????????????????"coupon_fee":?0,??????????????????????????"coupon_count":?0??????????????????????}??????????????????},??????????????????"nonce_str":?"qB7ww6YIi0YqiIpR7YgRPUnpW5A0nguj"??????????????}??????????}",??????"authen_info":?{??????????"a":?{??????????????"authen_type":?1,??????????????"authen_code":?"252D91400A13C9D738A91C788D66987101E48BFF37AEB911AD7051A897C312EC"??????????}??????}??}??
?