Browse Source

yl xunyin_kami

xiaoyu 2 years ago
parent
commit
7e1158c3aa

+ 8 - 0
data/config/yl/refill.ini.php

@@ -224,6 +224,12 @@ $menggu_oil = ['name' => 'menggu', 'store_id' => 130, 'qualitys' => '2',
     ],
     'period' => [], 'refill_type' => 'api'];
 
+$xunyin_kami_oil = ['name' => 'xunyin_kami', 'store_id' => 228, 'qualitys' => '3',
+    'amount' => [
+        100 => [['goods_id' => 6579, 'price' => 104, 'quality' => 3, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'api'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -244,6 +250,8 @@ $oil_providers = [
 //    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil],
 //    ['name' => 'xunyinoil', 'cfg' => $xunyinoil_oil],
 //    ['name' => 'menggu', 'cfg' => $menggu_oil]
+    ['name' => 'xunyin_kami', 'cfg' => $xunyin_kami_oil],
+
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 35 - 0
helper/refill/api/yl/xunyin_kami/RefillCallBack.php

@@ -0,0 +1,35 @@
+<?php
+namespace refill\xunyin_kami;
+
+require_once(BASE_HELPER_RAPI_PATH . '/xunyin_kami/config.php');
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return false;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['code']);
+        $order_sn = $params['id'];
+        $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'];
+        $data['official_sn'] = strtolower($params['operatorid']) == 'null' ? '' : $params['operatorid'];
+
+        if ($status === 8888) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 8030) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 32 - 0
helper/refill/api/yl/xunyin_kami/RefillOil.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace refill\xunyin_kami;
+
+require_once(BASE_HELPER_RAPI_PATH . '/xunyin_kami/config.php');
+
+use refill;
+use Log;
+
+class RefillOil extends refill\IRefillOil
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        return [false, '不支持提单', false];
+    }
+
+    public function query($refill_info)
+    {
+        return [false, '暂无查询接口'];
+    }
+
+    public function balance()
+    {
+        return [false, '暂无余额接口'];
+
+    }
+}

+ 9 - 0
helper/refill/api/yl/xunyin_kami/config.php

@@ -0,0 +1,9 @@
+<?php
+
+
+namespace refill\xunyin_kami;
+
+class config
+{
+
+}

BIN
helper/refill/api/yl/xunyin_kami/迅银开放平台采购接口-采购商.docx