rabin 1 rok temu
rodzic
commit
374a699786
2 zmienionych plików z 43 dodań i 0 usunięć
  1. 24 0
      yspay/Cron.php
  2. 19 0
      yspay/Multi.php

+ 24 - 0
yspay/Cron.php

@@ -34,6 +34,30 @@ class Cron
         return 'ok';
     }
 
+    # 测试提现
+    public function test_tixian_api()
+    {
+        # 获取有银联商户号的门店
+        $where = array();
+        $mid = Dever::input('mid');
+        if ($mid) {
+            $where['mid'] = $mid;
+        }
+        $test = Dever::input('test');
+        $merchant = Dever::db('pay/yspay_merchant')->select($where);
+        if (!$merchant) {
+            return 'error';
+        }
+        foreach ($merchant as $k => $v) {
+            if ($v['mid']) {
+            	$config = Dever::db('pay/yspay')->one(array('account_id' => $v['account_id']));
+            	$data = Dever::load('pay/yspay/multi')->tixian($config, $v, $v['yue']);
+            	print_r($data);die;
+            }
+        }
+        return 'ok';
+    }
+
     # 定时获取银联提现信息
     public function tixian_api()
     {

+ 19 - 0
yspay/Multi.php

@@ -110,6 +110,25 @@ class Multi
         return 0;
     }
 
+    # 提现
+    public function tixian($config, $merchant, $cash)
+    {
+        $this->config = $config;
+
+        $mid = $merchant['mid'];
+
+        //整理内容信息
+        $content = [
+            'merNo' => $merchant['merno'],
+            'payAmt' => $cash,
+            'ps' => $merchant['name'] . '划付',
+        ];
+        Dever::log($content, 'yspay_huafu_tixian');
+        $result = $this->curl('202002', $content);
+
+        return 'ok';
+    }
+
     protected function getOrderNum($order_num)
     {
         $where['order_num'] = $order_num . '_' . Dever::rand(8, 0);