微信支付参数需要加上<profit_sharing>Y</profit_sharing>
我正在做微信分账,感觉配置什么都对了,可是调用分账接口时,就是没有反应,为什么?请求单次分账接口:https://api.mch.weixin.qq.com/secapi/pay/profitsharing POST提交设置: $ch = curl_init (); //超时时间 curl_setopt ( $ch, CURLOPT_TIMEOUT, $second ); curl_setopt ( $ch, CURLOPT_URL, $url ); curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE ); curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, FALSE ); //设置header curl_setopt ( $ch, CURLOPT_HEADER, FALSE ); //要求结果为字符串且输出到屏幕上 curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, TRUE ); //设置证书 //使用证书:cert 与 key 分别属于两个.pem文件 //默认格式为PEM,可以注释 curl_setopt ( $ch, CURLOPT_SSLCERTTYPE, 'PEM' ); curl_setopt ( $ch, CURLOPT_SSLCERT, dirname(__FILE__).'/cacert/apiclient_cert.pem' ); //默认格式为PEM,可以注释 curl_setopt ( $ch, CURLOPT_SSLKEYTYPE, 'PEM' ); curl_setopt ( $ch, CURLOPT_SSLKEY, dirname(__FILE__).'/cacert/apiclient_key.pem' ); //证书密码 curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '1414338702'); //post提交方式 curl_setopt ( $ch, CURLOPT_POST, true ); curl_setopt ( $ch, CURLOPT_POSTFIELDS, $xml ); curl_setopt($ch, CURLOPT_VERBOSE, '1'); xml: <xml><appid>wx**************</appid><mch_id>************</mch_id><nonce_str>21b9b96890670a9c5a08bd8a94050253</nonce_str><transaction_id>4200000546**************</transaction_id><out_order_no>**************529000001691590717324</out_order_no><receivers>[{"type":"PERSONAL_OPENID","account":"oSE36wNPQy0Gtnmvk**************","amount":1,"description":"salary"},{"type":"PERSONAL_OPENID","account":"oSE36wDHPK3wx-lL3RPCIMclKA-U","amount":1,"description":"salary"},{"type":"PERSONAL_OPENID","account":"oSE36wF2hvEp7D6JTQ3DhVoChcaM","amount":1,"description":"salary"}]</receivers><sign>D3BD02FFC1BF80C21DC0DEC81608481FBFB6BBCF1E24DED095CDBD5A6B76D1B5</sign></xml> 问题已解决。 1、想看结果,需要打印: $ary = $sub_ledger->profitSharing($profitSharingOrders, $profitSharingAccounts); print_r($ary); 2、想看具体内容,按F12,然后右边会有返回结果
2020-05-29