快速上手
业务方调用下单接口成功后,则可以通过查单接口获取到订单详情。
此时订单还未支付,需要根据下单给定的支付方式去实现具体的支付功能。
以下接口的调用演示均为体验使用,没有加上接口的鉴权等限制。
下单接口
curl --location --request POST 'https://p.wecard.tencent.com/cloudpay/v1/pay/unified_order' \
--header 'content-type: application/json' \
--data-raw '{
"AppId":"TIYAN",
"ChannelSubMerchantId": "CM686558297171910656",
"TotalAmount": 100,
"PayType": "MINI_PROGRAM",
"OrderSubject": "订单标题",
"OutOrderId": "test202211250236122efd1",
"Attachment": "原路返回信息",
"ExternalPaymentData": "{\"authCode\":\"287605996243878538\"}",
"PayerInfo": {"PayerId":"ovJrDwql8UCpOsiFCB7mhqBM5rEk"},
"PayChannel": "wxpay",
"Remark": "订单备注"
}'
查单接口
curl --location --request POST 'https://p.wecard.tencent.com/cloudpay/v1/pay/query_order' \
--header 'content-type: application/json' \
--data-raw '{
"AppId":"TIYAN",
"OutOrderId": "test202211250236122efd1"
}'