Browse Source

fix: 回调服务处理

super-yimizi 2 months ago
parent
commit
94fd9e9350

+ 1 - 1
addons/epay/.addonrc

@@ -1 +1 @@
-{"files":["application\/admin\/controller\/Epay.php","public\/assets\/addons\/epay\/css\/common.css","public\/assets\/addons\/epay\/less\/common.less","public\/assets\/addons\/epay\/images\/paid.png","public\/assets\/addons\/epay\/images\/logo-wechat.png","public\/assets\/addons\/epay\/images\/logo-alipay.png","public\/assets\/addons\/epay\/images\/screenshot-alipay.png","public\/assets\/addons\/epay\/images\/alipay.png","public\/assets\/addons\/epay\/images\/screenshot-wechat.png","public\/assets\/addons\/epay\/images\/wechat.png","public\/assets\/addons\/epay\/images\/scan.png","public\/assets\/addons\/epay\/images\/expired.png","public\/assets\/addons\/epay\/js\/jquery.qrcode.min.js","public\/assets\/addons\/epay\/js\/common.js"],"license":"regular","licenseto":"9671","licensekey":"w2ROCdQ79K8Hjhls WW4vyNH\/8Ynuq5XM75e6Jw==","domains":[],"licensecodes":[],"validations":[]}
+{"files":["application\/admin\/controller\/Epay.php","public\/assets\/addons\/epay\/css\/common.css","public\/assets\/addons\/epay\/less\/common.less","public\/assets\/addons\/epay\/images\/paid.png","public\/assets\/addons\/epay\/images\/logo-wechat.png","public\/assets\/addons\/epay\/images\/logo-alipay.png","public\/assets\/addons\/epay\/images\/screenshot-alipay.png","public\/assets\/addons\/epay\/images\/alipay.png","public\/assets\/addons\/epay\/images\/screenshot-wechat.png","public\/assets\/addons\/epay\/images\/wechat.png","public\/assets\/addons\/epay\/images\/scan.png","public\/assets\/addons\/epay\/images\/expired.png","public\/assets\/addons\/epay\/js\/jquery.qrcode.min.js","public\/assets\/addons\/epay\/js\/common.js"],"license":"regular","licenseto":"9671","licensekey":"Lt1DIF8fpSydPYwo 4gnW3tZGeMfSH8\/5SUQPfw==","domains":[],"licensecodes":[],"validations":[]}

+ 1 - 1
addons/epay/info.ini

@@ -3,7 +3,7 @@ title = 微信支付宝整合
 intro = 可用于快速整合微信支付、支付宝支付功能
 intro = 可用于快速整合微信支付、支付宝支付功能
 author = FastAdmin
 author = FastAdmin
 website = https://www.fastadmin.net
 website = https://www.fastadmin.net
-version = 1.3.13
+version = 1.3.14
 state = 1
 state = 1
 url = /addons/epay
 url = /addons/epay
 license = regular
 license = regular

+ 1 - 1
addons/epay/library/RedirectResponse.php

@@ -45,7 +45,7 @@ class RedirectResponse extends BaseRedirectResponse implements JsonSerializable
     }
     }
 
 
     #[\ReturnTypeWillChange]
     #[\ReturnTypeWillChange]
-    public function jsonSerialize(): mixed
+    public function jsonSerialize()
     {
     {
         return $this->getContent();
         return $this->getContent();
     }
     }

+ 23 - 3
addons/epay/library/Response.php

@@ -9,7 +9,7 @@ class Response extends \Symfony\Component\HttpFoundation\Response implements \Js
         return $this->getContent();
         return $this->getContent();
     }
     }
 
 
-    public function jsonSerialize()
+    public function jsonSerialize(): mixed
     {
     {
         return $this->getContent();
         return $this->getContent();
     }
     }
@@ -19,8 +19,28 @@ class Response extends \Symfony\Component\HttpFoundation\Response implements \Js
         return serialize($this->content);
         return serialize($this->content);
     }
     }
 
 
-    public function unserialize($serialized)
+    public function unserialize($data)
     {
     {
-        return $this->content = unserialize($serialized);
+        return $this->content = unserialize($data);
+    }
+
+    /**
+     * (PHP 8.1+) Magic method for serialization.
+     *
+     * @return mixed
+     */
+    public function __serialize()
+    {
+        return $this->content;
+    }
+
+    /**
+     * (PHP 8.1+) Magic method for unserialization.
+     *
+     * @param array $data
+     */
+    public function __unserialize(array $data): void
+    {
+        $this->content = $data;
     }
     }
 }
 }

+ 1 - 1
addons/epay/library/v2/Yansongda/Pay/Gateways/Wechat/Support.php

@@ -315,7 +315,7 @@ class Support
             throw new InvalidArgumentException('Convert To Array Error! Invalid Xml!');
             throw new InvalidArgumentException('Convert To Array Error! Invalid Xml!');
         }
         }
 
 
-        if (PHP_VERSION_ID < 80000) {
+        if (\PHP_VERSION_ID < 80000) {
             libxml_disable_entity_loader(true);
             libxml_disable_entity_loader(true);
         }
         }
 
 

+ 1 - 1
addons/epay/library/v2/Yansongda/Supports/Arr.php

