PHP功能實現之微信提現 企業付款

2021-10-23 19:44:35 字數 2342 閱讀 8708

官方文件:企業付款

<?php

namespace

;use

;use

as mpaytakeoutlog;

/** *

* @version 1.0.0

* @author yunuo * @link

*/class

wechattakeoutunit

/** * 發起提現

** @param string $clientip 客戶端ip

* @param integer $money 提現金額(單位:分)

* @param string $desc 提現備註資訊

** @return bool

*/public

function

transfers

($clientip

,$money

,$desc

=null

)else

}else

}else

return

$_allow;}

/** * 設定openid

** @param string $openid 使用者openid

** @return void

*/public

function

setopenid

($openid

): void

/** * 生成隨機字串

** @return string 隨機字串,不長於32位

*/private

function

_noncestr()

: string

/** * 生成校驗sign

** @param array $param 待校驗資料

** @return string 簽名

*/private

function

_createsign

($param

): string

}$string

=$string

."key="

.$this

->

_apikey

;$string

=md5

($string);

$result

=strtoupper

($string);

return

$result;}

/** *

* @param array $param 待傳送資料

** @return string|bool

*/private

function

_curlpostssl

($param

)curl_setopt

($ch

,curlopt_post

,true);

curl_setopt

($ch

,curlopt_postfields

,$_senddata);

$data

=curl_exec

($ch);

if($data

)return

$this

->

_fromxml

($data);

}else

}/**

* 輸出xml字元

** @param array $param 待轉化陣列

** @return string xml

**/private

function

_toxml

($param

): string

else

}$xml.=

"";return

$xml;}

/** * 將xml轉為array

** @param string $xml 待轉化xml資料

** @return array

*/private

function

_fromxml

($xml):

array

/** * 判斷訂單是否存在

** @param string $trade_no 待處理訂單號

** @return bool

*/private

function

_isorderexist

($trade_no

): bool

return

true;}

else

}}

微信 企業付款個人 微信提現

企業付款文件 這裡可以看到必填項肯定是要填寫的塞,其他按照自己的需求而定,我示例的是不要求使用者為真實姓名自己 如上圖根據實際需求填寫 我這裡是不校驗使用者真實姓名為例 openid值某使用者的openid amoun指要體現的金額 把返回的字串解釋成dom節點 document dom docum...

PHP實現微信提現(企業付款到零錢)

怎麼開通企業付款到零錢?有的商戶號的產品中心是沒有這個功能的,不過,該功能的pid product id 是5,只要隨便進去某乙個產品,在位址列把pid改為5。即可進入該功能頁面,進行開通,不過要滿足條件。private function withdrawals weixin id else inc...

微信提現企業付款到零錢

class index public function tixian openid,money mch id mch id 商戶號 key key api金鑰 openid openid 授權使用者openid arr array arr mchid mch id arr nonce str md5...