From 83f30ceed8e54d83803175e281fa1127405209c3 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 11 May 2018 17:23:49 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=AD=A3=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E4=BC=81=E4=B8=9A=E6=89=93=E6=AC=BE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Test/config.php | 4 ++-- Test/pay-transfers-create.php | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 09de8bb..1d2b80a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /.DS_Store /vendor /Cache +/Test/cert diff --git a/Test/config.php b/Test/config.php index 3c3eb82..48fdd4a 100644 --- a/Test/config.php +++ b/Test/config.php @@ -21,8 +21,8 @@ return [ 'mch_id' => "1332187001", 'mch_key' => 'A82DC5BD1F3359081049C568D8502BC5', // 配置商户支付双向证书目录 - 'ssl_key' => '', - 'ssl_cer' => '', + 'ssl_key' => __DIR__ . DIRECTORY_SEPARATOR . 'cert' . DIRECTORY_SEPARATOR . 'apiclient_key.pem', + 'ssl_cer' => __DIR__ . DIRECTORY_SEPARATOR . 'cert' . DIRECTORY_SEPARATOR . 'apiclient_cert.pem', // 配置缓存目录,需要拥有写权限 'cache_path' => '', ]; \ No newline at end of file diff --git a/Test/pay-transfers-create.php b/Test/pay-transfers-create.php index 3fedb36..7e4735c 100644 --- a/Test/pay-transfers-create.php +++ b/Test/pay-transfers-create.php @@ -25,15 +25,15 @@ try { // 4. 组装参数,可以参考官方商户文档 $options = [ - 'partner_trade_no' => '1008450740201411110005820873', - 'openid' => '用户的openid', + 'partner_trade_no' => time(), + 'openid' => 'o38gps3vNdCqaggFfrBRCRikwlWY', 'check_name' => 'NO_CHECK', 'amount' => '100', 'desc' => '企业付款操作说明信息', 'spbill_create_ip' => '127.0.0.1', ]; $result = $wechat->createTransfers($options); - + echo '
';
     var_export($result);
 
 } catch (Exception $e) {