stanley-king %!s(int64=4) %!d(string=hai) anos
pai
achega
867f9e1af9

+ 0 - 2
helper/refill/RefillFactory.php

@@ -6,8 +6,6 @@ namespace refill;
 
 require_once(BASE_HELPER_PATH . '/refill/RefillBase.php');
 
-require_once(BASE_HELPER_PATH . '/refill/afandeng/RefillPhone.php');
-require_once(BASE_HELPER_PATH . '/refill/afandeng/RefillCallBack.php');
 
 use Log;
 use StatesHelper;

+ 3 - 1
helper/refill/api/xyz/api.php

@@ -43,4 +43,6 @@ require_once(BASE_HELPER_RAPI_PATH . '/bjbyd/RefillCallBack.php');
 require_once(BASE_HELPER_RAPI_PATH . '/tianx/RefillPhone.php');
 require_once(BASE_HELPER_RAPI_PATH . '/tianx/RefillCallBack.php');
 require_once(BASE_HELPER_RAPI_PATH . '/afand/RefillPhone.php');
-require_once(BASE_HELPER_RAPI_PATH . '/afand/RefillCallBack.php');
+require_once(BASE_HELPER_RAPI_PATH . '/afand/RefillCallBack.php');
+require_once(BASE_HELPER_RAPI_PATH . '/afandeng/RefillPhone.php');
+require_once(BASE_HELPER_RAPI_PATH . '/afandeng/RefillCallBack.php');

+ 18 - 15
rdispatcher/processor.php

@@ -19,17 +19,15 @@ class processor extends queue\ILooper
             foreach ($msg as $key => $params)
             {
                 Log::record("start one", Log::DEBUG);
-                $method = strtolower($key);
+                if(empty($params)) continue;
 
-                $proxy = new proxy();
-                if($method == 'add')
-                {
-                    try {
+                try {
+                    $method = strtolower($key);
+                    $proxy = new proxy();
+                    if($method == 'add')
+                    {
                         $proxy->add($params);
-                    }
-                    catch (Exception $x) {
-                        Log::record($x->getMessage(),Log::ERR);
-                    }
+
 
 //                    go(function () use ($proxy,$params)
 //                    {
@@ -40,16 +38,21 @@ class processor extends queue\ILooper
 //                            Log::record($x->getMessage(),Log::ERR);
 //                        }
 //                    });
-                }
-                elseif($method == 'notify') {
+                    }
+                    elseif($method == 'notify') {
 
-                }
-                elseif($method == 'notify_mechant') {
+                    }
+                    elseif($method == 'notify_mechant') {
 
+                    }
+                    else {
+                        Log::record("Error msg",Log::DEBUG);
+                    }
                 }
-                else {
-                    Log::record("Error msg",Log::DEBUG);
+                catch (Exception $x) {
+                    Log::record($x->getMessage(),Log::ERR);
                 }
+
             }
         }
     }

+ 0 - 1
rdispatcher/proxy.php

@@ -8,7 +8,6 @@ class proxy
     public function add($params)
     {
         Log::record(__FUNCTION__,Log::DEBUG);
-
         $mchid = $params['mchid'];
         $buyer_id = $params['buyer_id'];
         $amount = $params['amount'];

+ 1 - 1
test/TestDispatcher.php

@@ -56,7 +56,7 @@ class TestDispatcher extends TestCase
     public function testAddoil()
     {
         foreach (range(1,2000,1) as $i) {
-            $ret = refill\RefillFactory::instance()->push_add($this->make_order());
+            queue\DispatcherClient::instance()->push('add',$this->make_order());
         }
     }