xiaoyu 3 years ago
parent
commit
828a8c3d9f

+ 8 - 1
data/config/win/refill.ini.php

@@ -3171,10 +3171,17 @@ $santi = ['name' => 'santi', 'store_id' => 129,'qualitys' => '1',
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
+$yanhao = ['name' => 'yanhao', 'store_id' => 151,'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 7291, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
-    ['name' => 'santi', 'cfg' => $santi]
+    ['name' => 'santi', 'cfg' => $santi],
+    ['name' => 'yanhao', 'cfg' => $yanhao]
 ];
 ];
 $config['third_providers'] = $third_providers;
 $config['third_providers'] = $third_providers;
 
 

+ 8 - 1
data/config/xyz/refill.ini.php

@@ -3171,10 +3171,17 @@ $santi = ['name' => 'santi', 'store_id' => 129,'qualitys' => '1',
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
+$yanhao = ['name' => 'yanhao', 'store_id' => 151,'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 7291, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
-    ['name' => 'santi', 'cfg' => $santi]
+    ['name' => 'santi', 'cfg' => $santi],
+    ['name' => 'yanhao', 'cfg' => $yanhao]
 ];
 ];
 $config['third_providers'] = $third_providers;
 $config['third_providers'] = $third_providers;
 
 

+ 8 - 1
data/config/xyzadm/refill.ini.php

@@ -3171,10 +3171,17 @@ $santi = ['name' => 'santi', 'store_id' => 129,'qualitys' => '1',
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
+$yanhao = ['name' => 'yanhao', 'store_id' => 151,'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 7291, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
-    ['name' => 'santi', 'cfg' => $santi]
+    ['name' => 'santi', 'cfg' => $santi],
+    ['name' => 'yanhao', 'cfg' => $yanhao]
 ];
 ];
 $config['third_providers'] = $third_providers;
 $config['third_providers'] = $third_providers;
 
 

+ 0 - 1
helper/refill/api/xyz/yanhao/RefillCallBack.php

@@ -3,7 +3,6 @@
 namespace refill\yanhao;
 namespace refill\yanhao;
 require_once(BASE_HELPER_RAPI_PATH . '/yanhao/config.php');
 require_once(BASE_HELPER_RAPI_PATH . '/yanhao/config.php');
 
 
-
 use refill;
 use refill;
 class RefillCallBack implements refill\IRefillCallBack
 class RefillCallBack implements refill\IRefillCallBack
 {
 {

+ 1 - 2
helper/refill/api/xyz/yanhao/config.php

@@ -11,7 +11,6 @@ class config
     const USER_ID = '211394995';
     const USER_ID = '211394995';
     const Key = 'f3saY9T7t0qB0SDBrLTHPw==';
     const Key = 'f3saY9T7t0qB0SDBrLTHPw==';
     const API_IP = NET_IP;
     const API_IP = NET_IP;
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yanhao.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yanhao.php";
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
 }
 }

+ 6 - 0
mobile/callback/refill_yanhao.php

@@ -0,0 +1,6 @@
+<?php
+
+refill\util::push_notify('yanhao',$_POST);
+$response = ["Code" => 0];
+$body = json_encode($response);
+echo($body);

+ 14 - 0
test/TestRefill.php

@@ -1347,6 +1347,20 @@ class TestRefill extends TestCase
         $resp = $provider->notify($params);
         $resp = $provider->notify($params);
     }
     }
 
 
+    public function testYanhao()
+    {
+//        $provider = $this->getProvider('yanhao');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(2423503330, 5, 30, ['order_sn' => $this->make_sn()]);
+//        $resp = $provider->query(['order_sn' => '49571636609949577130']);
+
+        $body = '{"Account":"2423503330","ProductNumber":"PLM100020","Count":"1","UserOrderId":"49571636609949577130","OutOrderID":"211111135254371000","Status":"2","UserId":"211394995","TimesTamp":"1636610036767","Sign":"096017A3D80B998DC2AFA16779E09F9F","Extend":"{\"OfficialDes\":null,\"OfficialOrderID\":null}","ChargeMsg":""}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('yanhao','RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+    }
+
     public function testAmingjd()
     public function testAmingjd()
     {
     {
 //        $provider = new refill\amingjd\RefillPhone([]);
 //        $provider = new refill\amingjd\RefillPhone([]);