瀏覽代碼

add yufuquanyi channel to xyz

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

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

@@ -9970,6 +9970,12 @@ $zhongminquanyi = ['name' => 'zhongminquanyi', 'store_id' => 356, 'qualitys' =>
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$yufuquanyi = ['name' => 'yufuquanyi', 'store_id' => 360, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8862, 'price' => 100, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
@@ -9999,6 +10005,7 @@ $third_providers = [
     ['name' => 'zihexin', 'cfg' => $zihexin],
     ['name' => 'duiba_fetch', 'cfg' => $duiba_fetch],
     ['name' => 'zhongminquanyi', 'cfg' => $zhongminquanyi],
+    ['name' => 'yufuquanyi', 'cfg' => $yufuquanyi],
 ];
 $config['third_providers'] = $third_providers;
 

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

@@ -0,0 +1,39 @@
+<?php
+
+
+namespace refill\yufuquanyi;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yufuquanyi/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];
+        }
+    }
+}

+ 36 - 0
helper/refill/api/xyz/yufuquanyi/RefillPhone.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace refill\yufuquanyi;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yufuquanyi/config.php');
+
+use refill;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        return [true , '',false];
+    }
+
+    public function query($refill_info)
+    {
+        $mod_order = Model('vr_order');
+
+        $order_sn = $refill_info['order_sn'];
+        $order_info = $mod_order->getOrderInfo(['order_sn' => $order_sn]);
+
+        if (empty($order_info)) {
+            $order_state = ORDER_STATE_NOEXIST;
+        } else {
+            $order_state = intval($order_info['order_state']);
+        }
+
+        return [true, $order_state];
+    }
+}

+ 11 - 0
helper/refill/api/xyz/yufuquanyi/config.php

@@ -0,0 +1,11 @@
+<?php
+
+
+namespace refill\yufuquanyi;
+
+use mtopcard;
+# 裕福权益
+class config
+{
+
+}