@@ -349,7 +349,7 @@ class Arr
      *
      *
      * @param string $key
      * @param string $key
      */
      */
-    public static function pluck(array $array, string $value, string $key = null): array
+    public static function pluck(array $array, string $value, ?string $key = null): array
     {
     {
         $results = [];
         $results = [];
 
 

+ 32 - 9
addons/epay/library/v2/Yansongda/Supports/Collection.php

@@ -183,8 +183,8 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
     /**
     /**
      * Retrieve item from Collection.
      * Retrieve item from Collection.
      *
      *
-     * @param string $key
-     * @param mixed  $default
+     * @param string|null $key
+     * @param mixed       $default
      *
      *
      * @return mixed
      * @return mixed
      */
      */
@@ -226,6 +226,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      * @return mixed data which can be serialized by <b>json_encode</b>,
      * @return mixed data which can be serialized by <b>json_encode</b>,
      *               which is a value of any type other than a resource
      *               which is a value of any type other than a resource
      */
      */
+    #[\ReturnTypeWillChange]
     public function jsonSerialize()
     public function jsonSerialize()
     {
     {
         return $this->items;
         return $this->items;
@@ -253,7 +254,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      * @return ArrayIterator An instance of an object implementing <b>Iterator</b> or
      * @return ArrayIterator An instance of an object implementing <b>Iterator</b> or
      *                       <b>ArrayIterator</b>
      *                       <b>ArrayIterator</b>
      */
      */
-    public function getIterator()
+    public function getIterator(): \Traversable
     {
     {
         return new ArrayIterator($this->items);
         return new ArrayIterator($this->items);
     }
     }
@@ -269,7 +270,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      *             <p>
      *             <p>
      *             The return value is cast to an integer
      *             The return value is cast to an integer
      */
      */
-    public function count()
+    public function count(): int
     {
     {
         return count($this->items);
         return count($this->items);
     }
     }
@@ -280,15 +281,15 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      *
      *
      * @see  http://php.net/manual/en/serializable.unserialize.php
      * @see  http://php.net/manual/en/serializable.unserialize.php
      *
      *
-     * @param string $serialized <p>
+     * @param string $data <p>
      *                           The string representation of the object.
      *                           The string representation of the object.
      *                           </p>
      *                           </p>
      *
      *
      * @return mixed|void
      * @return mixed|void
      */
      */
-    public function unserialize($serialized)
+    public function unserialize($data)
     {
     {
-        return $this->items = unserialize($serialized);
+        return $this->items = unserialize($data);
     }
     }
 
 
     /**
     /**
@@ -304,7 +305,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      * @return bool true on success or false on failure.
      * @return bool true on success or false on failure.
      *              The return value will be casted to boolean if non-boolean was returned
      *              The return value will be casted to boolean if non-boolean was returned
      */
      */
-    public function offsetExists($offset)
+    public function offsetExists($offset): bool
     {
     {
         return $this->has($offset);
         return $this->has($offset);
     }
     }
@@ -319,7 +320,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      *                      The offset to unset.
      *                      The offset to unset.
      *                      </p>
      *                      </p>
      */
      */
-    public function offsetUnset($offset)
+    public function offsetUnset($offset): void
     {
     {
         if ($this->offsetExists($offset)) {
         if ($this->offsetExists($offset)) {
             $this->forget($offset);
             $this->forget($offset);
@@ -338,6 +339,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      *
      *
      * @return mixed Can return all value types
      * @return mixed Can return all value types
      */
      */
+    #[\ReturnTypeWillChange]
     public function offsetGet($offset)
     public function offsetGet($offset)
     {
     {
         return $this->offsetExists($offset) ? $this->get($offset) : null;
         return $this->offsetExists($offset) ? $this->get($offset) : null;
@@ -356,8 +358,29 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
      *                      The value to set.
      *                      The value to set.
      *                      </p>
      *                      </p>
      */
      */
+    #[\ReturnTypeWillChange]
     public function offsetSet($offset, $value)
     public function offsetSet($offset, $value)
     {
     {
         $this->set($offset, $value);
         $this->set($offset, $value);
     }
     }
+
+    /**
+     * (PHP 8.1+) Magic method for serialization.
+     *
+     * @return array
+     */
+    public function __serialize(): array
+    {
+        return $this->items;
+    }
+
+    /**
+     * (PHP 8.1+) Magic method for unserialization.
+     *
+     * @param array $data
+     */
+    public function __unserialize(array $data): void
+    {
+        $this->items = $data;
+    }
 }
 }

+ 2 - 0
application/admin/controller/Epay.php

@@ -2,6 +2,7 @@
 
 
 namespace app\admin\controller;
 namespace app\admin\controller;
 
 
+use app\admin\model\AdminLog;
 use app\common\controller\Backend;
 use app\common\controller\Backend;
 use app\common\exception\UploadException;
 use app\common\exception\UploadException;
 use app\common\library\Upload;
 use app\common\library\Upload;
@@ -17,6 +18,7 @@ class Epay extends Backend
      */
      */
     public function upload()
     public function upload()
     {
     {
+        AdminLog::setTitle('上传证书');
         Config::set('default_return_type', 'json');
         Config::set('default_return_type', 'json');
 
 
         //检测是否有addon/config的权限
         //检测是否有addon/config的权限