瀏覽代碼

add zhongminquanyi channel to xyz

dong 1 年之前
父節點
當前提交
ba0eb0925f

+ 7 - 0
data/config/xyz/refill.ini.php

@@ -9918,6 +9918,12 @@ $duiba_fetch = ['name' => 'duiba_fetch', 'store_id' => 348, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$zhongminquanyi = ['name' => 'zhongminquanyi', 'store_id' => 356, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8845, 'price' => 100, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
@@ -9946,6 +9952,7 @@ $third_providers = [
     ['name' => 'feihan_fetch', 'cfg' => $feihan_fetch],
     ['name' => 'zihexin', 'cfg' => $zihexin],
     ['name' => 'duiba_fetch', 'cfg' => $duiba_fetch],
+    ['name' => 'zhongminquanyi', 'cfg' => $zhongminquanyi],
 ];
 $config['third_providers'] = $third_providers;
 

+ 1 - 1
docker/compose/dongpeng/acc/docker-compose.yml

@@ -14,7 +14,7 @@ services:
     container_name: "panda-nginx"
     command: [nginx,'-g','daemon off;']
     extra_hosts:
-      - "docker.hostip:172.19.0.3"
+      - "docker.hostip:172.19.0.2"
     deploy:
       resources:
         limits:

+ 1 - 1
docker/compose/dongpeng/admin/docker-compose.yml

@@ -33,7 +33,7 @@ services:
     container_name: "panda-web"
     command: [php-fpm]
     extra_hosts:
-      - "docker.hostip:172.26.0.3"
+      - "docker.hostip:172.26.0.2"
     deploy:
       resources:
         limits:

+ 39 - 0
helper/refill/api/xyz/zhongminquanyi/RefillCallBack.php

@@ -0,0 +1,39 @@
+<?php
+
+
+namespace refill\zhongminquanyi;
+
+require_once(BASE_HELPER_RAPI_PATH . '/zhongminquanyi/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $order_sn = $params['order_sn'];
+        $status = intval($params['status']);
+
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 1) {
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 0) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 61 - 0
helper/refill/api/xyz/zhongminquanyi/RefillPhone.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace refill\zhongminquanyi;
+
+require_once(BASE_HELPER_RAPI_PATH . '/zhongminquanyi/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
+    {
+        $params['tel'] = $phone;
+        $params['mch_order_id'] = $order_sn;
+        $params['mchid'] = config::MCHID;
+        $params['price'] = $amount;
+        $params['notify'] = config::NOTIFY_URL;
+        $params['teltype'] = config::operator[$card_type];
+        $params['timeout'] = 50;
+        $params['time'] = time();
+        $params['rand'] = rand(100000,999999);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        //大面值 直接返回成功
+//        refill\util::send_normal($params['order_sn']);
+        return [true , '',false];
+    }
+
+    public function query($refill_info)
+    {
+        $params['mch_order_id'] = $refill_info['order_sn'];
+        $params['mchid'] = config::MCHID;
+        $content = $params['mchid'] . $params['mch_order_id'] . config::KEY;
+        $params['sign'] = md5($content);
+        $resp = http_request(config::QUERY_URL, $params , 'POST' , false);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            $rand = mt_rand(0,1);
+            return [$rand , ''];
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content  = $params['mchid'] . $params['tel'] . $params['mch_order_id'] . $params['price'] . $params['teltype'] . $params['timeout'] . $params['notify'];
+        $content .= $params['time'] . $params['rand'] . $key;
+        return md5($content);
+    }
+}

+ 21 - 0
helper/refill/api/xyz/zhongminquanyi/config.php

@@ -0,0 +1,21 @@
+<?php
+
+
+namespace refill\zhongminquanyi;
+
+use mtopcard;
+# 中闽权益
+class config
+{
+    const ORDER_URL = 'https://www.baidu.com/';
+    const QUERY_URL = 'https://www.baidu.com/';
+
+    const MCHID = 10019;
+    const KEY = 'f92623101ca76c2162d16cf78c9eced6';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_zhongminquanyi.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 2,
+        mtopcard\ChinaUnicomCard  => 1,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+}

+ 5 - 0
mobile/callback/refill_zhongminquanyi.php

@@ -0,0 +1,5 @@
+<?php
+
+
+refill\util::push_notify('zhongminquanyi',$_POST);
+echo ('SUCCESS');