From ff1fc0d86f6e0d3a65a1a82d6bda452dd6609cce Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 24 Jun 2020 15:43:59 +0800 Subject: [PATCH] ComposerUpdate --- composer.json | 2 +- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 5 + vendor/composer/autoload_real.php | 17 +- vendor/composer/autoload_static.php | 13 +- vendor/composer/installed.json | 44 +- .../options-resolver/OptionsResolver.php | 18 +- .../Debug/OptionsResolverIntrospectorTest.php | 8 +- .../wechat-developer/AliPay/Trade.php | 80 +++ .../wechat-developer/AliPay/Transfer.php | 25 + vendor/zoujingli/wechat-developer/README.md | 2 +- vendor/zoujingli/wechat-developer/We.php | 27 +- .../WeChat/Contracts/BasicAliPay.php | 82 ++- .../WeChat/Contracts/Tools.php | 13 +- .../wechat-developer/WeMini/Guide.php | 547 ++++++++++++++++++ .../wechat-developer/WeMini/Live.php | 56 ++ .../wechat-developer/WeMini/Newtmpl.php | 2 +- .../wechat-developer/WeMini/Operation.php | 41 ++ .../wechat-developer/WeMini/Search.php | 40 ++ .../zoujingli/wechat-developer/WePay/Bill.php | 2 +- .../wechat-developer/_test/alipay-refund.php | 2 +- .../wechat-developer/_test/alipay.php | 8 +- .../zoujingli/wechat-developer/composer.json | 6 +- vendor/zoujingli/wechat-developer/include.php | 2 +- 24 files changed, 990 insertions(+), 54 deletions(-) create mode 100644 vendor/zoujingli/wechat-developer/AliPay/Trade.php create mode 100644 vendor/zoujingli/wechat-developer/WeMini/Guide.php create mode 100644 vendor/zoujingli/wechat-developer/WeMini/Live.php create mode 100644 vendor/zoujingli/wechat-developer/WeMini/Operation.php create mode 100644 vendor/zoujingli/wechat-developer/WeMini/Search.php diff --git a/composer.json b/composer.json index f2a38d882..3a55514e6 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": ">=5.6.0", "qiniu/php-sdk": "^7.2", "endroid/qr-code": "^1.9", - "topthink/framework": "^5.1", + "topthink/framework": "5.1.*", "zoujingli/ip2region": "^1.0", "aliyuncs/oss-sdk-php": "^2.2", "topthink/think-captcha": "^2.0", diff --git a/vendor/autoload.php b/vendor/autoload.php index 1a1d53110..42b92625f 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e::getLoader(); +return ComposerAutoloaderInitda27ad7febee1d9cd74ec4563b8e1630::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b57c309e9..002a37207 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -10,6 +10,7 @@ return array( 'AliPay\\Bill' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Bill.php', 'AliPay\\Pos' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Pos.php', 'AliPay\\Scan' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Scan.php', + 'AliPay\\Trade' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Trade.php', 'AliPay\\Transfer' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Transfer.php', 'AliPay\\Wap' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Wap.php', 'AliPay\\Web' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Web.php', @@ -163,14 +164,18 @@ return array( 'WeMini\\Crypt' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Crypt.php', 'WeMini\\Delivery' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Delivery.php', 'WeMini\\Domain' => $vendorDir . '/zoujingli/weopen-developer/WeMini/Domain.php', + 'WeMini\\Guide' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Guide.php', 'WeMini\\Image' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Image.php', + 'WeMini\\Live' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Live.php', 'WeMini\\Logistics' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Logistics.php', 'WeMini\\Message' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Message.php', 'WeMini\\Newtmpl' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Newtmpl.php', 'WeMini\\Ocr' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Ocr.php', + 'WeMini\\Operation' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Operation.php', 'WeMini\\Plugs' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Plugs.php', 'WeMini\\Poi' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Poi.php', 'WeMini\\Qrcode' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Qrcode.php', + 'WeMini\\Search' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Search.php', 'WeMini\\Security' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Security.php', 'WeMini\\Soter' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Soter.php', 'WeMini\\Template' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Template.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 70dc3b69d..a011b4f54 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e +class ComposerAutoloaderInitda27ad7febee1d9cd74ec4563b8e1630 { private static $loader; @@ -13,21 +13,24 @@ class ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitda27ad7febee1d9cd74ec4563b8e1630', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitda27ad7febee1d9cd74ec4563b8e1630', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit90877748d7744ab95f84f0842f77a41e::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +51,19 @@ class ComposerAutoloaderInit90877748d7744ab95f84f0842f77a41e $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit90877748d7744ab95f84f0842f77a41e::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire90877748d7744ab95f84f0842f77a41e($fileIdentifier, $file); + composerRequireda27ad7febee1d9cd74ec4563b8e1630($fileIdentifier, $file); } return $loader; } } -function composerRequire90877748d7744ab95f84f0842f77a41e($fileIdentifier, $file) +function composerRequireda27ad7febee1d9cd74ec4563b8e1630($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a439b87a1..a45feadbb 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit90877748d7744ab95f84f0842f77a41e +class ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630 { public static $files = array ( '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php', @@ -100,6 +100,7 @@ class ComposerStaticInit90877748d7744ab95f84f0842f77a41e 'AliPay\\Bill' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Bill.php', 'AliPay\\Pos' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Pos.php', 'AliPay\\Scan' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Scan.php', + 'AliPay\\Trade' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Trade.php', 'AliPay\\Transfer' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Transfer.php', 'AliPay\\Wap' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Wap.php', 'AliPay\\Web' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Web.php', @@ -253,14 +254,18 @@ class ComposerStaticInit90877748d7744ab95f84f0842f77a41e 'WeMini\\Crypt' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Crypt.php', 'WeMini\\Delivery' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Delivery.php', 'WeMini\\Domain' => __DIR__ . '/..' . '/zoujingli/weopen-developer/WeMini/Domain.php', + 'WeMini\\Guide' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Guide.php', 'WeMini\\Image' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Image.php', + 'WeMini\\Live' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Live.php', 'WeMini\\Logistics' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Logistics.php', 'WeMini\\Message' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Message.php', 'WeMini\\Newtmpl' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Newtmpl.php', 'WeMini\\Ocr' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Ocr.php', + 'WeMini\\Operation' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Operation.php', 'WeMini\\Plugs' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Plugs.php', 'WeMini\\Poi' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Poi.php', 'WeMini\\Qrcode' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Qrcode.php', + 'WeMini\\Search' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Search.php', 'WeMini\\Security' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Security.php', 'WeMini\\Soter' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Soter.php', 'WeMini\\Template' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Template.php', @@ -288,9 +293,9 @@ class ComposerStaticInit90877748d7744ab95f84f0842f77a41e public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit90877748d7744ab95f84f0842f77a41e::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit90877748d7744ab95f84f0842f77a41e::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit90877748d7744ab95f84f0842f77a41e::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitda27ad7febee1d9cd74ec4563b8e1630::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 382ff4129..d0fade926 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -177,17 +177,17 @@ }, { "name": "symfony/options-resolver", - "version": "v3.4.38", - "version_normalized": "3.4.38.0", + "version": "v3.4.42", + "version_normalized": "3.4.42.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed" + "reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/730ef56164ed6c9356c159e9f5ff2b84d753b9ed", - "reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3b9fe6db7fe3694307d182dd73983584af77d5fd", + "reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd", "shasum": "", "mirrors": [ { @@ -199,7 +199,7 @@ "require": { "php": "^5.5.9|>=7.0.8" }, - "time": "2020-01-01T11:03:25+00:00", + "time": "2020-05-21T13:02:25+00:00", "type": "library", "extra": { "branch-alias": { @@ -235,6 +235,20 @@ "config", "configuration", "options" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ] }, { @@ -443,17 +457,17 @@ }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.17", - "version_normalized": "1.2.17.0", + "version": "v1.2.21", + "version_normalized": "1.2.21.0", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24" + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/98f6e82311a364220a677cdfd56dc9f97851ab24", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/5cf008c37471f775ae28a23fd1ac06c91eac682f", + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f", "shasum": "", "mirrors": [ { @@ -463,15 +477,17 @@ ] }, "require": { + "ext-bcmath": "*", "ext-curl": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-openssl": "*", "ext-simplexml": "*", + "ext-xml": "*", "php": ">=5.4" }, - "time": "2020-03-03T01:38:07+00:00", + "time": "2020-04-26T03:22:09+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -480,8 +496,8 @@ ], "psr-4": { "WePay\\": "WePay", - "WeMini\\": "WeMini", "WeChat\\": "WeChat", + "WeMini\\": "WeMini", "AliPay\\": "AliPay" } }, @@ -493,7 +509,7 @@ { "name": "Anyon", "email": "zoujingli@qq.com", - "homepage": "http://ctolog.com" + "homepage": "https://thinkadmin.top" } ], "description": "WeChat platform and WeChat payment development tools", diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php index fd8a603fe..7354caf8a 100644 --- a/vendor/symfony/options-resolver/OptionsResolver.php +++ b/vendor/symfony/options-resolver/OptionsResolver.php @@ -146,7 +146,7 @@ class OptionsResolver implements Options $reflClosure = new \ReflectionFunction($value); $params = $reflClosure->getParameters(); - if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && Options::class === $class->name) { + if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) { // Initialize the option if no previous value exists if (!isset($this->defaults[$option])) { $this->defaults[$option] = null; @@ -1066,4 +1066,20 @@ class OptionsResolver implements Options { return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; } + + /** + * @return string|null + */ + private function getParameterClassName(\ReflectionParameter $parameter) + { + if (!method_exists($parameter, 'getType')) { + return ($class = $parameter->getClass()) ? $class->name : null; + } + + if (!($type = $parameter->getType()) || $type->isBuiltin()) { + return null; + } + + return method_exists($type, 'getName') ? $type->getName() : (string) $type; + } } diff --git a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php index 8d6e9f63f..5fdb9e265 100644 --- a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php +++ b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php @@ -44,7 +44,7 @@ class OptionsResolverIntrospectorTest extends TestCase $resolver->setDefined($option = 'foo'); $debug = new OptionsResolverIntrospector($resolver); - $this->assertSame('bar', $debug->getDefault($option)); + $debug->getDefault($option); } public function testGetDefaultThrowsOnNotDefinedOption() @@ -54,7 +54,7 @@ class OptionsResolverIntrospectorTest extends TestCase $resolver = new OptionsResolver(); $debug = new OptionsResolverIntrospector($resolver); - $this->assertSame('bar', $debug->getDefault('foo')); + $debug->getDefault('foo'); } public function testGetLazyClosures() @@ -75,7 +75,7 @@ class OptionsResolverIntrospectorTest extends TestCase $resolver->setDefined($option = 'foo'); $debug = new OptionsResolverIntrospector($resolver); - $this->assertSame('bar', $debug->getLazyClosures($option)); + $debug->getLazyClosures($option); } public function testGetLazyClosuresThrowsOnNotDefinedOption() @@ -85,7 +85,7 @@ class OptionsResolverIntrospectorTest extends TestCase $resolver = new OptionsResolver(); $debug = new OptionsResolverIntrospector($resolver); - $this->assertSame('bar', $debug->getLazyClosures('foo')); + $debug->getLazyClosures('foo'); } public function testGetAllowedTypes() diff --git a/vendor/zoujingli/wechat-developer/AliPay/Trade.php b/vendor/zoujingli/wechat-developer/AliPay/Trade.php new file mode 100644 index 000000000..aa289c953 --- /dev/null +++ b/vendor/zoujingli/wechat-developer/AliPay/Trade.php @@ -0,0 +1,80 @@ +options->set('method', $method); + return $this; + } + + /** + * 获取交易接口地址 + * @return string + */ + public function getMethod() + { + return $this->options->get('method'); + } + + /** + * 设置接口公共参数 + * @param array $option + * @return Trade + */ + public function setOption($option = []) + { + foreach ($option as $key => $vo) { + $this->options->set($key, $vo); + } + return $this; + } + + /** + * 获取接口公共参数 + * @return array|string|null + */ + public function getOption() + { + return $this->options->get(); + } + + /** + * 执行通过接口 + * @param array $options + * @return array|boolean|mixed + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function apply($options) + { + return $this->getResult($options); + } +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/AliPay/Transfer.php b/vendor/zoujingli/wechat-developer/AliPay/Transfer.php index 46e9f21fb..3ba69f1fe 100644 --- a/vendor/zoujingli/wechat-developer/AliPay/Transfer.php +++ b/vendor/zoujingli/wechat-developer/AliPay/Transfer.php @@ -15,6 +15,7 @@ namespace AliPay; use WeChat\Contracts\BasicAliPay; +use WeChat\Exceptions\InvalidArgumentException; /** * 支付宝转账到账户 @@ -46,6 +47,7 @@ class Transfer extends BasicAliPay */ public function create($options = []) { + $this->setAppCertSnAndRootCertSn(); $this->options->set('method', 'alipay.fund.trans.uni.transfer'); return $this->getResult($options); } @@ -59,6 +61,7 @@ class Transfer extends BasicAliPay */ public function queryResult($options = []) { + $this->setAppCertSnAndRootCertSn(); $this->options->set('method', 'alipay.fund.trans.common.query'); return $this->getResult($options); @@ -73,7 +76,29 @@ class Transfer extends BasicAliPay */ public function queryAccount($options = []) { + $this->setAppCertSnAndRootCertSn(); $this->options->set('method', 'alipay.fund.account.query'); return $this->getResult($options); } + + /** + * 新版 设置网关应用公钥证书SN、支付宝根证书SN + */ + protected function setAppCertSnAndRootCertSn() + { + if (!$this->config->get('app_cert')) { + throw new InvalidArgumentException("Missing Config -- [app_cert]"); + } + if (!$this->config->get('root_cert')) { + throw new InvalidArgumentException("Missing Config -- [root_cert]"); + } + $this->options->set('app_cert_sn', $this->getCertSN($this->config->get('app_cert'))); + $this->options->set('alipay_root_cert_sn', $this->getRootCertSN($this->config->get('root_cert'))); + if (!$this->options->get('app_cert_sn')) { + throw new InvalidArgumentException("Missing options -- [app_cert_sn]"); + } + if (!$this->options->get('alipay_root_cert_sn')) { + throw new InvalidArgumentException("Missing options -- [alipay_root_cert_sn]"); + } + } } \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/README.md b/vendor/zoujingli/wechat-developer/README.md index 529d1f4b8..21099e3d6 100644 --- a/vendor/zoujingli/wechat-developer/README.md +++ b/vendor/zoujingli/wechat-developer/README.md @@ -40,7 +40,7 @@ WeChatDeveloper 为开源项目,允许把它用于任何地方,不受任何 * Gitee 托管地址:https://gitee.com/zoujingli/WeChatDeveloper * GitHub 托管地址:https://github.com/zoujingli/WeChatDeveloper -文件说明 +文件说明(后缀会根据官方文档增加文件) ---- |文件名|类名|描述|类型|加载 ①| diff --git a/vendor/zoujingli/wechat-developer/We.php b/vendor/zoujingli/wechat-developer/We.php index a81ff1a25..6523ec3af 100644 --- a/vendor/zoujingli/wechat-developer/We.php +++ b/vendor/zoujingli/wechat-developer/We.php @@ -23,6 +23,15 @@ use WeChat\Exceptions\InvalidInstanceException; * @author Anyon * @date 2018/05/24 13:23 * + * ----- AliPay ---- + * @method \AliPay\App AliPayApp($options) static 支付宝App支付网关 + * @method \AliPay\Bill AliPayBill($options) static 支付宝电子面单下载 + * @method \AliPay\Pos AliPayPos($options) static 支付宝刷卡支付 + * @method \AliPay\Scan AliPayScan($options) static 支付宝扫码支付 + * @method \AliPay\Transfer AliPayTransfer($options) static 支付宝转账到账户 + * @method \AliPay\Wap AliPayWap($options) static 支付宝手机网站支付 + * @method \AliPay\Web AliPayWeb($options) static 支付宝网站支付 + * * ----- WeChat ----- * @method \WeChat\Card WeChatCard($options = []) static 微信卡券管理 * @method \WeChat\Custom WeChatCustom($options = []) static 微信客服消息 @@ -45,13 +54,18 @@ use WeChat\Exceptions\InvalidInstanceException; * ----- WeMini ----- * @method \WeMini\Crypt WeMiniCrypt($options = []) static 小程序数据加密处理 * @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送 + * @method \WeMini\Guide WeMiniGuide($options = []) static 小程序导购助手 * @method \WeMini\Image WeMiniImage($options = []) static 小程序图像处理 + * @method \WeMini\Live WeMiniLive($options = []) static 小程序直播接口 * @method \WeMini\Logistics WeMiniLogistics($options = []) static 小程序物流助手 * @method \WeMini\Message WeMiniMessage($options = []) static 小程序动态消息 + * @method \WeMini\Newtmpl WeMiniNewtmpl($options = []) static 小程序订阅消息 * @method \WeMini\Ocr WeMiniOcr($options = []) static 小程序ORC服务 + * @method \WeMini\Operation WeMiniOperation($options = []) static 小程序运维中心 * @method \WeMini\Plugs WeMiniPlugs($options = []) static 小程序插件管理 * @method \WeMini\Poi WeMiniPoi($options = []) static 小程序地址管理 * @method \WeMini\Qrcode WeMiniQrcode($options = []) static 小程序二维码管理 + * @method \WeMini\Search WeMiniSearch($options = []) static 小程序搜索 * @method \WeMini\Security WeMiniSecurity($options = []) static 小程序内容安全 * @method \WeMini\Soter WeMiniSoter($options = []) static 小程序生物认证 * @method \WeMini\Template WeMiniTemplate($options = []) static 小程序模板消息支持 @@ -59,21 +73,12 @@ use WeChat\Exceptions\InvalidInstanceException; * * ----- WePay ----- * @method \WePay\Bill WePayBill($options = []) static 微信商户账单及评论 + * @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券 * @method \WePay\Order WePayOrder($options = []) static 微信商户订单 * @method \WePay\Refund WePayRefund($options = []) static 微信商户退款 - * @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券 * @method \WePay\Redpack WePayRedpack($options = []) static 微信红包支持 * @method \WePay\Transfers WePayTransfers($options = []) static 微信商户打款到零钱 * @method \WePay\TransfersBank WePayTransfersBank($options = []) static 微信商户打款到银行卡 - * - * ----- AliPay ---- - * @method \AliPay\App AliPayApp($options) static 支付宝App支付网关 - * @method \AliPay\Bill AliPayBill($options) static 支付宝电子面单下载 - * @method \AliPay\Pos AliPayPos($options) static 支付宝刷卡支付 - * @method \AliPay\Scan AliPayScan($options) static 支付宝扫码支付 - * @method \AliPay\Transfer AliPayTransfer($options) static 支付宝转账到账户 - * @method \AliPay\Wap AliPayWap($options) static 支付宝手机网站支付 - * @method \AliPay\Web AliPayWeb($options) static 支付宝网站支付 */ class We { @@ -81,7 +86,7 @@ class We * 定义当前版本 * @var string */ - const VERSION = '1.2.17'; + const VERSION = '1.2.21'; /** * 静态配置 diff --git a/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php b/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php index b2d320acf..1c0c49f5c 100644 --- a/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php +++ b/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php @@ -198,7 +198,7 @@ abstract class BasicAliPay */ protected function getSign() { - $content = wordwrap($this->config->get('private_key'), 64, "\n", true); + $content = wordwrap($this->trimCert($this->config->get('private_key')), 64, "\n", true); $string = "-----BEGIN RSA PRIVATE KEY-----\n{$content}\n-----END RSA PRIVATE KEY-----"; if ($this->options->get('sign_type') === 'RSA2') { openssl_sign($this->getSignContent($this->options->get(), true), $sign, $string, OPENSSL_ALGO_SHA256); @@ -208,6 +208,17 @@ abstract class BasicAliPay return base64_encode($sign); } + /** + * 去除证书前后内容及空白 + * @param string $sign + * @return string + */ + protected function trimCert($sign) + { + // if (file_exists($sign)) $sign = file_get_contents($sign); + return preg_replace(['/\s+/', '/\-{5}.*?\-{5}/'], '', $sign); + } + /** * 数据签名处理 * @param array $data 需要进行签名数据 @@ -276,6 +287,75 @@ abstract class BasicAliPay return "{$html}"; } + /** + * 新版 从证书中提取序列号 + * @param string $sign + * @return string + */ + public function getCertSN($sign) + { + // if (file_exists($sign)) $sign = file_get_contents($sign); + $ssl = openssl_x509_parse($sign); + return md5($this->_arr2str(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); + } + + /** + * 新版 提取根证书序列号 + * @param string $sign + * @return string|null + */ + public function getRootCertSN($sign) + { + $sn = null; + // if (file_exists($sign)) $sign = file_get_contents($sign); + $array = explode("-----END CERTIFICATE-----", $sign); + for ($i = 0; $i < count($array) - 1; $i++) { + $ssl[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----"); + if (strpos($ssl[$i]['serialNumber'], '0x') === 0) { + $ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumber']); + } + if ($ssl[$i]['signatureTypeLN'] == "sha1WithRSAEncryption" || $ssl[$i]['signatureTypeLN'] == "sha256WithRSAEncryption") { + if ($sn == null) { + $sn = md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); + } else { + $sn = $sn . "_" . md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); + } + } + } + return $sn; + } + + /** + * 新版 数组转字符串 + * @param array $array + * @return string + */ + private function _arr2str($array) + { + $string = []; + if ($array && is_array($array)) { + foreach ($array as $key => $value) { + $string[] = $key . '=' . $value; + } + } + return implode(',', $string); + } + + + /** + * 新版 0x转高精度数字 + * @param string $hex + * @return int|string + */ + private function _hex2dec($hex) + { + list($dec, $len) = [0, strlen($hex)]; + for ($i = 1; $i <= $len; $i++) { + $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i)))); + } + return $dec; + } + /** * 应用数据操作 * @param array $options diff --git a/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php b/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php index 60a435d5c..fe3882e90 100644 --- a/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php +++ b/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php @@ -164,10 +164,21 @@ class Tools return json_decode(json_encode($data), true); } + /** + * 解析XML文本内容 + * @param string $xml + * @return boolean|mixed + */ + public static function xml3arr($xml) + { + $state = xml_parse($parser = xml_parser_create(), $xml, true); + return xml_parser_free($parser) && $state ? self::xml2arr($xml) : false; + } + /** * 数组转xml内容 * @param array $data - * @return null|string|string + * @return null|string */ public static function arr2json($data) { diff --git a/vendor/zoujingli/wechat-developer/WeMini/Guide.php b/vendor/zoujingli/wechat-developer/WeMini/Guide.php new file mode 100644 index 000000000..2653b4500 --- /dev/null +++ b/vendor/zoujingli/wechat-developer/WeMini/Guide.php @@ -0,0 +1,547 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 服务号删除导购 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideAcct($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguideacct?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 服务号获取导购信息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideAcct($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 获取服务号的敏感词信息与自动回复信息 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideAcctConfig() + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacctconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, [], true); + } + + /** + * 服务号拉取导购列表 + * @param integer $page + * @param integer $num + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideAcctList($page = 0, $num = 10) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacctconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['page' => $page, 'num' => $num], true); + } + + /** + * 获取导购聊天记录 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerChatRecord($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 获取导购快捷回复信息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideConfig($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 生成导购二维码 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function guideCreateQrCode($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/guidecreateqrcode?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function pushShowWxaPathMenu($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/pushshowwxapathmenu?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 为服务号设置敏感词与自动回复 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setGuideAcctConfig($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideacctconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 设置导购快捷回复信息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setGuideConfig($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 更新导购昵称或者头像 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function updateGuideAcct($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideconfig?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 添加展示标签信息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addGuideBuyerDisplayTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyerdisplaytag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 为粉丝添加可查询标签 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addGuideBuyerTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyertag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 添加标签可选值 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addGuideTagOption($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidetagoption?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + + /** + * 删除粉丝标签 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideBuyerTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidebuyertag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 查询展示标签信息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerDisplayTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerdisplaytag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 查询粉丝标签 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyertag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 查询标签可选值信息 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideTagOption() + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidetagoption?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, [], true); + } + + /** + * 新建可查询标签类型,支持新建4类可查询标签 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function newGuideTagOption($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/newguidetagoption?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 根据标签值筛选粉丝 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function queryGuideBuyerByTag($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/queryguidebuyerbytag?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 为服务号导购添加粉丝 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addGuideBuyerRelation($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyerrelation?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 删除导购的粉丝 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideBuyerRelation($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidebuyerrelation?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 查询某一个粉丝与导购的绑定关系 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerRelation($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelation?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 通过粉丝信息查询该粉丝与导购的绑定关系 + * @param string $openid + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerRelationByBuyer($openid) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelation?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['openid' => $openid], true); + } + + /** + * 拉取导购的粉丝列表 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideBuyerRelationList($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelationlist?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 将粉丝从一个导购迁移到另外一个导购下 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function rebindGuideAcctForBuyer($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/rebindguideacctforbuyer?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 更新粉丝昵称 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function updateGuideBuyerRelation($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/updateguidebuyerrelation?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 删除小程序卡片素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideCardMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidecardmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 删除图片素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideImageMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguideimagematerial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 删除文字素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delGuideWordMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidewordmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 获取小程序卡片素材信息 + * @param integer $type + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideCardMaterial($type = 0) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidecardmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['type' => $type], true); + } + + /** + * 获取图片素材信息 + * @param integer $type 操作类型 + * @param integer $start 分页查询,起始位置 + * @param integer $num 分页查询,查询个数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideImageMaterial($type = 0, $start = 0, $num = 10) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideimagematerial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['type' => $type, 'start' => $start, 'num' => $num], true); + } + + /** + * 获取文字素材信息 + * @param integer $type 操作类型 + * @param integer $start 分页查询,起始位置 + * @param integer $num 分页查询,查询个数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGuideWordMaterial($type = 0, $start = 0, $num = 10) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidewordmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['type' => $type, 'start' => $start, 'num' => $num], true); + } + + /** + * 添加小程序卡片素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setGuideCardMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguidecardmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 添加图片素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setGuideImageMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideimagematerial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + + /** + * 为服务号添加文字素材 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setGuideWordMaterial($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/guide/setguidewordmaterial?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/WeMini/Live.php b/vendor/zoujingli/wechat-developer/WeMini/Live.php new file mode 100644 index 000000000..a7ff7a03f --- /dev/null +++ b/vendor/zoujingli/wechat-developer/WeMini/Live.php @@ -0,0 +1,56 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['start' => $start, 'limit' => $limit], true); + } + + /** + * 获取回放源视频 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getLiveInfo($data = []) + { + $url = 'http://api.weixin.qq.com/wxa/business/getliveinfo?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php b/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php index 80ae2ace0..0bb402715 100644 --- a/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php +++ b/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php @@ -74,7 +74,7 @@ class Newtmpl extends BasicWeChat { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatetitles?access_token=ACCESS_TOKEN'; $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['ids'=>$ids,'start' => '0', 'limit' => '30'], true); + return $this->callPostApi($url, ['ids' => $ids, 'start' => '0', 'limit' => '30'], true); } /** diff --git a/vendor/zoujingli/wechat-developer/WeMini/Operation.php b/vendor/zoujingli/wechat-developer/WeMini/Operation.php new file mode 100644 index 000000000..fe0bb068d --- /dev/null +++ b/vendor/zoujingli/wechat-developer/WeMini/Operation.php @@ -0,0 +1,41 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, $data, true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/WeMini/Search.php b/vendor/zoujingli/wechat-developer/WeMini/Search.php new file mode 100644 index 000000000..92b888e8e --- /dev/null +++ b/vendor/zoujingli/wechat-developer/WeMini/Search.php @@ -0,0 +1,40 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->callPostApi($url, ['pages' => $pages], true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/WePay/Bill.php b/vendor/zoujingli/wechat-developer/WePay/Bill.php index 4c853c700..602fbc712 100644 --- a/vendor/zoujingli/wechat-developer/WePay/Bill.php +++ b/vendor/zoujingli/wechat-developer/WePay/Bill.php @@ -39,7 +39,7 @@ class Bill extends BasicWePay $params = $this->params->merge($options); $params['sign'] = $this->getPaySign($params, 'MD5'); $result = Tools::post('https://api.mch.weixin.qq.com/pay/downloadbill', Tools::arr2xml($params)); - if (($jsonData = Tools::xml2arr($result))) { + if (is_array($jsonData = Tools::xml3arr($result))) { if ($jsonData['return_code'] !== 'SUCCESS') { throw new InvalidResponseException($jsonData['return_msg'], '0'); } diff --git a/vendor/zoujingli/wechat-developer/_test/alipay-refund.php b/vendor/zoujingli/wechat-developer/_test/alipay-refund.php index 487ca7b27..6bcdddb5d 100644 --- a/vendor/zoujingli/wechat-developer/_test/alipay-refund.php +++ b/vendor/zoujingli/wechat-developer/_test/alipay-refund.php @@ -31,7 +31,7 @@ try { // 参考链接:https://docs.open.alipay.com/api_1/alipay.trade.refund $result = $pay->refund($out_trade_no, $refund_fee); - + echo '
';
     var_export($result);
 } catch (Exception $e) {
diff --git a/vendor/zoujingli/wechat-developer/_test/alipay.php b/vendor/zoujingli/wechat-developer/_test/alipay.php
index 25a7379d3..beaf985bd 100644
--- a/vendor/zoujingli/wechat-developer/_test/alipay.php
+++ b/vendor/zoujingli/wechat-developer/_test/alipay.php
@@ -19,10 +19,14 @@ return [
     'sign_type'   => "RSA2",
     // 应用ID
     'appid'       => '2016090900468879',
-    // 支付宝公钥(1行填写,特别注意,这里是支付宝公钥,不是应用公钥,最好从开发者中心的网页上去复制)
+    // 支付宝公钥 (1行填写,特别注意,这里是支付宝公钥,不是应用公钥,最好从开发者中心的网页上去复制)
     'public_key'  => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtU71NY53UDGY7JNvLYAhsNa+taTF6KthIHJmGgdio9bkqeJGhHk6ttkTKkLqFgwIfgAkHpdKiOv1uZw6gVGZ7TCu5LfHTqKrCd6Uz+N7hxhY+4IwicLgprcV1flXQLmbkJYzFMZqkXGkSgOsR2yXh4LyQZczgk9N456uuzGtRy7MoB4zQy34PLUkkxR6W1B2ftNbLRGXv6tc7p/cmDcrY6K1bSxnGmfRxFSb8lRfhe0V0UM6pKq2SGGSeovrKHN0OLp+Nn5wcULVnFgATXGCENshRlp96piPEBFwneXs19n+sX1jx60FTR7/rME3sW3AHug0fhZ9mSqW4x401WjdnwIDAQAB',
-    // 支付宝私钥(1行填写)
+    // 支付宝私钥 (1行填写)
     'private_key' => 'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC3pbN7esinxgjE8uxXAsccgGNKIq+PR1LteNTFOy0fsete43ObQCrzd9DO0zaUeBUzpIOnxrKxez7QoZROZMYrinttFZ/V5rbObEM9E5AR5Tv/Fr4IBywoS8ZtN16Xb+fZmibfU91yq9O2RYSvscncU2qEYmmaTenM0QlUO80ZKqPsM5JkgCNdcYZTUeHclWeyER3dSImNtlSKiSBSSTHthb11fkudjzdiUXua0NKVWyYuAOoDMcpXbD6NJmYqEA/iZ/AxtQt08pv0Mow581GPB0Uop5+qA2hCV85DpagE94a067sKcRui0rtkJzHem9k7xVL+2RoFm1fv3RnUkMwhAgMBAAECggEAAetkddzxrfc+7jgPylUIGb8pyoOUTC4Vqs/BgZI9xYAJksNT2QKRsFvHPfItNt4Ocqy8h4tnIL3GCU43C564B4p6AcjhE85GiN/O0BudPOKlfuQQ9mqExqMMHuYeQfz0cmzPDTSGMwWiv9v4KBH2pyvkCCAzNF6uG+rvawb4/NNVuiI7C8Ku/wYsamtbgjMZVOFFdScYgIw1BgA99RUU/fWBLMnTQkoyowSRb9eSmEUHjt/WQt+/QgKAT2WmuX4RhaGy0qcQLbNaJNKXdJ+PVhQrSiasINNtqYMa8GsQuuKsk3X8TCg9K6/lowivt5ruhyWcP2sx93zY/LGzIHgHcQKBgQDoZlcs9RWxTdGDdtH8kk0J/r+QtMijNzWI0a+t+ZsWOyd3rw+uM/8O4JTNP4Y98TvvxhJXewITbfiuOIbW1mxh8bnO/fcz7+RXZKgPDeoTeNo717tZFZGBEyUdH9M9Inqvht7+hjVDIMCYBDomYebdk3Xqo4mDBjLRdVNGrhGmVQKBgQDKS/MgTMK8Ktfnu1KzwCbn/FfHTOrp1a1t1wWPv9AW0rJPYeaP6lOkgIoO/1odG9qDDhdB6njqM+mKY5Yr3N94PHamHbwJUCmbkqEunCWpGzgcQZ1Q254xk9D7UKq/XUqW2WDqDq80GQeNial+fBc46yelQzokwdA+JdIFKoyinQKBgQCBems9V/rTAtkk1nFdt6EGXZEbLS3PiXXhGXo4gqV+OEzf6H/i/YMwJb2hsK+5GQrcps0XQihA7PctEb9GOMa/tu5fva0ZmaDtc94SLR1p5d4okyQFGPgtIp594HpPSEN0Qb9BrUJFeRz0VP6U3dzDPGHo7V4yyqRLgIN6EIcy1QKBgAqdh6mHPaTAHspDMyjJiYEc5cJIj/8rPkmIQft0FkhMUB0IRyAALNlyAUyeK61hW8sKvz+vPR8VEEk5xpSQp41YpuU6pDZc5YILZLfca8F+8yfQbZ/jll6Foi694efezl4yE/rUQG9cbOAJfEJt4o4TEOaEK5XoMbRBKc8pl22lAoGARTq0qOr9SStihRAy9a+8wi2WEwL4QHcmOjH7iAuJxy5b5TRDSjlk6h+0dnTItiFlTXdfpO8KhWA8EoSJVBZ1kcACQDFgMIA+VM+yXydtzMotOn21W4stfZ4I6dHFiujMsnKpNYVpQh3oCrJf4SeXiQDdiSCodqb1HlKkEc6naHQ=',
+    // 应用公钥证书(新版资金类接口转 app_cert_sn)
+    'app_cert'    => '',
+    // 支付宝根证书(新版资金类接口转 alipay_root_cert_sn)
+    'root_cert'   => '',
     // 支付成功通知地址
     'notify_url'  => '',
     // 网页支付回跳地址
diff --git a/vendor/zoujingli/wechat-developer/composer.json b/vendor/zoujingli/wechat-developer/composer.json
index d8ee7c14c..b0c41e380 100644
--- a/vendor/zoujingli/wechat-developer/composer.json
+++ b/vendor/zoujingli/wechat-developer/composer.json
@@ -8,7 +8,7 @@
     {
       "name": "Anyon",
       "email": "zoujingli@qq.com",
-      "homepage": "http://ctolog.com"
+      "homepage": "https://thinkadmin.top"
     }
   ],
   "keywords": [
@@ -21,8 +21,10 @@
   ],
   "require": {
     "php": ">=5.4",
+    "ext-xml": "*",
     "ext-json": "*",
     "ext-curl": "*",
+    "ext-bcmath": "*",
     "ext-libxml": "*",
     "ext-openssl": "*",
     "ext-mbstring": "*",
@@ -34,8 +36,8 @@
     ],
     "psr-4": {
       "WePay\\": "WePay",
-      "WeMini\\": "WeMini",
       "WeChat\\": "WeChat",
+      "WeMini\\": "WeMini",
       "AliPay\\": "AliPay"
     }
   }
diff --git a/vendor/zoujingli/wechat-developer/include.php b/vendor/zoujingli/wechat-developer/include.php
index e88c70ece..cd3af5f50 100644
--- a/vendor/zoujingli/wechat-developer/include.php
+++ b/vendor/zoujingli/wechat-developer/include.php
@@ -16,7 +16,7 @@ spl_autoload_register(function ($classname) {
     $pathname = __DIR__ . DIRECTORY_SEPARATOR;
     $filename = str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
     if (file_exists($pathname . $filename)) {
-        foreach (['WeChat', 'WeMini', 'AliPay', 'WePay', 'We'] as $prefix) {
+        foreach (['AliPay', 'WeChat', 'WeMini', 'WePay', 'We'] as $prefix) {
             if (stripos($classname, $prefix) === 0) {
                 include $pathname . $filename;
                 return true;