想让分账接收方就为本商户,用户再确认后才进行完结分账,不过一直出现参数格式校验错误的问题
// 云函数入口函数
exports.main = async (event, context) => {
const result = await cloud.cloudPay.multiProfitSharing({
"sub_mch_id": event.sub_mch_id,
"nonce_str": event.nonce_str,
"transaction_id": event.transaction_id,
"out_order_no": 'sharing' + new Date().getTime(),
"receivers": [{
"type": "MERCHANT_ID",
"account": event.sub_mch_id,
"amount": 1,
"description": "订单收益"
}]
})
return result
}
不要看示例json,对照着请求参数表每个参数不能少,参数类型也必须对
打印一下你的请求参数出来看下