Ver código fonte

xuyou_hf channel

dong 1 ano atrás
pai
commit
a7987226bb
1 arquivos alterados com 9 adições e 9 exclusões
  1. 9 9
      helper/refill/api/xyz/xuyou_hf/RefillPhone.php

+ 9 - 9
helper/refill/api/xyz/xuyou_hf/RefillPhone.php

@@ -14,7 +14,7 @@ class RefillPhone extends refill\IRefillPhone
         parent::__construct($cfgs);
     }
 
-    private function req_params(int $phone, string $order_sn, string $productid)
+    private function req_params(int $phone, string $order_sn, string $productid) : array
     {
         $params['mchid'] = config::MCH_ID;
         $params['orderid'] = $order_sn;
@@ -24,10 +24,10 @@ class RefillPhone extends refill\IRefillPhone
         return $params;
     }
 
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0) : array
     {
         $params = $this->req_params($card_no, $params['orderid'], $params['productid']);
-        $sign = $this->sign($params, "add");
+        $sign = $this->sign($params);
         $params['backurl'] = config::NOTIFY_URL;
         $params['sign'] = $sign;
         $params = json_encode($params);
@@ -52,7 +52,7 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    public function query($refill_info)
+    public function query($refill_info) : array
     {
         $params['mchid'] = config::MCH_ID;
         $params['orderid'] = $refill_info['orderid'];
@@ -96,10 +96,10 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    public function balance()
+    public function balance() : array
     {
         $params['mchid'] = (string)config::MCH_ID;
-        $params['sign'] = $this->sign($params, "balance");
+        $params['sign'] = $this->sign($params);
         $params = json_encode($params);
         $resp = http_post_data(config::BALANCE_URL, $params , config::ExtHeaders);
 
@@ -122,7 +122,7 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    protected function check_empty($value)
+    protected function check_empty($value) : bool
     {
         if (!isset($value))
             return true;
@@ -134,7 +134,7 @@ class RefillPhone extends refill\IRefillPhone
         return false;
     }
 
-    private function sign($params)
+    private function sign($params) : string
     {
         $body = "";
         $i = 0;
@@ -155,7 +155,7 @@ class RefillPhone extends refill\IRefillPhone
     /**
      * 获取毫秒级别的时间戳
      */
-    private function getMillisecond()
+    private function getMillisecond() : int
     {
         $cur = microtime (true);
         return intval($cur * 1000);