php实现微信企业转账功能(2)

<?php include 'WxTransfers.Api.php'; class WxTransfers{ /** *调用方法即可测试 */ public function index(){ $path = WxTransfersConfig::getRealPath(); // 证书文件路径 $config['wxappid'] = WxTransfersConfig::APPID; $config['mch_id'] = WxTransfersConfig::MCHID; $config['key'] = WxTransfersConfig::KEY; $config['PARTNERKEY'] = WxTransfersConfig::KEY; $config['api_cert'] = $path . WxTransfersConfig::SSLCERT_PATH; $config['api_key'] = $path . WxTransfersConfig::SSLKEY_PATH; $config['rootca'] = $path . WxTransfersConfig::SSLROOTCA; $wxtran=new WxTransfers($config); $wxtran->setLogFile('D:\\transfers.log');//日志地址 //转账 $data=array( 'openid'=>'',//openid 'check_name'=>'NO_CHECK',//是否验证真实姓名参数 're_user_name'=>'11',//姓名 'amount'=>100,//最小1元 也就是100 'desc'=>'企业转账测试',//描述 'spbill_create_ip'=>$wxtran->getServerIp(),//服务器IP地址 ); var_dump(json_encode($wxtran->transfers($data),JSON_UNESCAPED_UNICODE)); var_dump($wxtran->error); //获取转账信息 var_dump($wxtran->getInfo('11111111')); var_dump($wxtran->error); } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/815a05e148252289de3eb36f2b3ed549.html