php 實現微信退款

2021-08-02 19:57:00 字數 1000 閱讀 6940

① 要是在測試的時候,網頁提示 curl 58 說明 證書的路徑出現問題(這裡要填物理路徑,也就是絕對路徑)

②網頁提示curl 52 說明你的證書引入少了,在官方的demo上只有兩個證書 apiclient_cert.pem和 apiclient_key.pem  你還需要引入乙個證書 rootca.pem,這個證書需要你登入到

3.要是網頁提示  "http/1.1 200 ok server: nginx date: tue, 20 jun 2017 08:08:01 gmt content-type: text/plain content-length: 852 connection: keep-alive keep-alive: timeout=8

注意:金額的單位是分 

下面就是我寫的介面

function home_index() 

curl_setopt($ch, curlopt_post, 1);

curl_setopt($ch, curlopt_postfields, $xml);

$xml = curl_exec($ch);

// 返回結果0的時候能只能表明程式是正常返回不一定說明退款成功而已

if ($xml) else

}function arraytoxml($arr) else

}$xml .= "";

return $xml;

}

function object_to_array($obj) 

if (gettype($v) == 'object' || gettype($v) == 'array')

}return $obj;

}function noncestr()

// 隨機字串

return $str;

}home_index();

趕快新增到你的專案中去吧

PHP實現微信申請退款

申請退款,wxpayrefund中out trade no transaction id至少填乙個且 out refund no total fee refund fee op user id為必填引數 param wxpayrefund inputobj param int timeout thr...

PHP實現微信退款功能

要是在測試的時候,網頁提示 curl 58 說明 證書的路徑出現問題 這裡程式設計客棧要填物理路徑,也就是絕對路徑 網頁提示curl 52 說明你的證書引入少了,在官方的demo上只有兩個證書 apiclient cert.pem和 apiclient key.pem 你還需要引入乙個證書 root...

php 微信退款,非同步通知實現

需要注意的事項 4 伺服器也要授權這個證書路徑的許可權,不然沒有許可權會導致失敗 wxrefund.php class wxrefund public function refundstart private function wxrefundapi 需要使用證書的請求 function postx...