From ff7decf34171db1b3941c25a0cf8b8f561af6362 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Mon, 4 Mar 2024 12:49:31 +0000 Subject: [PATCH 1/2] Minor vendor library updates Update of 3rd party vendor libraries via composer. Also added installer validation for some additional required PHP libraries. --- composer.json | 2 +- composer.lock | 149 +- upload/admin/config.php_ | 36 + upload/config.php_ | 30 + upload/install/controller/install/step_2.php | 24 + .../install/language/en-gb/install/step_2.php | 8 + .../install/view/template/install/step_2.twig | 56 + upload/system/storage/vendor/autoload.php | 2 +- .../storage/vendor/composer/ClassLoader.php | 41 +- .../storage/vendor/composer/autoload_psr4.php | 1 + .../storage/vendor/composer/autoload_real.php | 35 +- .../vendor/composer/autoload_static.php | 15 +- .../storage/vendor/composer/installed.json | 165 +- .../storage/vendor/composer/installed.php | 58 +- .../vendor/klarna/kco_rest/.coveralls.yml | 3 - .../storage/vendor/klarna/kco_rest/.gitignore | 3 - .../vendor/klarna/kco_rest/.travis.yml | 29 - .../vendor/klarna/kco_rest/CHANGELOG.md | 17 - .../storage/vendor/klarna/kco_rest/README.md | 67 - .../vendor/klarna/kco_rest/composer.json | 46 - .../vendor/klarna/kco_rest/composer.lock | 3569 ----------------- .../examples/capture/add_shipping_info.php | 34 - .../examples/capture/trigger_send_out.php | 22 - .../capture/update_customer_details.php | 27 - .../examples/checkout/create_checkout.php | 60 - .../checkout/create_checkout_attachment.php | 79 - .../docs/examples/checkout/fetch_checkout.php | 19 - .../examples/checkout/update_checkout.php | 56 - .../docs/examples/order/acknowledge_order.php | 22 - .../docs/examples/order/cancel_order.php | 21 - .../docs/examples/order/create_capture.php | 49 - .../order/extend_authorization_time.php | 19 - .../docs/examples/order/fetch_capture.php | 21 - .../docs/examples/order/fetch_order.php | 19 - .../docs/examples/order/refund_order.php | 37 - .../order/release_remaining_authorization.php | 21 - .../order/update_customer_details.php | 30 - .../order/update_merchant_references.php | 25 - .../examples/order/update_order_lines.php | 37 - .../klarna/kco_rest/git_hooks/README.md | 14 - .../klarna/kco_rest/git_hooks/coffeelint | 103 - .../git_hooks/commit-msg/message-format | 34 - .../git_hooks/commit-msg/ticket-number | 30 - .../vendor/klarna/kco_rest/git_hooks/jshint | 69 - .../git_hooks/pre-commit/check-coffee | 59 - .../kco_rest/git_hooks/pre-commit/check-js | 59 - .../kco_rest/git_hooks/pre-commit/check-php | 65 - .../git_hooks/pre-commit/check-python | 48 - .../storage/vendor/klarna/kco_rest/phpmd.xml | 32 - .../vendor/klarna/kco_rest/phpunit.xml.dist | 40 - .../src/Klarna/Rest/Checkout/Order.php | 112 - .../Klarna/Rest/OrderManagement/Capture.php | 149 - .../src/Klarna/Rest/OrderManagement/Order.php | 317 -- .../kco_rest/src/Klarna/Rest/Resource.php | 200 - .../src/Klarna/Rest/Transport/Connector.php | 186 - .../Rest/Transport/ConnectorInterface.php | 94 - .../Exception/ConnectorException.php | 110 - .../Rest/Transport/ResponseValidator.php | 137 - .../src/Klarna/Rest/Transport/UserAgent.php | 130 - .../Rest/Transport/UserAgentInterface.php | 117 - .../tests/Component/Checkout/OrderTest.php | 135 - .../Component/OrderManagement/CaptureTest.php | 168 - .../Component/OrderManagement/OrderTest.php | 451 --- .../tests/Component/ResourceTestCase.php | 45 - .../kco_rest/tests/Component/TestCase.php | 80 - .../Component/Transport/ConnectorTest.php | 144 - .../tests/Unit/Checkout/OrderTest.php | 418 -- .../Unit/OrderManagement/CaptureTest.php | 512 --- .../tests/Unit/OrderManagement/OrderTest.php | 921 ----- .../klarna/kco_rest/tests/Unit/TestCase.php | 57 - .../tests/Unit/Transport/ConnectorTest.php | 343 -- .../Exception/ConnectorExceptionTest.php | 80 - .../Unit/Transport/ResponseValidatorTest.php | 249 -- .../tests/Unit/Transport/UserAgentTest.php | 125 - .../klarna/kco_rest/tests/bootstrap.php | 23 - .../vendor/scssphp/scssphp/composer.json | 2 +- .../scssphp/src/Block/CallableBlock.php | 3 +- .../vendor/scssphp/scssphp/src/Compiler.php | 102 +- .../scssphp/scssphp/src/Node/Number.php | 18 +- .../scssphp/scssphp/src/OutputStyle.php | 53 + .../vendor/scssphp/scssphp/src/Parser.php | 19 +- .../vendor/scssphp/scssphp/src/Version.php | 2 +- .../vendor/symfony/polyfill-ctype/LICENSE | 2 +- .../symfony/polyfill-ctype/composer.json | 3 - .../vendor/symfony/polyfill-intl-idn/Idn.php | 28 +- .../vendor/symfony/polyfill-intl-idn/LICENSE | 2 +- .../Resources/unidata/DisallowedRanges.php | 9 + .../Resources/unidata/Regex.php | 9 + .../symfony/polyfill-intl-idn/composer.json | 3 - .../symfony/polyfill-intl-normalizer/LICENSE | 2 +- .../polyfill-intl-normalizer/composer.json | 3 - .../vendor/symfony/polyfill-mbstring/LICENSE | 2 +- .../symfony/polyfill-mbstring/Mbstring.php | 87 +- .../Resources/unidata/caseFolding.php | 119 + .../symfony/polyfill-mbstring/bootstrap.php | 4 + .../symfony/polyfill-mbstring/bootstrap80.php | 4 + .../symfony/polyfill-mbstring/composer.json | 3 - .../vendor/symfony/polyfill-php72/LICENSE | 2 +- .../symfony/polyfill-php72/composer.json | 3 - .../vendor/symfony/polyfill-php80/LICENSE | 2 +- .../symfony/polyfill-php80/composer.json | 3 - .../system/storage/vendor/twig/twig/CHANGELOG | 18 + .../storage/vendor/twig/twig/composer.json | 3 +- .../twig/twig/src/Cache/FilesystemCache.php | 2 +- .../vendor/twig/twig/src/Environment.php | 9 +- .../vendor/twig/twig/src/Error/Error.php | 8 +- .../twig/twig/src/Error/SyntaxError.php | 2 +- .../vendor/twig/twig/src/ExpressionParser.php | 24 +- .../twig/twig/src/Extension/CoreExtension.php | 80 +- .../twig/src/Extension/DebugExtension.php | 4 +- .../twig/src/Extension/EscaperExtension.php | 4 +- .../src/FileExtensionEscapingStrategy.php | 2 +- .../storage/vendor/twig/twig/src/Lexer.php | 15 +- .../twig/twig/src/Loader/FilesystemLoader.php | 4 +- .../src/Node/Expression/ArrayExpression.php | 64 +- .../Node/Expression/Binary/EndsWithBinary.php | 2 +- .../Expression/Binary/StartsWithBinary.php | 2 +- .../src/Node/Expression/CallExpression.php | 6 +- .../Node/Expression/ConditionalExpression.php | 27 +- .../vendor/twig/twig/src/Node/ModuleNode.php | 9 + .../vendor/twig/twig/src/Node/Node.php | 1 - .../vendor/twig/twig/src/Node/WithNode.php | 2 +- .../src/NodeVisitor/EscaperNodeVisitor.php | 10 +- .../MacroAutoImportNodeVisitor.php | 8 +- .../src/NodeVisitor/OptimizerNodeVisitor.php | 32 +- .../storage/vendor/twig/twig/src/Parser.php | 5 +- .../twig/src/Profiler/Dumper/HtmlDumper.php | 2 +- .../vendor/twig/twig/src/Profiler/Profile.php | 2 +- .../twig/twig/src/Sandbox/SecurityPolicy.php | 10 +- .../storage/vendor/twig/twig/src/Template.php | 4 +- .../vendor/twig/twig/src/TemplateWrapper.php | 4 +- .../twig/src/Test/IntegrationTestCase.php | 5 +- .../twig/twig/src/Test/NodeTestCase.php | 2 +- .../storage/vendor/twig/twig/src/Token.php | 12 +- .../twig/src/TokenParser/FromTokenParser.php | 4 +- .../twig/src/TokenParser/UseTokenParser.php | 4 +- .../vendor/twig/twig/src/TwigFilter.php | 4 +- .../vendor/twig/twig/src/TwigFunction.php | 4 +- .../storage/vendor/twig/twig/src/TwigTest.php | 4 +- .../zoujingli/wechat-developer/AliPay/App.php | 8 +- .../wechat-developer/AliPay/Bill.php | 10 +- .../zoujingli/wechat-developer/AliPay/Pos.php | 10 +- .../wechat-developer/AliPay/Scan.php | 10 +- .../wechat-developer/AliPay/Trade.php | 82 + .../wechat-developer/AliPay/Transfer.php | 11 +- .../zoujingli/wechat-developer/AliPay/Wap.php | 8 +- .../zoujingli/wechat-developer/AliPay/Web.php | 8 +- .../vendor/zoujingli/wechat-developer/We.php | 48 +- .../wechat-developer/WeChat/Card.php | 295 +- .../WeChat/Contracts/BasicAliPay.php | 226 +- .../WeChat/Contracts/BasicPushEvent.php | 56 +- .../WeChat/Contracts/BasicWeChat.php | 57 +- .../WeChat/Contracts/BasicWePay.php | 41 +- .../WeChat/Contracts/BasicWeWork.php | 43 + .../WeChat/Contracts/DataArray.php | 22 +- .../WeChat/Contracts/DataError.php | 8 +- .../WeChat/Contracts/MyCurlFile.php | 22 +- .../WeChat/Contracts/Tools.php | 87 +- .../wechat-developer/WeChat/Custom.php | 76 +- .../wechat-developer/WeChat/Draft.php | 124 + .../Exceptions/InvalidArgumentException.php | 8 +- .../Exceptions/InvalidDecryptException.php | 8 +- .../Exceptions/InvalidInstanceException.php | 8 +- .../Exceptions/InvalidResponseException.php | 8 +- .../WeChat/Exceptions/LocalCacheException.php | 8 +- .../wechat-developer/WeChat/Freepublish.php | 98 + .../wechat-developer/WeChat/Limit.php | 26 +- .../wechat-developer/WeChat/Media.php | 85 +- .../wechat-developer/WeChat/Menu.php | 51 +- .../wechat-developer/WeChat/Oauth.php | 46 +- .../zoujingli/wechat-developer/WeChat/Pay.php | 67 +- .../wechat-developer/WeChat/Product.php | 85 +- .../WeChat/Prpcrypt/ErrorCode.php | 53 + .../WeChat/Prpcrypt/PKCS7Encoder.php | 46 + .../{Contracts => Prpcrypt}/Prpcrypt.php | 103 +- .../wechat-developer/WeChat/Qrcode.php | 25 +- .../wechat-developer/WeChat/Receive.php | 8 +- .../wechat-developer/WeChat/Scan.php | 93 +- .../wechat-developer/WeChat/Script.php | 38 +- .../wechat-developer/WeChat/Shake.php | 199 +- .../wechat-developer/WeChat/Tags.php | 29 +- .../wechat-developer/WeChat/Template.php | 43 +- .../wechat-developer/WeChat/User.php | 41 +- .../wechat-developer/WeChat/Wifi.php | 8 +- .../wechat-developer/WeMini/Crypt.php | 31 +- .../wechat-developer/WeMini/Delivery.php | 19 +- .../wechat-developer/WeMini/Guide.php | 527 +++ .../wechat-developer/WeMini/Image.php | 24 +- .../wechat-developer/WeMini/Live.php | 171 + .../wechat-developer/WeMini/Logistics.php | 22 +- .../wechat-developer/WeMini/Message.php | 11 +- .../wechat-developer/WeMini/Newtmpl.php | 26 +- .../zoujingli/wechat-developer/WeMini/Ocr.php | 39 +- .../wechat-developer/WeMini/Operation.php | 41 + .../wechat-developer/WeMini/Plugs.php | 15 +- .../zoujingli/wechat-developer/WeMini/Poi.php | 13 +- .../wechat-developer/WeMini/Qrcode.php | 84 +- .../wechat-developer/WeMini/Scheme.php | 80 + .../wechat-developer/WeMini/Search.php | 40 + .../wechat-developer/WeMini/Security.php | 18 +- .../wechat-developer/WeMini/Shipping.php | 118 + .../wechat-developer/WeMini/Soter.php | 10 +- .../wechat-developer/WeMini/Template.php | 15 +- .../wechat-developer/WeMini/Total.php | 35 +- .../WeMini/crypt/wxBizDataCrypt.php | 13 +- .../zoujingli/wechat-developer/WePay/Bill.php | 14 +- .../wechat-developer/WePay/Coupon.php | 10 +- .../wechat-developer/WePay/Custom.php | 69 + .../wechat-developer/WePay/Order.php | 10 +- .../wechat-developer/WePay/ProfitSharing.php | 145 + .../wechat-developer/WePay/Redpack.php | 8 +- .../wechat-developer/WePay/Refund.php | 39 +- .../wechat-developer/WePay/Transfers.php | 8 +- .../wechat-developer/WePay/TransfersBank.php | 11 +- .../wechat-developer/WePayV3/Cert.php | 63 + .../WePayV3/Contracts/BasicWePay.php | 352 ++ .../WePayV3/Contracts/DecryptAes.php | 83 + .../wechat-developer/WePayV3/Order.php | 202 + .../WePayV3/ProfitSharing.php | 100 + .../wechat-developer/WePayV3/Refund.php | 82 + .../wechat-developer/WePayV3/Transfers.php | 104 + .../wechat-developer/_test/alipay-app.php | 21 +- .../wechat-developer/_test/alipay-bill.php | 21 +- .../wechat-developer/_test/alipay-notify.php | 8 +- .../wechat-developer/_test/alipay-pos.php | 8 +- .../wechat-developer/_test/alipay-refund.php | 10 +- .../wechat-developer/_test/alipay-scan.php | 8 +- .../_test/alipay-transfer-account.php | 8 +- .../_test/alipay-transfer-create.php | 8 +- .../_test/alipay-transfer-query.php | 8 +- .../_test/alipay-transfer.php | 14 +- .../wechat-developer/_test/alipay-wap.php | 12 +- .../wechat-developer/_test/alipay-web.php | 12 +- .../wechat-developer/_test/alipay.php | 54 +- .../_test/alipay/alipayPublicCert.crt | 38 + .../_test/alipay/alipayRootCert.crt | 88 + .../_test/alipay/appPublicCert.crt | 19 + .../wechat-developer/_test/alipay2.php | 58 + .../wechat-developer/_test/config.php | 8 +- .../wechat-developer/_test/mini-login.php | 14 + .../wechat-developer/_test/mini-qrc.php | 14 + .../_test/pay-download-bill.php | 8 +- .../_test/pay-order-close.php | 8 +- .../_test/pay-order-create.php | 50 +- .../_test/pay-order-notify.php | 8 +- .../_test/pay-order-query.php | 8 +- .../_test/pay-redpack-create.php | 8 +- .../_test/pay-refund-create.php | 10 +- .../_test/pay-refund-query.php | 8 +- .../_test/pay-transfers-create.php | 8 +- .../_test/pay-transfersbank-create.php | 8 +- .../_test/pay-v3-config-cert.php | 31 + .../wechat-developer/_test/pay-v3-config.php | 44 + .../_test/pay-v3-order-app.php | 64 + .../_test/pay-v3-order-h5.php | 50 + .../_test/pay-v3-order-jsapi.php | 89 + .../_test/pay-v3-order-native.php | 82 + .../_test/pay-v3-transfer.php | 48 + .../_test/wechat-jssdk-sign.php | 10 +- .../_test/wechat-menu-get.php | 8 +- .../_test/wechat-qrcode-create.php | 8 +- .../_test/wechat-user-get.php | 8 +- .../wechat-developer/_test/work-config.php | 20 + .../_test/work-department.php | 32 + .../zoujingli/wechat-developer/composer.json | 16 +- .../zoujingli/wechat-developer/include.php | 10 +- .../{MIT-LICENSE.txt => license} | 2 +- .../zoujingli/wechat-developer/readme.md | 155 +- 268 files changed, 5940 insertions(+), 12083 deletions(-) create mode 100644 upload/admin/config.php_ create mode 100644 upload/config.php_ delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitignore delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/.travis.yml delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/README.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.json delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.lock delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/phpmd.xml delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/Checkout/OrderTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Trade.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeWork.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Draft.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Freepublish.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/ErrorCode.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/PKCS7Encoder.php rename upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/{Contracts => Prpcrypt}/Prpcrypt.php (51%) create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Guide.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Live.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Operation.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Scheme.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Search.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Shipping.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Custom.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePay/ProfitSharing.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Cert.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/BasicWePay.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/DecryptAes.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Order.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/ProfitSharing.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Refund.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Transfers.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayPublicCert.crt create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayRootCert.crt create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/appPublicCert.crt create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay2.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config-cert.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-app.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-h5.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-jsapi.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-native.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-transfer.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-config.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-department.php rename upload/system/storage/vendor/zoujingli/wechat-developer/{MIT-LICENSE.txt => license} (95%) diff --git a/composer.json b/composer.json index a0144ffd48c..a57a2958cab 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "divido/divido-php": ">=1.15", "php": ">=7.3.0", "scssphp/scssphp": "^1.11.0", - "zoujingli/wechat-developer": "^1.2", + "zoujingli/wechat-developer": "^1.2.17", "twig/twig": "^3.3", "zoujingli/wechat-php-sdk": "^1.3" }, diff --git a/composer.lock b/composer.lock index 4baa6033079..165cbeb83ef 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8b08712ac7a072d54b442ade28489a21", + "content-hash": "93d8a1803bb5d48faec5b6453c14a5e9", "packages": [ { "name": "braintree/braintree_php", @@ -598,16 +598,16 @@ }, { "name": "scssphp/scssphp", - "version": "v1.11.0", + "version": "v1.12.1", "source": { "type": "git", "url": "https://github.com/scssphp/scssphp.git", - "reference": "33749d12c2569bb24071f94e9af828662dabb068" + "reference": "394ed1e960138710a60d035c1a85d43d0bf0faeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/33749d12c2569bb24071f94e9af828662dabb068", - "reference": "33749d12c2569bb24071f94e9af828662dabb068", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/394ed1e960138710a60d035c1a85d43d0bf0faeb", + "reference": "394ed1e960138710a60d035c1a85d43d0bf0faeb", "shasum": "" }, "require": { @@ -624,7 +624,7 @@ "thoughtbot/bourbon": "^7.0", "twbs/bootstrap": "~5.0", "twbs/bootstrap4": "4.6.1", - "zurb/foundation": "~6.5" + "zurb/foundation": "~6.7.0" }, "suggest": { "ext-iconv": "Can be used as fallback when ext-mbstring is not available", @@ -672,22 +672,22 @@ ], "support": { "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/v1.11.0" + "source": "https://github.com/scssphp/scssphp/tree/v1.12.1" }, - "time": "2022-09-02T21:24:55+00:00" + "time": "2024-01-13T12:36:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -701,9 +701,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -740,7 +737,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -756,20 +753,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", "shasum": "" }, "require": { @@ -782,9 +779,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -827,7 +821,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0" }, "funding": [ { @@ -843,20 +837,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -867,9 +861,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -911,7 +902,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -927,20 +918,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -954,9 +945,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -994,7 +982,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -1010,20 +998,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", "shasum": "" }, "require": { @@ -1031,9 +1019,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1070,7 +1055,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" }, "funding": [ { @@ -1086,20 +1071,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -1107,9 +1092,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1153,7 +1135,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -1169,7 +1151,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/translation-contracts", @@ -1357,26 +1339,27 @@ }, { "name": "twig/twig", - "version": "v3.6.1", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.22" }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" }, "type": "library", "autoload": { @@ -1412,7 +1395,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.1" + "source": "https://github.com/twigphp/Twig/tree/v3.8.0" }, "funding": [ { @@ -1424,29 +1407,31 @@ "type": "tidelift" } ], - "time": "2023-06-08T12:52:13+00:00" + "time": "2023-11-21T18:54:41+00:00" }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.17", + "version": "v1.2.54", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24" + "reference": "812aae37ffc5b6038b03163796f6eed97bb79730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/98f6e82311a364220a677cdfd56dc9f97851ab24", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/812aae37ffc5b6038b03163796f6eed97bb79730", + "reference": "812aae37ffc5b6038b03163796f6eed97bb79730", "shasum": "" }, "require": { + "ext-bcmath": "*", "ext-curl": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-openssl": "*", "ext-simplexml": "*", + "ext-xml": "*", "php": ">=5.4" }, "type": "library", @@ -1455,7 +1440,8 @@ "WePay\\": "WePay", "AliPay\\": "AliPay", "WeChat\\": "WeChat", - "WeMini\\": "WeMini" + "WeMini\\": "WeMini", + "WePayV3\\": "WePayV3" }, "classmap": [ "We.php" @@ -1469,24 +1455,23 @@ { "name": "Anyon", "email": "zoujingli@qq.com", - "homepage": "http://ctolog.com" + "homepage": "https://thinkadmin.top" } ], - "description": "WeChat platform and WeChat payment development tools", - "homepage": "https://github.com/zoujingli/WeChatDeveloper", + "description": "WeChat and Alipay Platform Development", + "homepage": "https://thinkadmin.top", "keywords": [ "WeChatDeveloper", "WeMini", "alipay", "wechat", - "wechatpay", - "wepay" + "wechatpay" ], "support": { "issues": "https://github.com/zoujingli/WeChatDeveloper/issues", - "source": "https://github.com/zoujingli/WeChatDeveloper/tree/master" + "source": "https://github.com/zoujingli/WeChatDeveloper/tree/v1.2.54" }, - "time": "2020-03-03T01:38:07+00:00" + "time": "2024-01-16T13:13:59+00:00" }, { "name": "zoujingli/wechat-php-sdk", diff --git a/upload/admin/config.php_ b/upload/admin/config.php_ new file mode 100644 index 00000000000..0d4e6fc12e7 --- /dev/null +++ b/upload/admin/config.php_ @@ -0,0 +1,36 @@ +language->get('text_zlib'); $data['text_zip'] = $this->language->get('text_zip'); $data['text_mbstring'] = $this->language->get('text_mbstring'); + $data['text_dom'] = $this->language->get('text_dom'); + $data['text_hash'] = $this->language->get('text_hash'); + $data['text_xmlwriter'] = $this->language->get('text_xmlwriter'); + $data['text_json'] = $this->language->get('text_json'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_back'] = $this->language->get('button_back'); @@ -145,6 +149,10 @@ public function index() { $data['zip'] = extension_loaded('zip'); $data['iconv'] = function_exists('iconv'); $data['mbstring'] = extension_loaded('mbstring'); + $data['dom'] = extension_loaded('dom'); + $data['hash'] = extension_loaded('hash'); + $data['xmlwriter'] = extension_loaded('xmlwriter'); + $data['json'] = extension_loaded('json'); $data['catalog_config'] = DIR_OPENCART . 'config.php'; $data['admin_config'] = DIR_OPENCART . 'admin/config.php'; @@ -213,6 +221,22 @@ private function validate() { $this->error['warning'] = $this->language->get('error_mbstring'); } + if (!extension_loaded('dom')) { + $this->error['warning'] = $this->language->get('error_dom'); + } + + if (!extension_loaded('hash')) { + $this->error['warning'] = $this->language->get('error_hash'); + } + + if (!extension_loaded('xmlwriter')) { + $this->error['warning'] = $this->language->get('error_xmlwriter'); + } + + if (!extension_loaded('json')) { + $this->error['warning'] = $this->language->get('error_json'); + } + if (!file_exists(DIR_OPENCART . 'config.php')) { $this->error['warning'] = $this->language->get('error_catalog_exist'); } elseif (!is_writable(DIR_OPENCART . 'config.php')) { diff --git a/upload/install/language/en-gb/install/step_2.php b/upload/install/language/en-gb/install/step_2.php index d54203450e2..5b605c5ce7f 100644 --- a/upload/install/language/en-gb/install/step_2.php +++ b/upload/install/language/en-gb/install/step_2.php @@ -29,6 +29,10 @@ $_['text_zlib'] = 'ZLIB'; $_['text_zip'] = 'ZIP'; $_['text_mbstring'] = 'mbstring'; +$_['text_dom'] = 'DOM/XML'; +$_['text_hash'] = 'Hash'; +$_['text_xmlwriter'] = 'XMLWriter'; +$_['text_json'] = 'JSON'; $_['text_on'] = 'On'; $_['text_off'] = 'Off'; $_['text_writable'] = 'Writable'; @@ -48,6 +52,10 @@ $_['error_zlib'] = 'Warning: ZLIB extension needs to be loaded for OpenCart to work!'; $_['error_zip'] = 'Warning: ZIP extension needs to be loaded for OpenCart to work!'; $_['error_mbstring'] = 'Warning: mbstring extension needs to be loaded for OpenCart to work!'; +$_['error_dom'] = 'Warning: ZIP extension needs to be loaded for OpenCart to work!'; +$_['error_hash'] = 'Warning: Hash extension needs to be loaded for OpenCart to work!'; +$_['error_xmlwriter'] = 'Warning: XMLWriter extension needs to be loaded for OpenCart to work!'; +$_['error_json'] = 'Warning: JSON extension needs to be loaded for OpenCart to work!'; $_['error_catalog_exist'] = 'Warning: config.php does not exist. You need to rename config-dist.php to config.php!'; $_['error_catalog_writable'] = 'Warning: config.php needs to be writable for OpenCart to be installed!'; $_['error_admin_exist'] = 'Warning: admin/config.php does not exist. You need to rename admin/config-dist.php to admin/config.php!'; diff --git a/upload/install/view/template/install/step_2.twig b/upload/install/view/template/install/step_2.twig index 1842a57bd8d..7a93677fa2f 100644 --- a/upload/install/view/template/install/step_2.twig +++ b/upload/install/view/template/install/step_2.twig @@ -213,6 +213,62 @@ {% endif %} {% endif %} + + {{ text_dom }} + {% if dom %} + {{ text_on }} + {% else %} + {{ text_off }} + {% endif %} + {{ text_on }} + {% if dom %} + + {% else %} + + {% endif %} + + + {{ text_hash }} + {% if hash %} + {{ text_on }} + {% else %} + {{ text_off }} + {% endif %} + {{ text_on }} + {% if hash %} + + {% else %} + + {% endif %} + + + {{ text_xmlwriter }} + {% if xmlwriter %} + {{ text_on }} + {% else %} + {{ text_off }} + {% endif %} + {{ text_on }} + {% if xmlwriter %} + + {% else %} + + {% endif %} + + + {{ text_json }} + {% if json %} + {{ text_on }} + {% else %} + {{ text_off }} + {% endif %} + {{ text_on }} + {% if json %} + + {% else %} + + {% endif %} + diff --git a/upload/system/storage/vendor/autoload.php b/upload/system/storage/vendor/autoload.php index 2531ad65808..14b8323add7 100644 --- a/upload/system/storage/vendor/autoload.php +++ b/upload/system/storage/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit505ae6f2a3616473de90938541c4614d::getLoader(); +return ComposerAutoloaderInit56198b4abead21620fa739b22c3bfd4e::getLoader(); diff --git a/upload/system/storage/vendor/composer/ClassLoader.php b/upload/system/storage/vendor/composer/ClassLoader.php index a72151c77c8..afef3fa2ad8 100644 --- a/upload/system/storage/vendor/composer/ClassLoader.php +++ b/upload/system/storage/vendor/composer/ClassLoader.php @@ -42,9 +42,6 @@ */ class ClassLoader { - /** @var \Closure(string):void */ - private static $includeFile; - /** @var ?string */ private $vendorDir; @@ -109,7 +106,6 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); } /** @@ -429,8 +425,7 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); + includeFile($file); return true; } @@ -560,26 +555,18 @@ private function findFileWithExtension($class, $ext) return false; } +} - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; } diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index 57b4f2fffe3..10ef66348d0 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -8,6 +8,7 @@ return array( 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'WePay\\' => array($vendorDir . '/zoujingli/wechat-developer/WePay'), + 'WePayV3\\' => array($vendorDir . '/zoujingli/wechat-developer/WePayV3'), 'WeMini\\' => array($vendorDir . '/zoujingli/wechat-developer/WeMini'), 'WeChat\\' => array($vendorDir . '/zoujingli/wechat-developer/WeChat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), diff --git a/upload/system/storage/vendor/composer/autoload_real.php b/upload/system/storage/vendor/composer/autoload_real.php index 011990e337e..646174a4a25 100644 --- a/upload/system/storage/vendor/composer/autoload_real.php +++ b/upload/system/storage/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit505ae6f2a3616473de90938541c4614d +class ComposerAutoloaderInit56198b4abead21620fa739b22c3bfd4e { private static $loader; @@ -24,27 +24,34 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit505ae6f2a3616473de90938541c4614d', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit56198b4abead21620fa739b22c3bfd4e', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit505ae6f2a3616473de90938541c4614d', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit56198b4abead21620fa739b22c3bfd4e', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit505ae6f2a3616473de90938541c4614d::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit505ae6f2a3616473de90938541c4614d::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); + $includeFiles = \Composer\Autoload\ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::$files; + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire56198b4abead21620fa739b22c3bfd4e($fileIdentifier, $file); } return $loader; } } + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire56198b4abead21620fa739b22c3bfd4e($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index 581e1873c6c..71ef1945175 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit505ae6f2a3616473de90938541c4614d +class ComposerStaticInit56198b4abead21620fa739b22c3bfd4e { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', @@ -24,6 +24,7 @@ class ComposerStaticInit505ae6f2a3616473de90938541c4614d array ( 'Wechat\\' => 7, 'WePay\\' => 6, + 'WePayV3\\' => 8, 'WeMini\\' => 7, 'WeChat\\' => 7, ), @@ -78,6 +79,10 @@ class ComposerStaticInit505ae6f2a3616473de90938541c4614d array ( 0 => __DIR__ . '/..' . '/zoujingli/wechat-developer/WePay', ), + 'WePayV3\\' => + array ( + 0 => __DIR__ . '/..' . '/zoujingli/wechat-developer/WePayV3', + ), 'WeMini\\' => array ( 0 => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini', @@ -195,10 +200,10 @@ class ComposerStaticInit505ae6f2a3616473de90938541c4614d public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit505ae6f2a3616473de90938541c4614d::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit505ae6f2a3616473de90938541c4614d::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit505ae6f2a3616473de90938541c4614d::$prefixesPsr0; - $loader->classMap = ComposerStaticInit505ae6f2a3616473de90938541c4614d::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::$prefixesPsr0; + $loader->classMap = ComposerStaticInit56198b4abead21620fa739b22c3bfd4e::$classMap; }, null, ClassLoader::class); } diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index e5f88eede0e..395f9debba0 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -619,17 +619,17 @@ }, { "name": "scssphp/scssphp", - "version": "v1.11.0", - "version_normalized": "1.11.0.0", + "version": "v1.12.1", + "version_normalized": "1.12.1.0", "source": { "type": "git", "url": "https://github.com/scssphp/scssphp.git", - "reference": "33749d12c2569bb24071f94e9af828662dabb068" + "reference": "394ed1e960138710a60d035c1a85d43d0bf0faeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/33749d12c2569bb24071f94e9af828662dabb068", - "reference": "33749d12c2569bb24071f94e9af828662dabb068", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/394ed1e960138710a60d035c1a85d43d0bf0faeb", + "reference": "394ed1e960138710a60d035c1a85d43d0bf0faeb", "shasum": "" }, "require": { @@ -646,13 +646,13 @@ "thoughtbot/bourbon": "^7.0", "twbs/bootstrap": "~5.0", "twbs/bootstrap4": "4.6.1", - "zurb/foundation": "~6.5" + "zurb/foundation": "~6.7.0" }, "suggest": { "ext-iconv": "Can be used as fallback when ext-mbstring is not available", "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv" }, - "time": "2022-09-02T21:24:55+00:00", + "time": "2024-01-13T12:36:40+00:00", "bin": [ "bin/pscss" ], @@ -696,23 +696,23 @@ ], "support": { "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/v1.11.0" + "source": "https://github.com/scssphp/scssphp/tree/v1.12.1" }, "install-path": "../scssphp/scssphp" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -724,12 +724,9 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -767,7 +764,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -787,17 +784,17 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", "shasum": "" }, "require": { @@ -808,12 +805,9 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -857,7 +851,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0" }, "funding": [ { @@ -877,17 +871,17 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -896,12 +890,9 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -944,7 +935,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -964,17 +955,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -986,12 +977,9 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1030,7 +1018,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -1050,28 +1038,25 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1109,7 +1094,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" }, "funding": [ { @@ -1129,28 +1114,25 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-01-29T20:11:03+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1195,7 +1177,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -1405,29 +1387,30 @@ }, { "name": "twig/twig", - "version": "v3.6.1", - "version_normalized": "3.6.1.0", + "version": "v3.8.0", + "version_normalized": "3.8.0.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.22" }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" }, - "time": "2023-06-08T12:52:13+00:00", + "time": "2023-11-21T18:54:41+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1463,7 +1446,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.1" + "source": "https://github.com/twigphp/Twig/tree/v3.8.0" }, "funding": [ { @@ -1479,29 +1462,31 @@ }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.17", - "version_normalized": "1.2.17.0", + "version": "v1.2.54", + "version_normalized": "1.2.54.0", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24" + "reference": "812aae37ffc5b6038b03163796f6eed97bb79730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/98f6e82311a364220a677cdfd56dc9f97851ab24", - "reference": "98f6e82311a364220a677cdfd56dc9f97851ab24", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/812aae37ffc5b6038b03163796f6eed97bb79730", + "reference": "812aae37ffc5b6038b03163796f6eed97bb79730", "shasum": "" }, "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": "2024-01-16T13:13:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1509,7 +1494,8 @@ "WePay\\": "WePay", "AliPay\\": "AliPay", "WeChat\\": "WeChat", - "WeMini\\": "WeMini" + "WeMini\\": "WeMini", + "WePayV3\\": "WePayV3" }, "classmap": [ "We.php" @@ -1523,22 +1509,21 @@ { "name": "Anyon", "email": "zoujingli@qq.com", - "homepage": "http://ctolog.com" + "homepage": "https://thinkadmin.top" } ], - "description": "WeChat platform and WeChat payment development tools", - "homepage": "https://github.com/zoujingli/WeChatDeveloper", + "description": "WeChat and Alipay Platform Development", + "homepage": "https://thinkadmin.top", "keywords": [ "WeChatDeveloper", "WeMini", "alipay", "wechat", - "wechatpay", - "wepay" + "wechatpay" ], "support": { "issues": "https://github.com/zoujingli/WeChatDeveloper/issues", - "source": "https://github.com/zoujingli/WeChatDeveloper/tree/master" + "source": "https://github.com/zoujingli/WeChatDeveloper/tree/v1.2.54" }, "install-path": "../zoujingli/wechat-developer" }, diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index b4117a829c9..64dbb47a519 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'opencart/opencart', 'pretty_version' => '3.0.x-dev', 'version' => '3.0.9999999.9999999-dev', - 'reference' => '1f21a971fa4f46d51bbff579a6839267c06a90ed', + 'reference' => '2dab8defa6e9f574813d8c82566add2575949d0f', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -76,7 +76,7 @@ 'opencart/opencart' => array( 'pretty_version' => '3.0.x-dev', 'version' => '3.0.9999999.9999999-dev', - 'reference' => '1f21a971fa4f46d51bbff579a6839267c06a90ed', + 'reference' => '2dab8defa6e9f574813d8c82566add2575949d0f', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -107,63 +107,63 @@ 'dev_requirement' => false, ), 'scssphp/scssphp' => array( - 'pretty_version' => 'v1.11.0', - 'version' => '1.11.0.0', - 'reference' => '33749d12c2569bb24071f94e9af828662dabb068', + 'pretty_version' => 'v1.12.1', + 'version' => '1.12.1.0', + 'reference' => '394ed1e960138710a60d035c1a85d43d0bf0faeb', 'type' => 'library', 'install_path' => __DIR__ . '/../scssphp/scssphp', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => 'ef4d7e442ca910c4764bce785146269b30cb5fc4', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '639084e360537a19f9ee352433b84ce831f3d2da', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => 'a287ed7475f85bf6f61890146edbc932c0fff919', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => 'bc45c394692b948b4d383a08d7753968bed9a83d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '869329b1e9894268a8a61dabb69153029b7a8c97', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => '861391a8da9a04cbad2d232ddd9e4893220d6e25', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), @@ -188,18 +188,18 @@ 'dev_requirement' => false, ), 'twig/twig' => array( - 'pretty_version' => 'v3.6.1', - 'version' => '3.6.1.0', - 'reference' => '7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd', + 'pretty_version' => 'v3.8.0', + 'version' => '3.8.0.0', + 'reference' => '9d15f0ac07f44dc4217883ec6ae02fd555c6f71d', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/twig', 'aliases' => array(), 'dev_requirement' => false, ), 'zoujingli/wechat-developer' => array( - 'pretty_version' => 'v1.2.17', - 'version' => '1.2.17.0', - 'reference' => '98f6e82311a364220a677cdfd56dc9f97851ab24', + 'pretty_version' => 'v1.2.54', + 'version' => '1.2.54.0', + 'reference' => '812aae37ffc5b6038b03163796f6eed97bb79730', 'type' => 'library', 'install_path' => __DIR__ . '/../zoujingli/wechat-developer', 'aliases' => array(), diff --git a/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml b/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml deleted file mode 100644 index 09bbb257dc7..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml +++ /dev/null @@ -1,3 +0,0 @@ -src_dir: src -coverage_clover: build/logs/clover.xml -json_path: build/logs/coveralls-upload.json diff --git a/upload/system/storage/vendor/klarna/kco_rest/.gitignore b/upload/system/storage/vendor/klarna/kco_rest/.gitignore deleted file mode 100644 index b5294333576..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/ -/build/ -/docs/reference diff --git a/upload/system/storage/vendor/klarna/kco_rest/.travis.yml b/upload/system/storage/vendor/klarna/kco_rest/.travis.yml deleted file mode 100644 index 5932d306bd6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php -php: - - 7.0 - - 5.6 - - 5.5 - - 5.4 - - hhvm - -matrix: - allow_failures: - - php: 7.0 - -branches: - only: - - /^v\d\.\d/ -cache: - directories: - - vendor - -before_script: - - composer install --no-interaction - -script: - - composer run test - -after_script: - - php vendor/bin/coveralls -v - -sudo: false diff --git a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md deleted file mode 100644 index 42ca1f21c7e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -## v2.2.0 - 2015-12-7 -- **NEW META-13** Allow for 201 response on refund - *Joakim.L* - -## v2.1.0 - 2015-07-29 -- **NEW MINT-2262** Support Guzzle 5.x versions - *Omer.K, Joakim.L* - -## v2.0.0 - 2015-06-10 -- **NEW MINT-2203** Use order id instead of URL for checkout orders - *Joakim.L* -- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* - -## v1.0.1 - 2015-03-30 -- **FIX MINT-2002** Handle errors with an empty payload - *David.K* -- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* - -## v1.0.0 - 2014-10-16 -- **NEW MINT-1804** Support checkout v3 and ordermanagement v1 APIs - *Joakim.L* - diff --git a/upload/system/storage/vendor/klarna/kco_rest/README.md b/upload/system/storage/vendor/klarna/kco_rest/README.md deleted file mode 100644 index 537f4c98a70..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Klarna Checkout REST PHP SDK -[![Packagist Version][packagist-image]](https://packagist.org/packages/klarna/kco_rest) -[![Build Status][travis-image]](https://travis-ci.org/klarna/kco_rest_php) -[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v2.2) - -Klarna Checkout is a revolutionary new payment solution that is changing the way -people shop online. First, consumers verify their purchase with a minimal -amount of information through intelligent identification, securing your order -immediately, and then complete their payment afterwards – separating buying -from paying and dramatically increasing conversion. Klarna Checkout also allows -merchants to offer all payment methods through one supplier, minimizing -administration, costs and integration time. - - -## Get started - -### Prerequisites -* PHP 5.4 or above -* API credentials - - -### Usage -Example files can be found in the [docs/](docs/) directory. - - -## Documentation -Additional documentation can be found at https://developers.klarna.com. - - -## Questions and feedback -If you have any questions concerning this product or the implementation, -please contact [integration@klarna.com](mailto:integration@klarna.com). - - -## How to contribute -At Klarna, we strive toward achieving the highest possible quality for our -products. Therefore, we require you to follow these guidelines if you wish -to contribute. - -To contribute, the following criteria needs to be fulfilled: - -* Description regarding what has been changed and why -* Pull requests should implement a boxed change -* All code and documentation must follow the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) -* New features and bug fixes must have accompanying unit tests: - * Positive tests - * Negative tests - * Boundary tests (if possible) - * No less than 90% decision coverage -* All tests should pass - - -## Acknowledgements -* Christer Gustavsson ([@ChristerGustavsson](https://github.com/ChristerGustavsson)) -* David Keijser ([@keis](https://github.com/keis)) -* Joakim Löfgren ([@JoakimLofgren](https://github.com/JoakimLofgren)) -* Majid Garmaroudi ([@dijam](https://github.com/dijam)) -* Omer Karadagli ([@ockcyp](https://github.com/ockcyp)) - - -## License -Klarna Checkout REST PHP SDK is licensed under -[Apache License, Version 2.0](http://www.apache.org/LICENSE-2.0) - -[packagist-image]: https://img.shields.io/packagist/v/klarna/kco_rest.svg?style=flat -[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v2.2.svg?style=flat -[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v2.2.svg?style=flat diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.json b/upload/system/storage/vendor/klarna/kco_rest/composer.json deleted file mode 100644 index d34e36bfbf6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "klarna/kco_rest", - "description": "Klarna Checkout PHP SDK", - "homepage": "http://developers.klarna.com", - "license": "Apache-2.0", - "type": "library", - "authors": [ - { - "name": "Klarna AB", - "email": "integration@klarna.com" - } - ], - "autoload": { - "psr-4": { - "": "src/" - } - }, - "minimum-stability": "stable", - "require": { - "php": ">=5.4.0", - "guzzlehttp/guzzle": ">=4.2,<6.0" - }, - "require-dev": { - "phpunit/phpunit": "4.2.*", - "squizlabs/php_codesniffer": "1.5.*", - "phpmd/phpmd": "2.1.*", - "phploc/phploc": "2.0.*", - "sebastian/phpcpd": "2.0.*", - "satooshi/php-coveralls": "0.6.*", - "apigen/apigen": "4.0.*", - "klarna/apigen-theme": "~1.0" - }, - "scripts": { - "test": "vendor/bin/phpunit --colors", - "reference": "vendor/bin/apigen generate -s src -d docs/reference --template-config='vendor/klarna/apigen-theme/src/config.neon'", - "analyze": [ - "mkdir -p build/logs", - "vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/", - "mkdir -p build/pdepend", - "vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src/", - "vendor/bin/phpmd src/,tests/ xml phpmd.xml --reportfile build/logs/pmd.xml || true", - "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/", - "vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml src/ tests/ || true" - ] - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.lock b/upload/system/storage/vendor/klarna/kco_rest/composer.lock deleted file mode 100644 index f6bb9a8b5ae..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/composer.lock +++ /dev/null @@ -1,3569 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "faa4d6f172d4f9991cf2583e57f9b43c", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-05-20 03:47:55" - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", - "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "time": "2015-05-20 03:37:09" - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "time": "2014-10-12 19:18:40" - }, - { - "name": "react/promise", - "version": "v2.2.1", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/3b6fca09c7d56321057fa8867c8dbe1abf648627", - "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "time": "2015-07-03 13:48:55" - } - ], - "packages-dev": [ - { - "name": "andrewsville/php-token-reflection", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/Andrewsville/PHP-Token-Reflection.git", - "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Andrewsville/PHP-Token-Reflection/zipball/e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", - "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "TokenReflection": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3" - ], - "authors": [ - { - "name": "Ondřej Nešpor", - "homepage": "https://github.com/andrewsville" - }, - { - "name": "Jaroslav Hanslík", - "homepage": "https://github.com/kukulich" - } - ], - "description": "Library emulating the PHP internal reflection using just the tokenized source code.", - "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/", - "keywords": [ - "library", - "reflection", - "tokenizer" - ], - "time": "2014-08-06 16:37:08" - }, - { - "name": "apigen/apigen", - "version": "v4.0.1", - "source": { - "type": "git", - "url": "https://github.com/ApiGen/ApiGen.git", - "reference": "b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ApiGen/ApiGen/zipball/b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1", - "reference": "b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1", - "shasum": "" - }, - "require": { - "andrewsville/php-token-reflection": "~1.4", - "herrera-io/phar-update": "~2.0", - "kdyby/events": "~2.0", - "kukulich/fshl": "~2.1", - "latte/latte": "~2.2", - "michelf/php-markdown": "~1.4", - "nette/application": "~2.2", - "nette/bootstrap": "~2.2", - "nette/di": "~2.2", - "nette/mail": "~2.2", - "nette/neon": "~2.2", - "nette/robot-loader": "~2.2", - "nette/safe-stream": "~2.2", - "php": ">=5.4", - "symfony/console": "~2.6", - "symfony/options-resolver": "~2.6.1", - "tracy/tracy": "~2.2" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "~0.8", - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.4", - "zenify/coding-standard": "~3.0" - }, - "bin": [ - "bin/apigen" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.0-dev" - } - }, - "autoload": { - "psr-4": { - "ApiGen\\": "src/ApiGen" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Ondřej Nešpor", - "homepage": "https://github.com/andrewsville" - }, - { - "name": "Jaroslav Hanslík", - "homepage": "https://github.com/kukulich" - }, - { - "name": "Tomáš Votruba", - "email": "tomas.vot@gmail.com" - }, - { - "name": "Olivier Laviale", - "homepage": "https://github.com/olvlvl" - } - ], - "description": "PHP source code API generator", - "homepage": "http://apigen.org/", - "keywords": [ - "api", - "documentation", - "generator", - "phpdoc" - ], - "time": "2015-03-09 11:03:45" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "guzzle/guzzle", - "version": "v3.9.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-03-18 18:23:50" - }, - { - "name": "herrera-io/json", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/kherge-abandoned/php-json.git", - "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-abandoned/php-json/zipball/60c696c9370a1e5136816ca557c17f82a6fa83f1", - "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1", - "shasum": "" - }, - "require": { - "ext-json": "*", - "justinrainbow/json-schema": ">=1.0,<2.0-dev", - "php": ">=5.3.3", - "seld/jsonlint": ">=1.0,<2.0-dev" - }, - "require-dev": { - "herrera-io/phpunit-test-case": "1.*", - "mikey179/vfsstream": "1.1.0", - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/lib/json_version.php" - ], - "psr-0": { - "Herrera\\Json": "src/lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io" - } - ], - "description": "A library for simplifying JSON linting and validation.", - "homepage": "http://herrera-io.github.com/php-json", - "keywords": [ - "json", - "lint", - "schema", - "validate" - ], - "time": "2013-10-30 16:51:34" - }, - { - "name": "herrera-io/phar-update", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/kherge-abandoned/php-phar-update.git", - "reference": "15643c90d3d43620a4f45c910e6afb7a0ad4b488" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-abandoned/php-phar-update/zipball/15643c90d3d43620a4f45c910e6afb7a0ad4b488", - "reference": "15643c90d3d43620a4f45c910e6afb7a0ad4b488", - "shasum": "" - }, - "require": { - "herrera-io/json": "1.*", - "herrera-io/version": "1.*", - "php": ">=5.3.3" - }, - "require-dev": { - "herrera-io/phpunit-test-case": "1.*", - "mikey179/vfsstream": "1.1.0", - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "files": [ - "src/lib/constants.php" - ], - "psr-0": { - "Herrera\\Phar\\Update": "src/lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io" - } - ], - "description": "A library for self-updating Phars.", - "homepage": "http://herrera-io.github.com/php-phar-update", - "keywords": [ - "phar", - "update" - ], - "time": "2013-11-09 17:13:13" - }, - { - "name": "herrera-io/version", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/kherge-abandoned/php-version.git", - "reference": "d39d9642b92a04d8b8a28b871b797a35a2545e85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-abandoned/php-version/zipball/d39d9642b92a04d8b8a28b871b797a35a2545e85", - "reference": "d39d9642b92a04d8b8a28b871b797a35a2545e85", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "herrera-io/phpunit-test-case": "1.*", - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Herrera\\Version": "src/lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io" - } - ], - "description": "A library for creating, editing, and comparing semantic versioning numbers.", - "homepage": "http://github.com/herrera-io/php-version", - "keywords": [ - "semantic", - "version" - ], - "time": "2014-05-27 05:29:25" - }, - { - "name": "justinrainbow/json-schema", - "version": "1.4.4", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", - "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "json-schema/json-schema-test-suite": "1.1.0", - "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "~3.7" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "JsonSchema": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2015-07-14 16:29:50" - }, - { - "name": "kdyby/events", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/Events.git", - "reference": "8049e0fc7abb48178b4a2a9af230eceebe1a83bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/Events/zipball/8049e0fc7abb48178b4a2a9af230eceebe1a83bc", - "reference": "8049e0fc7abb48178b4a2a9af230eceebe1a83bc", - "shasum": "" - }, - "require": { - "nette/di": "~2.3@dev", - "nette/utils": "~2.3@dev" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "~0.7", - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/nette": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.4@rc", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "symfony/event-dispatcher": "~2.5", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\Events\\": "src/" - }, - "classmap": [ - "src/Kdyby/Events/exceptions.php" - ], - "files": [ - "src/Doctrine/compatibility.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - } - ], - "description": "Events for Nette Framework", - "homepage": "http://kdyby.org", - "keywords": [ - "kdyby", - "nette" - ], - "time": "2015-04-04 16:29:31" - }, - { - "name": "klarna/apigen-theme", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/klarna/klarna-apigen-theme.git", - "reference": "1ffcd0e4ea5620d50dbfb74639e4aa4113924911" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klarna/klarna-apigen-theme/zipball/1ffcd0e4ea5620d50dbfb74639e4aa4113924911", - "reference": "1ffcd0e4ea5620d50dbfb74639e4aa4113924911", - "shasum": "" - }, - "require": { - "latte/latte": "~2.2" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tomáš Votruba", - "email": "tomas.vot@gmail.com" - }, - { - "name": "Olivier Laviale", - "homepage": "https://github.com/olvlvl" - }, - { - "name": "David Keijser", - "email": "david.keijser@klarna.com" - }, - { - "name": "Petros Gkourasas", - "email": "petros.gkourasas@klarna.com" - } - ], - "description": "Klarna theme for ApiGen", - "homepage": "http://klarna.com/", - "time": "2015-03-30 15:27:12" - }, - { - "name": "kukulich/fshl", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/kukulich/fshl.git", - "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kukulich/fshl/zipball/974c294ade5d76c0c16b6fe3fd3a584ba999b24f", - "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "autoload": { - "psr-0": { - "FSHL": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Jaroslav Hanslík", - "homepage": "https://github.com/kukulich" - } - ], - "description": "FSHL is a free, open source, universal, fast syntax highlighter written in PHP.", - "homepage": "http://fshl.kukulich.cz/", - "keywords": [ - "highlight", - "library", - "syntax" - ], - "time": "2012-09-08 19:00:07" - }, - { - "name": "latte/latte", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/latte.git", - "reference": "025883a04b3a5ca48995246e8d82e6ff323d941e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/latte/zipball/025883a04b3a5ca48995246e8d82e6ff323d941e", - "reference": "025883a04b3a5ca48995246e8d82e6ff323d941e", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to use filter |datastream", - "ext-mbstring": "to use filters like lower, upper, capitalize, ..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Latte: the amazing template engine for PHP", - "homepage": "http://latte.nette.org", - "keywords": [ - "templating", - "twig" - ], - "time": "2015-07-03 13:37:59" - }, - { - "name": "michelf/php-markdown", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-lib": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Michelf": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "John Gruber", - "homepage": "http://daringfireball.net/" - }, - { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", - "role": "Developer" - } - ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ], - "time": "2015-03-01 12:03:08" - }, - { - "name": "nette/application", - "version": "v2.3.4", - "source": { - "type": "git", - "url": "https://github.com/nette/application.git", - "reference": "785801e441ef83fa4d75cc47c292afedee9b3e4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/application/zipball/785801e441ef83fa4d75cc47c292afedee9b3e4e", - "reference": "785801e441ef83fa4d75cc47c292afedee9b3e4e", - "shasum": "" - }, - "require": { - "nette/component-model": "~2.2", - "nette/http": "~2.2", - "nette/reflection": "~2.2", - "nette/security": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.0", - "nette/di": "~2.3", - "nette/forms": "~2.2", - "nette/robot-loader": "~2.2", - "nette/tester": "~1.3" - }, - "suggest": { - "latte/latte": "Allows using Latte in templates", - "nette/forms": "Allows to use Nette\\Application\\UI\\Form" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Application MVC Component", - "homepage": "http://nette.org", - "time": "2015-07-01 15:54:47" - }, - { - "name": "nette/bootstrap", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "shasum": "" - }, - "require": { - "nette/di": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.3", - "nette/mail": "~2.3", - "nette/robot-loader": "~2.2", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~1.3", - "tracy/tracy": "~2.3" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableDebugger()" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Bootstrap", - "homepage": "http://nette.org", - "time": "2015-07-11 21:07:11" - }, - { - "name": "nette/caching", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/nette/caching.git", - "reference": "1523a0d2596193dd792045a07e89795eeef435db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/caching/zipball/1523a0d2596193dd792045a07e89795eeef435db", - "reference": "1523a0d2596193dd792045a07e89795eeef435db", - "shasum": "" - }, - "require": { - "nette/finder": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.4.4" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.4", - "nette/di": "~2.3", - "nette/tester": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Caching Component", - "homepage": "http://nette.org", - "time": "2015-06-15 16:32:59" - }, - { - "name": "nette/component-model", - "version": "v2.2.3", - "source": { - "type": "git", - "url": "https://github.com/nette/component-model.git", - "reference": "fe13e630a307ef4585b3573eae0a161dc1c3d428" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/component-model/zipball/fe13e630a307ef4585b3573eae0a161dc1c3d428", - "reference": "fe13e630a307ef4585b3573eae0a161dc1c3d428", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Component Model", - "homepage": "http://nette.org", - "time": "2015-07-11 21:11:20" - }, - { - "name": "nette/di", - "version": "v2.3.5", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "c3e726f8bef49033ba78efe19e999e5fac63f433" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/c3e726f8bef49033ba78efe19e999e5fac63f433", - "reference": "c3e726f8bef49033ba78efe19e999e5fac63f433", - "shasum": "" - }, - "require": { - "nette/neon": "~2.3", - "nette/php-generator": "~2.3", - "nette/utils": "~2.3", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Dependency Injection Component", - "homepage": "http://nette.org", - "time": "2015-07-13 22:28:49" - }, - { - "name": "nette/finder", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/38f803a03f4cddf352e28af70294c71f7026e516", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Finder: Files Searching", - "homepage": "http://nette.org", - "time": "2015-07-11 21:13:50" - }, - { - "name": "nette/http", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/http.git", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/http/zipball/ff2e4608391bca2444df9af6eaf8666ac853eb02", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2, >=2.2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "suggest": { - "ext-fileinfo": "to detect type of uploaded files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette HTTP Component", - "homepage": "http://nette.org", - "time": "2015-07-19 16:17:50" - }, - { - "name": "nette/mail", - "version": "v2.3.2", - "source": { - "type": "git", - "url": "https://github.com/nette/mail.git", - "reference": "2c6c64787edf8131ec5e1b514ecc4a80a6477f80" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/mail/zipball/2c6c64787edf8131ec5e1b514ecc4a80a6477f80", - "reference": "2c6c64787edf8131ec5e1b514ecc4a80a6477f80", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to detect type of attached files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Mail: Sending E-mails", - "homepage": "http://nette.org", - "time": "2015-07-03 13:31:38" - }, - { - "name": "nette/neon", - "version": "v2.3.2", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "48b25e0962d70e9125797e67a144f3e057243d9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/48b25e0962d70e9125797e67a144f3e057243d9d", - "reference": "48b25e0962d70e9125797e67a144f3e057243d9d", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette NEON: parser & generator for Nette Object Notation", - "homepage": "http://ne-on.org", - "time": "2015-07-13 22:29:08" - }, - { - "name": "nette/php-generator", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "c47ad59b972e8a5f4bb00299951bd8053a8fc074" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/c47ad59b972e8a5f4bb00299951bd8053a8fc074", - "reference": "c47ad59b972e8a5f4bb00299951bd8053a8fc074", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette PHP Generator", - "homepage": "http://nette.org", - "time": "2015-07-11 21:19:33" - }, - { - "name": "nette/reflection", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/reflection.git", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/reflection/zipball/9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/caching": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette PHP Reflection Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:34:53" - }, - { - "name": "nette/robot-loader", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/69331d359bbc9e5f911c12b82187cac914d983fb", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb", - "shasum": "" - }, - "require": { - "nette/caching": "~2.2", - "nette/finder": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette RobotLoader: comfortable autoloading", - "homepage": "http://nette.org", - "time": "2015-07-11 21:20:57" - }, - { - "name": "nette/safe-stream", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/safe-stream.git", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/safe-stream/zipball/bf30db367b51a0932c44dcb9a378927644d48b2e", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "files": [ - "src/loader.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette SafeStream: Atomic Operations", - "homepage": "http://nette.org", - "time": "2015-07-11 20:59:15" - }, - { - "name": "nette/security", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/security.git", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/security/zipball/744264a42b506d63009d7e3853ed72b04c99e964", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/http": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Security: Access Control Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:22:53" - }, - { - "name": "nette/utils", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb", - "reference": "ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", - "ext-mbstring": "to use Strings::lower() etc..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Utility Classes", - "homepage": "http://nette.org", - "time": "2015-07-13 22:30:00" - }, - { - "name": "pdepend/pdepend", - "version": "2.0.6", - "source": { - "type": "git", - "url": "https://github.com/pdepend/pdepend.git", - "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", - "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", - "shasum": "" - }, - "require": { - "symfony/config": ">=2.4", - "symfony/dependency-injection": ">=2.4", - "symfony/filesystem": ">=2.4" - }, - "require-dev": { - "phpunit/phpunit": "4.*@stable", - "squizlabs/php_codesniffer": "@stable" - }, - "bin": [ - "src/bin/pdepend" - ], - "type": "library", - "autoload": { - "psr-0": { - "PDepend\\": "src/main/php/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Official version of pdepend to be handled with Composer", - "time": "2015-03-02 08:06:43" - }, - { - "name": "phploc/phploc", - "version": "2.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "322ad07c112d5c6832abed4269d648cacff5959b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/322ad07c112d5c6832abed4269d648cacff5959b", - "reference": "322ad07c112d5c6832abed4269d648cacff5959b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/finder-facade": "~1.1", - "sebastian/git": "~1.0", - "sebastian/version": "~1.0", - "symfony/console": "~2.2" - }, - "bin": [ - "phploc" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "A tool for quickly measuring the size of a PHP project.", - "homepage": "https://github.com/sebastianbergmann/phploc", - "time": "2014-06-25 08:11:02" - }, - { - "name": "phpmd/phpmd", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/phpmd/phpmd.git", - "reference": "1a485d9db869137af5e9678bd844568c92998b25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/1a485d9db869137af5e9678bd844568c92998b25", - "reference": "1a485d9db869137af5e9678bd844568c92998b25", - "shasum": "" - }, - "require": { - "pdepend/pdepend": "2.0.*", - "php": ">=5.3.0", - "symfony/config": "2.5.*", - "symfony/dependency-injection": "2.5.*", - "symfony/filesystem": "2.5.*" - }, - "bin": [ - "src/bin/phpmd" - ], - "type": "library", - "autoload": { - "psr-0": { - "PHPMD\\": "src/main/php" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Official version of PHPMD handled with Composer.", - "time": "2014-09-25 15:56:22" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.1.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5bd48b86cd282da411bb80baac1398ce3fefac41", - "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-07-26 12:54:47" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.3.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "File/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2013-10-10 15:34:57" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-06-19 03:43:16" - }, - { - "name": "phpunit/phpunit", - "version": "4.2.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c28a790620fe30b049bb693be1ef9cd4e0fe906c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c28a790620fe30b049bb693be1ef9cd4e0fe906c", - "reference": "c28a790620fe30b049bb693be1ef9cd4e0fe906c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": "~2.2", - "sebastian/comparator": "~1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2014-09-14 09:31:24" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", - "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-07-10 06:54:24" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2013-05-04 08:07:33" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/environment", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", - "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-07-26 06:42:57" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/finder-facade", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/a520dcc3dd39160eea480daa3426f4fd419a327b", - "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b", - "shasum": "" - }, - "require": { - "symfony/finder": "~2.3", - "theseer/fdomdocument": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", - "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2015-06-04 08:11:58" - }, - { - "name": "sebastian/git", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/git.git", - "reference": "a99fbc102e982c1404041ef3e4d431562b29bcba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/a99fbc102e982c1404041ef3e4d431562b29bcba", - "reference": "a99fbc102e982c1404041ef3e4d431562b29bcba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple wrapper for Git", - "homepage": "http://www.github.com/sebastianbergmann/git", - "keywords": [ - "git" - ], - "time": "2013-08-04 09:35:29" - }, - { - "name": "sebastian/phpcpd", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpcpd.git", - "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d3ad100fdf15805495f6ff19f473f4314c99390c", - "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-timer": "~1.0", - "sebastian/finder-facade": "~1.1", - "sebastian/version": "~1.0", - "symfony/console": "~2.2", - "theseer/fdomdocument": "~1.4" - }, - "bin": [ - "phpcpd" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Copy/Paste Detector (CPD) for PHP code.", - "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2015-03-26 14:47:38" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" - }, - { - "name": "seld/jsonlint", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", - "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "time": "2015-01-04 21:18:15" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "1.5.6", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.1.2" - }, - "suggest": { - "phpunit/php-timer": "dev-master" - }, - "bin": [ - "scripts/phpcs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-phpcs-fixer": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/CommentParser/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2014-12-04 22:32:15" - }, - { - "name": "symfony/config", - "version": "v2.5.12", - "target-dir": "Symfony/Component/Config", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/c7309e33b719433d5cf3845d0b5b9608609d8c8e", - "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/filesystem": "~2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Config Component", - "homepage": "http://symfony.com", - "time": "2015-01-03 08:01:13" - }, - { - "name": "symfony/console", - "version": "v2.7.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed", - "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.5.12", - "target-dir": "Symfony/Component/DependencyInjection", - "source": { - "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/c42aee05b466cc9c66b87ddf7d263402befb6962", - "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.4,>=2.4.10", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\DependencyInjection\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "http://symfony.com", - "time": "2015-01-25 04:37:39" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-06-18 19:21:56" - }, - { - "name": "symfony/filesystem", - "version": "v2.5.12", - "target-dir": "Symfony/Component/Filesystem", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/d3c24d7d6e9c342008d8421b2fade460311647ea", - "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "http://symfony.com", - "time": "2015-01-03 21:04:44" - }, - { - "name": "symfony/finder", - "version": "v2.7.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" - }, - { - "name": "symfony/options-resolver", - "version": "v2.6.11", - "target-dir": "Symfony/Component/OptionsResolver", - "source": { - "type": "git", - "url": "https://github.com/symfony/OptionsResolver.git", - "reference": "31e56594cee489e9a235b852228b0598b52101c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/OptionsResolver/zipball/31e56594cee489e9a235b852228b0598b52101c1", - "reference": "31e56594cee489e9a235b852228b0598b52101c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\OptionsResolver\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "time": "2015-05-13 11:33:56" - }, - { - "name": "symfony/stopwatch", - "version": "v2.7.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "b07a866719bbac5294c67773340f97b871733310" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b07a866719bbac5294c67773340f97b871733310", - "reference": "b07a866719bbac5294c67773340f97b871733310", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 18:23:16" - }, - { - "name": "symfony/yaml", - "version": "v2.7.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", - "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 11:25:50" - }, - { - "name": "theseer/fdomdocument", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", - "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "lib-libxml": "*", - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "lead" - } - ], - "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", - "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2015-05-27 22:58:02" - }, - { - "name": "tracy/tracy", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/tracy.git", - "reference": "17d15b8dc83cab3bc5022a45d32c681a76cc19e1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/tracy/zipball/17d15b8dc83cab3bc5022a45d32c681a76cc19e1", - "reference": "17d15b8dc83cab3bc5022a45d32c681a76cc19e1", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ], - "files": [ - "src/shortcuts.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Tracy: useful PHP debugger", - "homepage": "http://tracy.nette.org", - "keywords": [ - "debug", - "debugger", - "nette" - ], - "time": "2015-07-03 12:52:35" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.4.0" - }, - "platform-dev": [] -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php deleted file mode 100644 index 5bbdc2c6960..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php +++ /dev/null @@ -1,34 +0,0 @@ -fetchCapture($captureId); -$capture->addShippingInfo([ - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php deleted file mode 100644 index 968d187bb88..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php +++ /dev/null @@ -1,22 +0,0 @@ -fetchCapture($captureId); -$capture->triggerSendout(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php deleted file mode 100644 index 6cfe3348baf..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php +++ /dev/null @@ -1,27 +0,0 @@ -fetchCapture($captureId); -$capture->updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php deleted file mode 100644 index f34b171ca83..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php +++ /dev/null @@ -1,60 +0,0 @@ -create([ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "http://www.merchant.com/toc", - "checkout" => "http://www.merchant.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "http://www.merchant.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "http://www.merchant.com/create_order?klarna_order_id={checkout.order.id}" - ] -]); - -$checkout->fetch(); - -// Store checkout order id -$orderId = $checkout->getId(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php deleted file mode 100644 index 02997424058..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php +++ /dev/null @@ -1,79 +0,0 @@ - [ - [ - "unique_account_identifier" => "Test Testperson", - "payment_option" => "card", - "number_paid_purchases" => 1, - "total_amount_paid_purchases" => 10000, - "date_of_last_paid_purchase" => (new DateTime())->format(EMD_FORMAT), - "date_of_first_paid_purchase" => (new DateTime())->format(EMD_FORMAT) - ] - ] -]; - -$checkout = new Klarna\Rest\Checkout\Order($connector); -$checkout->create([ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "http://www.merchant.com/toc", - "checkout" => "http://www.merchant.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "http://www.merchant.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "http://www.merchant.com/create_order?klarna_order_id={checkout.order.id}" - ], - "attachment" => [ - "content_type" => "application/vnd.klarna.internal.emd-v2+json", - "body" => json_encode($emd) - ] -]); - -$checkout->fetch(); - -// Store checkout order id -$orderId = $checkout->getId(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php deleted file mode 100644 index 8e1df96cced..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php +++ /dev/null @@ -1,19 +0,0 @@ -fetch(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php deleted file mode 100644 index 6d42d595d2e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php +++ /dev/null @@ -1,56 +0,0 @@ -update([ - "order_amount" => 11000, - "order_tax_amount" => 2200, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ], - [ - "type" => "shipping_fee", - "name" => "Express delivery", - "quantity" => 1, - "unit_price" => 1000, - "tax_rate" => 2500, - "total_amount" => 1000, - "total_tax_amount" => 200 - ] - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php deleted file mode 100644 index 359f628efce..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php +++ /dev/null @@ -1,22 +0,0 @@ -acknowledge(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php deleted file mode 100644 index ebd49eb4c04..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php +++ /dev/null @@ -1,21 +0,0 @@ -cancel(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php deleted file mode 100644 index 88f06f79abb..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php +++ /dev/null @@ -1,49 +0,0 @@ -createCapture([ - "captured_amount" => 6000, - "description" => "Shipped part of the order", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ], - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php deleted file mode 100644 index 745d1beffb3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php +++ /dev/null @@ -1,19 +0,0 @@ -extendAuthorizationTime(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php deleted file mode 100644 index e0d0053826f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php +++ /dev/null @@ -1,21 +0,0 @@ -fetchCapture($captureId); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php deleted file mode 100644 index e333dacdcf1..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php +++ /dev/null @@ -1,19 +0,0 @@ -fetch(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php deleted file mode 100644 index aafb52f711d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php +++ /dev/null @@ -1,37 +0,0 @@ -refund([ - "refunded_amount" => 3000, - "description" => "Refunding half the tomatoes", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 5, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 3000, - "total_tax_amount" => 600 - ] - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php deleted file mode 100644 index fc51926d715..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php +++ /dev/null @@ -1,21 +0,0 @@ -releaseRemainingAuthorization(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php deleted file mode 100644 index aa29e179501..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php +++ /dev/null @@ -1,30 +0,0 @@ -updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ], - "shipping_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php deleted file mode 100644 index 5cd3bc395ef..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php +++ /dev/null @@ -1,25 +0,0 @@ -updateMerchantReferences([ - "merchant_reference1" => "15632423", - "merchant_reference2" => "special order" -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php deleted file mode 100644 index b90ef1154ff..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php +++ /dev/null @@ -1,37 +0,0 @@ -updateAuthorization([ - "order_amount" => 6000, - "description" => "Removed bad bananas", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ] -]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md deleted file mode 100644 index cb38f17063c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md +++ /dev/null @@ -1,14 +0,0 @@ -install -------- - - git remote add -f hooks ssh://git@stash.internal.machines:7999/mint/git-hooks.git - git merge -s ours --no-commit hooks/master - git read-tree --prefix=git_hooks -u hooks/master - git commit -m "imported git hooks" - - -updating --------- - - git fetch hooks - git merge -s subtree hooks/master diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint deleted file mode 100644 index e3084704324..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint +++ /dev/null @@ -1,103 +0,0 @@ -{ - "arrow_spacing": { - "level": "ignore" - }, - "camel_case_classes": { - "level": "error" - }, - "coffeescript_error": { - "level": "error" - }, - "colon_assignment_spacing": { - "level": "ignore", - "spacing": { - "left": 0, - "right": 0 - } - }, - "cyclomatic_complexity": { - "value": 10, - "level": "ignore" - }, - "duplicate_key": { - "level": "error" - }, - "empty_constructor_needs_parens": { - "level": "ignore" - }, - "indentation": { - "value": 4, - "level": "error" - }, - "line_endings": { - "level": "ignore", - "value": "unix" - }, - "max_line_length": { - "value": 80, - "level": "error", - "limitComments": true - }, - "missing_fat_arrows": { - "level": "ignore" - }, - "newlines_after_classes": { - "value": 3, - "level": "ignore" - }, - "no_backticks": { - "level": "error" - }, - "no_debugger": { - "level": "warn" - }, - "no_empty_functions": { - "level": "ignore" - }, - "no_empty_param_list": { - "level": "ignore" - }, - "no_implicit_braces": { - "level": "ignore", - "strict": true - }, - "no_implicit_parens": { - "strict": true, - "level": "ignore" - }, - "no_interpolation_in_single_quotes": { - "level": "ignore" - }, - "no_plusplus": { - "level": "ignore" - }, - "no_stand_alone_at": { - "level": "ignore" - }, - "no_tabs": { - "level": "error" - }, - "no_throwing_strings": { - "level": "error" - }, - "no_trailing_semicolons": { - "level": "error" - }, - "no_trailing_whitespace": { - "level": "error", - "allowed_in_comments": false, - "allowed_in_empty_lines": true - }, - "no_unnecessary_double_quotes": { - "level": "ignore" - }, - "no_unnecessary_fat_arrows": { - "level": "warn" - }, - "non_empty_constructor_needs_parens": { - "level": "ignore" - }, - "space_operators": { - "level": "ignore" - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format deleted file mode 100644 index c579f220292..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html - -case "${1}" in - --about ) - echo "make sure commit message is within line width limits" - ;; - * ) - awk ' -/^#/ { - NR-- - next -} - -NR == 1 { - if (length > 50) { - print "title too long" - exit 1 - } -} - -NR == 2 { - if (length != 0) { - print "2nd line should be empty" - exit 2 - } -} - -{ - if (length > 72) { - print "line ", FNR, " is too long"; - } -}' "${1}" -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number deleted file mode 100644 index a312756ef14..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -function run_test -{ - if ! grep -qvE '^#.*|^$' $1 ; then - exit 0 - fi - - ticket=$(git symbolic-ref HEAD | grep -oP "([A-Z]+)-([0-9]+)") - - if [ -z $ticket ]; then - exit 0 - fi - - if grep -q "^$ticket" $1; then - exit 0 - fi - - echo >> $1 - echo $ticket >> $1 -} - -case "${1}" in - --about ) - echo "Append ticket number to commit message" - ;; - * ) - run_test "$@" - ;; -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint deleted file mode 100644 index da2bb59cf80..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint +++ /dev/null @@ -1,69 +0,0 @@ -{ - // ENFORCE - "curly" : true, // Require {} around one-line blocks - "eqeqeq" : true, // Require === - "forin" : true, // Require hasOwnProperty inside forins - "immed" : false, // Require immediate invocations to be wrapped in parenthesis - // eg. (fun(){}()) - "latedef" : true, // Prohibit undefined variables (undef?!) - "newcap" : true, // Require capitalized constructors - "noarg" : true, // Prohibit arguments.callee and .caller - "noempty" : false, // Prohibit empty blocks "{}" - "nonew" : false, // Prohibit new - "plusplus" : false, // Prohibit ++ and -- - "regexp" : false, // Prohibit . in RegExp - "strict" : true, // Require 'use strict' - "trailing" : true, // Prohibit trailing spaces - "undef" : true, // Prohibit undeclared variables - "unused" : "vars",// Prohibit unused variables - - // RELAX - "asi" : false, // Allow missing semicolons due to automatic insertion - "bitwise" : false, // Allow bitwise operators - "boss" : false, // Allow advanced usage of assignments - "debug" : false, // Allow debugger statements - "eqnull" : false, // Allow "== null" - "esnext" : false, // Allow ES.next statements - "evil" : false, // Allow eval - "expr" : false, // Allow expressions instead of assignments/function calls - "funcscope" : false, // Allow vars declared in blocks (ie. if) - "globalstrict" : false, // Allow global 'use strict' - "iterator" : false, // Allow __iterator__ - "lastsemic" : false, // Allow one-line blocks with no semicolon - "laxbreak" : false, // Allow unsafe line breaks - "loopfunc" : false, // Allow function creation inside loops - "multistr" : false, // Allow multiline strings - "nonstandard" : false, // Allow (un)escape - "onecase" : false, // Allow one-case switch statements (=if) - "proto" : false, // Allow __proto__ - "regexdash" : false, // Allow RegExp to finish with a dash - "scripturl" : false, // Allow script-targeted URLs - "shadow" : false, // Allow variable shadowing (redeclaring in new scope) - "sub" : false, // Allow object['name'], not just object.name - "supernew" : false, // Allow "new function(){}" and "new Object" - "validthis" : false, // Allow this even inside a non-constructor - - // LEGACY - "nomen" : false, // Enforce no dangling underscores - "onevar" : true, // Enforce one var per function scope - "passfail" : false, // Stop on first error - "white" : false, // Strict Douglas' whitespace rules - - // MISC - "indent" : 4, // Check that indentation is X spaces - "maxlen" : 100, // Maximum characters/line - - // ENVIRONMENT (GLOBALS) - "browser" : true, // Browser (setTimeout, document,..) - "couch" : false, // CouchDB - "devel" : false, // Development (console, alert,..) - "dojo" : false, - "jquery" : false, - "mootools" : false, - "node" : false, - "mocha" : true, - "prototypejs" : false, - "rhino" : false, - "wsh" : false // Window Scripting Host -} - diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee deleted file mode 100644 index aa25de50cfd..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -coffeelint_alt="node_modules/.bin/coffeelint coffeelint" - -for c in 'coffeelint.json' "`dirname $0`/../coffeelint"; do - if [ -e "$c" ]; then - config="$c" - fi -done - -function run_coffeelint { - if [ -n "$config" ]; then - $coffeelint -f "${config}" ${@} - else - $coffeelint ${@} - fi -} - -function changed_files { - git diff --cached --name-only --diff-filter=ACM -} - -function write_staged { - while read file; do - name=`echo "$file" | sed 's:/:-:g'` - tmpfile=`mktemp /tmp/XXXXX-${name}` - git show ":$file" > $tmpfile - echo "$tmpfile" - done -} - -case "${1}" in - --about ) - if [ -z "$config" ]; then - config='default config' - fi - echo "Perform static analysis of coffee-script files (${config})" - ;; - * ) - coffeelint=`which $jshint_alt 2>/dev/null | head -n 1` - - # call out to tools - files=`changed_files | grep -e '\.coffee$' | write_staged` - - if [ -z "$files" ]; then - exit 0 - fi - - if test -z "$coffeelint"; then - echo "Please install coffeelint: npm install -g coffeelint" - exit 0 - fi - - run_coffeelint $files - status=$? - rm $files - exit $status - ;; -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js deleted file mode 100644 index 3b8ce7ef520..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -jshint_alt="node_modules/.bin/jshint jshint" - -for c in '.jshintrc' "`dirname $0`/../jshint"; do - if [ -e "$c" ]; then - config="$c" - fi -done - -function run_jshint { - if [ -n "$config" ]; then - $jshint --config "${config}" ${@} - else - $jshint ${@} - fi -} - -function changed_files { - git diff --cached --name-only --diff-filter=ACM -} - -function write_staged { - while read file; do - name=`basename $file` - tmpfile=`mktemp /tmp/XXXXX-${name}` - git show ":$file" > $tmpfile - echo "$tmpfile" - done -} - -case "${1}" in - --about ) - if [ -z "$config" ]; then - config='default config' - fi - echo "Perform static analysis of js source files (${config})" - ;; - * ) - jshint=`which $jshint_alt 2>/dev/null | head -n 1` - - # call out to tools - files=`changed_files | grep -e '\.js$' | write_staged` - - if [ -z "$files" ]; then - exit 0 - fi - - if test -z "$jshint"; then - echo "Please install jshint: npm install -g jshint" - exit 0 - fi - - run_jshint $files - status=$? - rm $files - exit $status - ;; -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php deleted file mode 100644 index 8f591edc158..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -phpcs_alt="vendor/bin/phpcs bin/phpcs ~/.composer/vendor/bin/phpcs phpcs" -phpmd_alt="vendor/bin/phpmd bin/phpmd ~/.composer/vendor/bin/phpmd phpmd" - -phpcs_standard='PSR2' -if [ -e "phpcs.xml" ]; then - phpcs_standard="./phpcs.xml" -fi - -phpmd_output=text -phpmd_rules='phpmd.xml' -if [ ! -e "$phpmd_rules" ]; then - phpmd_rules='codesize,design,naming,unusedcode' -fi - -function run_phpcs { - $phpcs --report-emacs --standard="$phpcs_standard" ${@} -} - -function run_phpmd { - $phpmd "`echo $1 | tr ' ' ','`" "$phpmd_output" "$phpmd_rules" -} - -function changed_files { - git diff --cached --name-only --diff-filter=ACM -} - -function write_staged { - while read file; do - name=`basename $file` - tmpfile=`mktemp /tmp/XXXXX-${name}` - git show ":$file" > $tmpfile - echo "$tmpfile" - done -} - -case "${1}" in - --about ) - echo "Perform static analysis of php source files" - ;; - * ) - phpcs=`which $phpcs_alt 2>/dev/null | head -n 1` - phpmd=`which $phpmd_alt 2>/dev/null | head -n 1` - - # call out to tools - files=`changed_files | grep -e '\.php$' | write_staged` - if [ -z "$files" ]; then - exit 0 - fi - - if test -z "$phpcs" -o -z "$phpmd"; then - echo "Please install phpcs and phpmd: composer global require squizlabs/php_codesniffer phpmd/phpmd" - exit 0 - fi - - run_phpcs $files - phpcs_status=$? - run_phpmd $files - phpmd_status=$? - rm $files - test "$phpcs_status" -eq 0 -a "$phpmd_status" -eq 0 - exit $? - ;; -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python deleted file mode 100644 index aa935679d2c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -function run_pep8 { - pep8 ${@} -} - -function run_pyflakes { - pyflakes ${@} -} - -function changed_files { - git diff --cached --name-only --diff-filter=ACM -} - -function write_staged { - while read file; do - name=`basename $file` - tmpfile=`mktemp /tmp/XXXXX-${name}` - git show ":$file" > $tmpfile - echo "$tmpfile" - done -} - -case "${1}" in - --about ) - echo "Perform static analysis of python source files" - ;; - * ) - # call out to tools - files=`changed_files | grep -e '\.py$' | write_staged` - if [ -z "$files" ]; then - exit 0 - fi - - if ! which pep8 pyflakes > /dev/null; then - echo "Please install pep8 and pyflakes: pip install pep8 pyflakes" - exit 0 - fi - - run_pep8 $files - pep8_status=$? - run_pyflakes $files - pyflakes_status=$? - rm $files - test "$pep8_status" -eq 0 -a "$pyflakes_status" -eq 0 - exit $? - ;; -esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml b/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml deleted file mode 100644 index 2348e784325..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - Klarna PHPMD ruleset - - - - - - - - - 1 - - - - - - - - - - - - - - - diff --git a/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist b/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist deleted file mode 100644 index 133de98b9af..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - tests/Unit - - - - tests/Component - - - - - - src/ - - - - - - - - - diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php deleted file mode 100644 index 798f30967d2..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php +++ /dev/null @@ -1,112 +0,0 @@ -setLocation(self::$path . "/{$orderId}"); - $this[static::ID_FIELD] = $orderId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $url = $this->post(self::$path, $data) - ->status('201') - ->getLocation(); - - $this->setLocation($url); - - return $this; - } - - /** - * Updates the resource. - * - * @param array $data Update data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function update(array $data) - { - $data = $this->post($this->getLocation(), $data) - ->status('200') - ->contentType('application/json') - ->getJson(); - - $this->exchangeArray($data); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php deleted file mode 100644 index 6f1a85b618e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php +++ /dev/null @@ -1,149 +0,0 @@ -setLocation($url); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $url = $this->post($this->getLocation(), $data) - ->status('201') - ->getLocation(); - - $this->setLocation($url); - - return $this; - } - - /** - * Appends shipping information to the capture. - * - * @param array $data Shipping info data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function addShippingInfo(array $data) - { - $this->post($this->getLocation() . '/shipping-info', $data) - ->status('204'); - - return $this; - } - - /** - * Updates the customers details. - * - * @param array $data Customer details data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateCustomerDetails(array $data) - { - $this->patch($this->getLocation() . '/customer-details', $data) - ->status('204'); - - return $this; - } - - /** - * Trigger send outs for this capture. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function triggerSendout() - { - $this->post($this->getLocation() . '/trigger-send-out') - ->status('204'); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php deleted file mode 100644 index a13dfcb67d2..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php +++ /dev/null @@ -1,317 +0,0 @@ -setLocation(self::$path . "/{$orderId}"); - $this[static::ID_FIELD] = $orderId; - } - - /** - * Fetches the order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function fetch() - { - parent::fetch(); - - // Convert captures data to Capture[] - - $captures = []; - foreach ($this['captures'] as $capture) { - $captureId = $capture[Capture::ID_FIELD]; - - $object = new Capture( - $this->connector, - $this->getLocation(), - $captureId - ); - $object->exchangeArray($capture); - - $captures[] = $object; - } - - $this['captures'] = $captures; - - return $this; - } - - /** - * Acknowledges the order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function acknowledge() - { - $this->post($this->getLocation() . '/acknowledge') - ->status('204'); - - return $this; - } - - /** - * Cancels this order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function cancel() - { - $this->post($this->getLocation() . '/cancel') - ->status('204'); - - return $this; - } - - /** - * Updates the authorization data. - * - * @param array $data Authorization data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateAuthorization(array $data) - { - $this->patch($this->getLocation() . '/authorization', $data) - ->status('204'); - - return $this; - } - - /** - * Extends the authorization time. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function extendAuthorizationTime() - { - $this->post($this->getLocation() . '/extend-authorization-time') - ->status('204'); - - return $this; - } - - /** - * Update the merchant references. - * - * @param array $data Merchant references - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateMerchantReferences(array $data) - { - $this->patch($this->getLocation() . '/merchant-references', $data) - ->status('204'); - - return $this; - } - - /** - * Updates the customer details. - * - * @param array $data Customer data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateCustomerDetails(array $data) - { - $this->patch($this->getLocation() . '/customer-details', $data) - ->status('204'); - - return $this; - } - - /** - * Refunds an amount of a captured order. - * - * @param array $data Refund data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function refund(array $data) - { - $this->post($this->getLocation() . '/refunds', $data) - ->status(['201', '204']); - - return $this; - } - - /** - * Release the remaining authorization for an order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function releaseRemainingAuthorization() - { - $this->post($this->getLocation() . '/release-remaining-authorization') - ->status('204'); - - return $this; - } - - /** - * Capture all or part of an order. - * - * @param array $data Capture data - * - * @see Capture::create() For more information on how to create a capture - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture - */ - public function createCapture(array $data) - { - $capture = new Capture($this->connector, $this->getLocation()); - - $capture->create($data); - - $this['captures'][] = $capture; - - return $capture; - } - - /** - * Fetches the specified capture. - * - * @param string $captureId Capture ID - * - * @see Capture::fetch() For more information on how to fetch a capture - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture - */ - public function fetchCapture($captureId) - { - if ($this->offsetExists('captures')) { - foreach ($this['captures'] as $capture) { - if ($capture->getId() !== $captureId) { - continue; - } - - return $capture->fetch(); - } - } - - $capture = new Capture($this->connector, $this->getLocation(), $captureId); - $capture->fetch(); - - $this['captures'][] = $capture; - - return $capture; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php deleted file mode 100644 index f1f96cebbae..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php +++ /dev/null @@ -1,200 +0,0 @@ -connector = $connector; - } - - /** - * Gets the resource id. - * - * @return string|null - */ - public function getId() - { - return isset($this[static::ID_FIELD]) ? $this[static::ID_FIELD] : null; - } - - /** - * Gets the resource location. - * - * @return string|null - */ - public function getLocation() - { - return $this->url; - } - - /** - * Sets the resource location. - * - * @param string $url Url to the resource - * - * @return self - */ - public function setLocation($url) - { - $this->url = $url; - - return $this; - } - - /** - * Fetches the resource. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function fetch() - { - $data = $this->get($this->getLocation()) - ->status('200') - ->contentType('application/json') - ->getJson(); - - $this->exchangeArray($data); - - return $this; - } - - /** - * Sends a HTTP request to the specified url. - * - * @param string $method HTTP method, e.g. 'GET' - * @param string $url Request destination - * @param array $options Request options - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function request($method, $url, array $options = []) - { - $request = $this->connector->createRequest($url, $method, $options); - - return new ResponseValidator($this->connector->send($request)); - } - - /** - * Sends a HTTP GET request to the specified url. - * - * @param string $url Request destination - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function get($url) - { - return $this->request('GET', $url); - } - - /** - * Sends a HTTP PATCH request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function patch($url, array $data) - { - return $this->request('PATCH', $url, ['json' => $data]); - } - - /** - * Sends a HTTP POST request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function post($url, array $data = null) - { - $options = []; - if ($data !== null) { - $options['json'] = $data; - } - - return $this->request('POST', $url, $options); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php deleted file mode 100644 index 8a7ebd442d5..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php +++ /dev/null @@ -1,186 +0,0 @@ - 'https://api.klarna.com']); - * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); - * - * - * @param ClientInterface $client HTTP transport client - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - */ - public function __construct( - ClientInterface $client, - $merchantId, - $sharedSecret, - UserAgentInterface $userAgent = null - ) { - $this->client = $client; - $this->merchantId = $merchantId; - $this->sharedSecret = $sharedSecret; - - if ($userAgent === null) { - $userAgent = UserAgent::createDefault(); - } - $this->userAgent = $userAgent; - } - - /** - * Creates a request object. - * - * @param string $url URL - * @param string $method HTTP method - * @param array $options Request options - * - * @return RequestInterface - */ - public function createRequest($url, $method = 'GET', array $options = []) - { - $options['auth'] = [$this->merchantId, $this->sharedSecret]; - $options['headers']['User-Agent'] = strval($this->userAgent); - - return $this->client->createRequest($method, $url, $options); - } - - /** - * Sends the request. - * - * @param RequestInterface $request Request to send - * - * @throws ConnectorException If the API returned an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When the adapter does not populate a response - * - * @return ResponseInterface - */ - public function send(RequestInterface $request) - { - try { - return $this->client->send($request); - } catch (RequestException $e) { - if (!$e->hasResponse()) { - throw $e; - } - - $response = $e->getResponse(); - - if ($response->getHeader('Content-Type') !== 'application/json') { - throw $e; - } - - $data = $response->json(); - - if (!is_array($data) || !array_key_exists('error_code', $data)) { - throw $e; - } - - throw new ConnectorException($data, $e); - } - } - - /** - * Gets the HTTP transport client. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Gets the user agent. - * - * @return UserAgentInterface - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Factory method to create a connector instance. - * - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param string $baseUrl Base URL for HTTP requests - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - * - * @return self - */ - public static function create( - $merchantId, - $sharedSecret, - $baseUrl = self::EU_BASE_URL, - UserAgentInterface $userAgent = null - ) { - $client = new Client(['base_url' => $baseUrl]); - - return new static($client, $merchantId, $sharedSecret, $userAgent); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php deleted file mode 100644 index 4c625fd685f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php +++ /dev/null @@ -1,94 +0,0 @@ -getCode(), $prev); - - $this->errorCode = $data['error_code']; - $this->messages = $data['error_messages']; - $this->correlationId = $data['correlation_id']; - } - - /** - * Gets the API error code for this exception. - * - * @return string - */ - public function getErrorCode() - { - return $this->errorCode; - } - - /** - * Gets the API error messages for this exception. - * - * @return array - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Gets the API correlation ID for this exception. - * - * @return string - */ - public function getCorrelationId() - { - return $this->correlationId; - } - - /** - * Gets the HTTP response for this API error. - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->getPrevious()->getResponse(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php deleted file mode 100644 index f318a1a5f56..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php +++ /dev/null @@ -1,137 +0,0 @@ -response = $response; - } - - /** - * Gets the response object. - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->response; - } - - /** - * Asserts the HTTP response status code. - * - * @param string|string[] $status Expected status code(s) - * - * @throws \RuntimeException If status code does not match - * - * @return self - */ - public function status($status) - { - $httpStatus = (string) $this->response->getStatusCode(); - if (is_array($status) && !in_array($httpStatus, $status)) { - throw new \RuntimeException( - "Unexpected response status code: {$httpStatus}" - ); - } - - if (is_string($status) && $httpStatus !== $status) { - throw new \RuntimeException( - "Unexpected response status code: {$httpStatus}" - ); - } - - return $this; - } - - /** - * Asserts the Content-Type header. - * - * @param string $mediaType Expected media type - * - * @throws \RuntimeException If Content-Type header is missing - * @throws \RuntimeException If Content-Type header does not match - * - * @return self - */ - public function contentType($mediaType) - { - if (!$this->response->hasHeader('Content-Type')) { - throw new \RuntimeException('Response is missing a Content-Type header'); - } - - $contentType = $this->response->getHeader('Content-Type'); - if ($contentType !== $mediaType) { - throw new \RuntimeException( - "Unexpected Content-Type header received: {$contentType}" - ); - } - - return $this; - } - - /** - * Get the decoded JSON response. - * - * @throws \RuntimeException If the response body is not in JSON format - * @throws \InvalidArgumentException If the JSON cannot be parsed - * - * @return array - */ - public function getJson() - { - return $this->response->json(); - } - - /** - * Gets the Location header. - * - * @throws \RuntimeException If the Location header is missing - * - * @return string - */ - public function getLocation() - { - if (!$this->response->hasHeader('Location')) { - throw new \RuntimeException('Response is missing a Location header'); - } - - return $this->response->getHeader('Location'); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php deleted file mode 100644 index 2a1d30ee5aa..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php +++ /dev/null @@ -1,130 +0,0 @@ -fields = []; - } - - /** - * Sets the specified field. - * - * @param string $key Component key, e.g. 'Language' - * @param string $name Component name, e.g. 'PHP' - * @param string $version Version identifier, e.g. '5.4.10' - * @param array $options Additional information - * - * @return self - */ - public function setField($key, $name, $version = '', array $options = []) - { - $field = [ - 'name' => $name - ]; - - if (!empty($version)) { - $field['version'] = $version; - } - - if (!empty($options)) { - $field['options'] = $options; - } - - $this->fields[$key] = $field; - - return $this; - } - - /** - * Serialises the user agent. - * - * @return string - */ - public function __toString() - { - $parts = []; - - foreach ($this->fields as $key => $value) { - $component = "{$key}/{$value['name']}"; - if (!empty($value['version'])) { - $component .= "_{$value['version']}"; - } - - $parts[] = $component; - - if (empty($value['options'])) { - continue; - } - - $opts = implode('; ', $value['options']); - $parts[] = "({$opts})"; - } - - return implode(' ', $parts); - } - - /** - * Creates the default user agent. - * - * @return self - */ - public static function createDefault() - { - $agent = new static(); - - $options = ['Guzzle/' . ClientInterface::VERSION]; - if (extension_loaded('curl')) { - $options[] = 'curl/' . curl_version()['version']; - } - - return $agent - ->setField('Library', static::NAME, static::VERSION, $options) - ->setField('OS', php_uname('s'), php_uname('r')) - ->setField('Language', 'PHP', phpversion()); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php deleted file mode 100644 index 7707d00f698..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php +++ /dev/null @@ -1,117 +0,0 @@ -mock->addResponse( - new Response(201, ['Location' => 'http://somewhere/a-path']) - ); - - $order = new Order($this->connector); - $location = $order->create(['data' => 'goes here']) - ->getLocation(); - - $this->assertEquals('http://somewhere/a-path', $location); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals('/checkout/v3/orders', $request->getPath()); - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct and that the updated data - * is accessible. - * - * @return void - */ - public function testUpdate() - { - $json = <<mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0001'); - $order['updated'] = 'not from json'; - - $order->update(['data' => 'sent in']); - - $this->assertEquals('from json', $order['updated']); - $this->assertEquals('0001', $order->getId()); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals('/checkout/v3/orders/0001', $request->getPath()); - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent and retrieved data is correct. - * - * @return void - */ - public function testFetch() - { - $json = <<mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0002'); - $order['updated'] = 'not from json'; - - $order->fetch(); - - $this->assertEquals('from json', $order['updated']); - $this->assertEquals('0002', $order->getId()); - - $request = $this->history->getLastRequest(); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('/checkout/v3/orders/0002', $request->getPath()); - - $this->assertAuthorization($request); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php deleted file mode 100644 index 7b38d836e08..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php +++ /dev/null @@ -1,168 +0,0 @@ -mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $capture = new Capture($this->connector, '/path', '1002'); - $capture['updated'] = 'not from json'; - - $capture->fetch(); - - $this->assertEquals('from json', $capture['updated']); - $this->assertEquals('1002', $capture->getId()); - - $request = $this->history->getLastRequest(); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('/path/captures/1002', $request->getPath()); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct and that the location is updated - * when creating the capture. - * - * @return void - */ - public function testCreate() - { - $this->mock->addResponse( - new Response(201, ['Location' => 'http://somewhere/a-path']) - ); - - $capture = new Capture($this->connector, '/path/to/order'); - $location = $capture->create(['data' => 'goes here']) - ->getLocation(); - - $this->assertEquals('http://somewhere/a-path', $location); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals('/path/to/order/captures', $request->getPath()); - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when appending shipping info. - * - * @return void - */ - public function testAddShippingInfo() - { - $this->mock->addResponse(new Response(204)); - - $capture = new Capture($this->connector, '/order/0002', '1002'); - $capture->addShippingInfo(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/order/0002/captures/1002/shipping-info', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when updating customer details. - * - * @return void - */ - public function testUpdateCustomerDetails() - { - $this->mock->addResponse(new Response(204)); - - $capture = new Capture($this->connector, '/order/0002', '1002'); - $capture->updateCustomerDetails(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('PATCH', $request->getMethod()); - $this->assertEquals( - '/order/0002/captures/1002/customer-details', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when triggering a send-out. - * - * @return void - */ - public function testTriggerSendout() - { - $this->mock->addResponse(new Response(204)); - - $capture = new Capture($this->connector, '/order/0002', '1002'); - $capture->triggerSendout(); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/order/0002/captures/1002/trigger-send-out', - $request->getPath() - ); - - $this->assertAuthorization($request); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php deleted file mode 100644 index 711d8d897c3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php +++ /dev/null @@ -1,451 +0,0 @@ -mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0002'); - $order['updated'] = 'not from json'; - - $order->fetch(); - - $this->assertEquals('from json', $order['updated']); - $this->assertEquals('0002', $order->getId()); - - $request = $this->history->getLastRequest(); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('/ordermanagement/v1/orders/0002', $request->getPath()); - - $this->assertAuthorization($request); - - $capture = $order['captures'][0]; - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals($capture->getId(), $capture['capture_id']); - $this->assertEquals('1002', $capture->getId()); - $this->assertEquals('data', $capture['test']); - } - - /** - * Make sure that the request sent is correct when acknowledging an order. - * - * @return void - */ - public function testAcknowledge() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->acknowledge(); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/acknowledge', - $request->getPath() - ); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when cancelling an order. - * - * @return void - */ - public function testCancel() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->cancel(); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/cancel', - $request->getPath() - ); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when extending authorization time. - * - * @return void - */ - public function testExtendAuthorizationTime() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->extendAuthorizationTime(); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/extend-authorization-time', - $request->getPath() - ); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when releasing remaining - * authorization. - * - * @return void - */ - public function testReleaseRemainingAuthorization() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->releaseRemainingAuthorization(); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/release-remaining-authorization', - $request->getPath() - ); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when updating authorization. - * - * @return void - */ - public function testUpdateAuthorization() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->updateAuthorization(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('PATCH', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/authorization', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when updating merchant references. - * - * @return void - */ - public function testUpdateMerchantReferences() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->updateMerchantReferences(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('PATCH', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/merchant-references', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when updating customer details. - * - * @return void - */ - public function testUpdateCustomerDetails() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->updateCustomerDetails(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('PATCH', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/customer-details', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when performing a refund. - * - * @return void - */ - public function testRefund() - { - $this->mock->addResponse(new Response(204)); - - $order = new Order($this->connector, '0002'); - $order->refund(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/refunds', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct when performing a refund. - * - * @return void - */ - public function testRefund201() - { - $this->mock->addResponse(new Response(201)); - - $order = new Order($this->connector, '0002'); - $order->refund(['data' => 'sent in']); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/refunds', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent is correct and that the location is updated - * when creating an order. - * - * @return void - */ - public function testCreateCapture() - { - $this->mock->addResponse( - new Response(201, ['Location' => 'http://somewhere/a-path']) - ); - - $order = new Order($this->connector, '0002'); - $capture = $order->createCapture(['data' => 'goes here']); - - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals('http://somewhere/a-path', $capture->getLocation()); - - $request = $this->history->getLastRequest(); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/captures', - $request->getPath() - ); - - $this->assertEquals('application/json', $request->getHeader('Content-Type')); - $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); - - $this->assertAuthorization($request); - } - - /** - * Make sure that the request sent and retrieved data is correct when fetching - * a capture. - * - * @return void - */ - public function testFetchCapture() - { - $json = <<mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0002'); - - $capture = $order->fetchCapture('1002'); - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/captures/1002', - $capture->getLocation() - ); - - $this->assertEquals('from json', $capture['updated']); - $this->assertEquals('1002', $capture->getId()); - $this->assertEquals($capture->getId(), $capture['capture_id']); - } - - /** - * Make sure that the request sent and retrieved data is correct when fetching - * a capture that exists in the captures list. - * - * @return void - */ - public function testFetchCaptureExisting() - { - $json = <<mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0002'); - - $capture = new Capture($this->connector, $order->getLocation(), '1002'); - $capture['capture_id'] = '1002'; - $capture['updated'] = 'not from json'; - - $order['captures'][] = $capture; - - $capture = $order->fetchCapture('1002'); - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/captures/1002', - $capture->getLocation() - ); - - $this->assertEquals('from json', $capture['updated']); - $this->assertEquals('1002', $capture->getId()); - $this->assertEquals($capture->getId(), $capture['capture_id']); - } - - /** - * Make sure that the request sent and retrieved data is correct when fetching - * a capture that is not already in the captures list. - * - * @return void - */ - public function testFetchCaptureNew() - { - $json = <<mock->addResponse( - new Response( - 200, - ['Content-Type' => 'application/json'], - Stream::factory($json) - ) - ); - - $order = new Order($this->connector, '0002'); - - $capture = new Capture($this->connector, $order->getLocation(), '1002'); - $capture['capture_id'] = '1002'; - $capture['updated'] = 'not from json'; - - $order['captures'][] = $capture; - - $capture = $order->fetchCapture('1003'); - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals( - '/ordermanagement/v1/orders/0002/captures/1003', - $capture->getLocation() - ); - - $this->assertEquals('from json', $capture['updated']); - $this->assertEquals('1003', $capture->getId()); - $this->assertEquals($capture->getId(), $capture['capture_id']); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php deleted file mode 100644 index eb0b1ae711e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php +++ /dev/null @@ -1,45 +0,0 @@ -getHeader('Authorization')); - - $this->assertEquals('Basic', $alg); - - $expected = self::MERCHANT_ID . ':' . self::SHARED_SECRET; - $this->assertEquals($expected, base64_decode($digest)); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php deleted file mode 100644 index 06c5151deb6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php +++ /dev/null @@ -1,80 +0,0 @@ -client = new Client(); - $this->mock = new Mock(); - $this->history = new History(); - - // Add the mock subscriber to the client. - $this->client->getEmitter()->attach($this->mock); - $this->client->getEmitter()->attach($this->history); - - $this->connector = new Connector( - $this->client, - self::MERCHANT_ID, - self::SHARED_SECRET - ); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php deleted file mode 100644 index 7dbe72e9167..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php +++ /dev/null @@ -1,144 +0,0 @@ -connector->createRequest( - 'https://localhost:8888/path-here', - 'POST', - ['query' => ['q' => '1']] - ); - - $this->assertInstanceOf('GuzzleHttp\Message\RequestInterface', $request); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals( - 'https://localhost:8888/path-here?q=1', - $request->getUrl() - ); - - $this->assertEquals(self::MERCHANT_ID, $request->getConfig()['auth'][0]); - $this->assertEquals(self::SHARED_SECRET, $request->getConfig()['auth'][1]); - - $this->assertEquals( - strval($this->connector->getUserAgent()), - $request->getHeader('User-Agent') - ); - } - - /** - * Make sure that the request sent returns an response. - * - * @return void - */ - public function testSend() - { - $response = new Response(200); - $this->mock->addResponse($response); - - $request = $this->connector->createRequest('http://somewhere/path', 'POST'); - $this->assertSame($response, $this->connector->send($request)); - } - - /** - * Make sure that an API error response throws a connector exception. - * - * @return void - */ - public function testSendError() - { - $json = << 'application/json'], - Stream::factory($json) - ); - $this->mock->addResponse($response); - - $this->setExpectedException( - 'Klarna\Rest\Transport\Exception\ConnectorException', - 'ERR_1: msg1, msg2 (#cid_1)' - ); - - $request = $this->connector->createRequest('http://somewhere/path', 'POST'); - $this->connector->send($request); - } - - /** - * Make sure that an error response throws an exception. - * - * @return void - */ - public function testSendGuzzleError() - { - $response = new Response(404); - $this->mock->addResponse($response); - - $this->setExpectedException('GuzzleHttp\Exception\ClientException'); - - $request = $this->connector->createRequest('http://somewhere/path', 'POST'); - $this->connector->send($request); - } - - /** - * Make sure that the factory method creates a connector as expected. - * - * @return void - */ - public function testCreate() - { - $userAgent = $this->getMockBuilder('Klarna\Rest\Transport\UserAgent') - ->getMock(); - - $connector = Connector::create( - self::MERCHANT_ID, - self::SHARED_SECRET, - self::BASE_URL, - $userAgent - ); - - $this->assertSame($userAgent, $connector->getUserAgent()); - $this->assertEquals(self::BASE_URL, $connector->getClient()->getBaseUrl()); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php deleted file mode 100644 index 5e32cbb3957..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php +++ /dev/null @@ -1,418 +0,0 @@ -connector); - $this->assertNull($order->getId()); - - $order = new Order($this->connector, '12345'); - $order['order_id'] = '12345'; - $this->assertEquals('12345', $order->getId()); - $this->assertEquals('/checkout/v3/orders/12345', $order->getLocation()); - } - - /** - * Make sure the correct data is sent and location is updated. - * - * @return void - */ - public function testCreate() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/checkout/v3/orders', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Location') - ->will($this->returnValue('http://somewhere/a-path')); - - $order = new Order($this->connector); - $location = $order->create($data) - ->getLocation(); - - $this->assertEquals('http://somewhere/a-path', $location); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testCreateInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $order->create(['data' => 'goes here']); - } - - /** - * Make sure a missing location header in the response results in an exception. - * - * @return void - */ - public function testCreateNoLocation() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(false)); - - $order = new Order($this->connector); - - $this->setExpectedException( - 'RuntimeException', - 'Response is missing a Location header' - ); - - $order->create(['data' => 'goes here']); - } - - /** - * Make sure the correct data is sent and that the replied data is accessible. - * - * @return void - */ - public function testUpdate() - { - $updateData = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/checkout/v3/orders/12345', - 'POST', - ['json' => $updateData] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'order_id' => '12345' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $order = new Order($this->connector, '12345'); - $order['order_id'] = '12345'; - $order['data'] = 'is overwritten'; - - $order->update($updateData); - - $this->assertEquals('from response json', $order['data']); - $this->assertEquals('12345', $order->getId()); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testUpdateInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $order->update(['data' => 'goes here']); - } - - /** - * Make sure a non-JSON response results in an exception. - * - * @return void - */ - public function testUpdateNotJson() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $order = new Order($this->connector); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected Content-Type header received: text/plain' - ); - - $order->update(['data' => 'goes here']); - } - - /** - * Make sure fetched data is accessible. - * - * @return void - */ - public function testFetch() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/checkout/v3/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'order_id' => '12345' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - - $order->fetch(); - - $this->assertEquals('from response json', $order['data']); - $this->assertEquals('12345', $order->getId()); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testFetchInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/checkout/v3/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $order->fetch(); - } - - /** - * Make sure a non-JSON response results in an exception. - * - * @return void - */ - public function testFetchNotJson() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/checkout/v3/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected Content-Type header received: text/plain' - ); - - $order->fetch(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php deleted file mode 100644 index ff665d9eea5..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php +++ /dev/null @@ -1,512 +0,0 @@ -connector, '/orders/1'); - $this->assertEquals('/orders/1/captures', $capture->getLocation()); - } - - /** - * Make sure the location is correct for fetch method. - * - * @return void - */ - public function testConstructorExisting() - { - $capture = new Capture($this->connector, '/orders/1', '2'); - $this->assertEquals('/orders/1/captures/2', $capture->getLocation()); - } - - /** - * Make sure the identifier is retrievable. - * - * @return void - */ - public function testGetId() - { - $capture = new Capture($this->connector, '/orders/12345'); - $this->assertNull($capture->getId()); - - $capture = new Capture($this->connector, '/orders/12345', '2'); - $this->assertEquals('2', $capture->getId()); - } - - /** - * Make sure fetched data is accessible. - * - * @return void - */ - public function testFetch() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'capture_id' => '2' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture['data'] = 'is overwritten'; - - $capture->fetch(); - - $this->assertEquals('from response json', $capture['data']); - $this->assertEquals('2', $capture->getId()); - } - - /** - * Make sure that an unknown status code response results in an exception. - * - * @return void - */ - public function testFetchInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $capture->fetch(); - } - - /** - * Make sure a non-JSON response results in an exception. - * - * @return void - */ - public function testFetchNotJson() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected Content-Type header received: text/plain' - ); - - $capture->fetch(); - } - - /** - * Make sure the correct data is sent and location is updated. - * - * @return void - */ - public function testCreate() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Location') - ->will($this->returnValue('http://somewhere/a-path')); - - $capture = new Capture($this->connector, '/orders/1'); - $location = $capture->create($data) - ->getLocation(); - - $this->assertEquals('http://somewhere/a-path', $location); - } - - /** - * Make sure that an unknown status code response results in an exception. - * - * @return void - */ - public function testCreateInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $capture = new Capture($this->connector, '/orders/1'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $capture->create(['data' => 'goes here']); - } - - /** - * Make sure a missing location header in the response results in an exception. - * - * @return void - */ - public function testCreateNoLocation() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(false)); - - $capture = new Capture($this->connector, '/orders/1'); - - $this->setExpectedException( - 'RuntimeException', - 'Response is missing a Location header' - ); - - $capture->create(['data' => 'goes here']); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testAddShippingInfo() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/shipping-info', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture->addShippingInfo($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testAddShippingInfoInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/shipping-info', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $capture->addShippingInfo($data); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testUpdateCustomerDetails() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/customer-details', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture->updateCustomerDetails($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testUpdateCustomerDetailsInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/customer-details', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $capture->updateCustomerDetails($data); - } - - /** - * Make sure that the correct request is sent. - * - * @return void - */ - public function testTriggerSendout() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/trigger-send-out', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - $capture->triggerSendout(); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testTriggerSendoutInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/orders/1/captures/2/trigger-send-out', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $capture = new Capture($this->connector, '/orders/1', '2'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $capture->triggerSendout(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php deleted file mode 100644 index 44de858cce7..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php +++ /dev/null @@ -1,921 +0,0 @@ -connector, '12345'); - $this->assertEquals('12345', $order->getId()); - $this->assertEquals('/ordermanagement/v1/orders/12345', $order->getLocation()); - } - - /** - * Make sure fetched data is accessible. - * - * @return void - */ - public function testFetch() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'order_id' => '12345', - 'captures' => [ - [ - 'capture_id' => '1002', - 'data' => 'also from json' - ], - [ - 'capture_id' => '1003', - 'data' => 'something else' - ] - ] - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - $order['captures'][] = new \ArrayObject(); - - $order->fetch(); - - $this->assertEquals('from response json', $order['data']); - $this->assertEquals('12345', $order->getId()); - - $this->assertCount(2, $order['captures']); - $this->assertContainsOnlyInstancesOf( - 'Klarna\Rest\OrderManagement\Capture', - $order['captures'] - ); - - $this->assertEquals('1002', $order['captures'][0]->getId()); - $this->assertEquals('also from json', $order['captures'][0]['data']); - $this->assertEquals('1003', $order['captures'][1]->getId()); - $this->assertEquals('something else', $order['captures'][1]['data']); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testFetchInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 204' - ); - - $order->fetch(); - } - - /** - * Make sure a non-JSON response results in an exception. - * - * @return void - */ - public function testFetchNotJson() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $order = new Order($this->connector, '12345'); - $order['data'] = 'is overwritten'; - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected Content-Type header received: text/plain' - ); - - $order->fetch(); - } - - /** - * Make sure that the correct request is sent. - * - * @return void - */ - public function testAcknowledge() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/acknowledge', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->acknowledge(); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testAcknowledgeInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/acknowledge', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->acknowledge(); - } - - /** - * Make sure that the correct request is sent. - * - * @return void - */ - public function testCancel() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/cancel', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->cancel(); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testCancelInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/cancel', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->cancel(); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testUpdateAuthorization() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/authorization', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->updateAuthorization($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testUpdateAuthorizationInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/authorization', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->updateAuthorization($data); - } - - /** - * Make sure that the correct request is sent. - * - * @return void - */ - public function testExtendAuthorizationTime() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/extend-authorization-time', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->extendAuthorizationTime(); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testExtendAuthorizationTimeInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/extend-authorization-time', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->extendAuthorizationTime(); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testUpdateMerchantReferences() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/merchant-references', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->updateMerchantReferences($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testUpdateMerchantReferencesInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/merchant-references', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->updateMerchantReferences($data); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testUpdateCustomerDetails() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/customer-details', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->updateCustomerDetails($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testUpdateCustomerDetailsInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/customer-details', - 'PATCH', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->updateCustomerDetails($data); - } - - /** - * Make sure the correct data is sent. - * - * @return void - */ - public function testRefund() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/refunds', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->refund($data); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testRefundInvalidStatusCode() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/refunds', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->refund($data); - } - - /** - * Make sure that the correct request is sent. - * - * @return void - */ - public function testReleaseRemainingAuthorization() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/release-remaining-authorization', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $order = new Order($this->connector, '12345'); - $order->releaseRemainingAuthorization(); - } - - /** - * Make sure an unknown status code response results in an exception. - * - * @return void - */ - public function testReleaseRemainingAuthorizationInvalidStatusCode() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/release-remaining-authorization', - 'POST', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $order = new Order($this->connector, '12345'); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $order->releaseRemainingAuthorization(); - } - - /** - * Make sure that a capture is created properly. - * - * @return void - */ - public function testCreateCapture() - { - $data = ['data' => 'goes here']; - - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/captures', - 'POST', - ['json' => $data] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Location') - ->will($this->returnValue('http://somewhere/a-path')); - - $order = new Order($this->connector, '12345'); - $capture = $order->createCapture($data); - - $this->assertEquals('http://somewhere/a-path', $capture->getLocation()); - } - - /** - * Make sure that a capture is fetched. - * - * @return void - */ - public function testFetchCapture() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/captures/2', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'capture_id' => '2' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $order = new Order($this->connector, '12345'); - $capture = $order->fetchCapture('2'); - - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals('from response json', $capture['data']); - } - - /** - * Make sure that an existing capture is refreshed before returned. - * - * @return void - */ - public function testFetchCaptureExisting() - { - $this->connector->expects($this->never()) - ->method('createRequest'); - - $order = new Order($this->connector, '12345'); - - $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') - ->disableOriginalConstructor() - ->getMock(); - - $order['captures'][0]->expects($this->once()) - ->method('getId') - ->will($this->returnValue('1')); - - $order['captures'][0]->expects($this->never()) - ->method('fetch'); - - $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') - ->disableOriginalConstructor() - ->getMock(); - - $order['captures'][1]->expects($this->once()) - ->method('getId') - ->will($this->returnValue('2')); - - $order['captures'][1]->expects($this->once()) - ->method('fetch') - ->will($this->returnValue($order['captures'][1])); - - $this->assertSame($order['captures'][1], $order->fetchCapture('2')); - } - - /** - * Make sure that a new capture is fetched if it is not in the resource. - * - * @return void - */ - public function testFetchCaptureNoCache() - { - $this->connector->expects($this->once()) - ->method('createRequest') - ->with( - '/ordermanagement/v1/orders/12345/captures/2', - 'GET', - [] - ) - ->will($this->returnValue($this->request)); - - $this->connector->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'data' => 'from response json', - 'capture_id' => '2' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $order = new Order($this->connector, '12345'); - $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') - ->disableOriginalConstructor() - ->getMock(); - - $order['captures'][0]->expects($this->once()) - ->method('getId') - ->will($this->returnValue('1')); - - $capture = $order->fetchCapture('2'); - - $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); - $this->assertEquals('from response json', $capture['data']); - $this->assertEquals('2', $capture->getId()); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php deleted file mode 100644 index 72fdab1cba5..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php +++ /dev/null @@ -1,57 +0,0 @@ -request = $this->getMockBuilder('GuzzleHttp\Message\RequestInterface') - ->getMock(); - - $this->response = $this->getMockBuilder('GuzzleHttp\Message\ResponseInterface') - ->getMock(); - - $this->connector = $this->getMockBuilder('Klarna\Rest\Transport\Connector') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php deleted file mode 100644 index cdba5d162e1..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php +++ /dev/null @@ -1,343 +0,0 @@ -client = $this->getMockBuilder('GuzzleHttp\ClientInterface') - ->getMock(); - - $this->userAgent = $this->getMockBuilder('Klarna\Rest\Transport\UserAgent') - ->getMock(); - - $this->userAgent->expects($this->any()) - ->method('__toString') - ->will($this->returnValue('a-user-agent')); - - $this->object = new Connector( - $this->client, - self::MERCHANT_ID, - self::SHARED_SECRET, - $this->userAgent - ); - } - - /** - * Make sure that the request is created as intended. - * - * @return void - */ - public function testCreateRequest() - { - $options = [ - 'opt' => 'val', - 'auth' => [self::MERCHANT_ID, self::SHARED_SECRET], - 'headers' => ['User-Agent' => 'a-user-agent'] - ]; - - $this->client->expects($this->any()) - ->method('createRequest') - ->with('uri', 'method', $options) - ->will($this->returnValue($this->request)); - - $request = $this->object->createRequest('method', 'uri', ['opt' => 'val']); - $this->assertSame($this->request, $request); - } - - /** - * Make sure that the request is sent and a response is returned. - * - * @return void - */ - public function testSend() - { - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->returnValue($this->response)); - - $response = $this->object->send($this->request); - - $this->assertSame($this->response, $response); - } - - /** - * Make sure that an exception without a response is re-thrown. - * - * @return void - */ - public function testSendRequestException() - { - $exception = new RequestException( - 'Something went terribly wrong', - $this->request - ); - - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->throwException($exception)); - - $this->setExpectedException( - 'GuzzleHttp\Exception\RequestException', - 'Something went terribly wrong' - ); - - $this->object->send($this->request); - } - - /** - * Make sure that an exception without a JSON response is re-thrown. - * - * @return void - */ - public function testSendConnectorExceptionNoJson() - { - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('')); - - $exception = new RequestException( - 'Something went terribly wrong', - $this->request, - $this->response - ); - - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->throwException($exception)); - - $this->setExpectedException( - 'GuzzleHttp\Exception\RequestException', - 'Something went terribly wrong' - ); - - $this->object->send($this->request); - } - - /** - * Make sure that an exception without data but with json content-type is - * re-thrown. - * - * @return void - */ - public function testSendConnectorExceptionEmptyJson() - { - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $exception = new RequestException( - 'Something went terribly wrong', - $this->request, - $this->response - ); - - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->throwException($exception)); - - $this->setExpectedException( - 'GuzzleHttp\Exception\RequestException', - 'Something went terribly wrong' - ); - - $this->object->send($this->request); - } - - /** - * Make sure that an exception without a proper JSON response is re-thrown. - * - * @return void - */ - public function testSendConnectorExceptionMissingFields() - { - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = []; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $exception = new RequestException( - 'Something went terribly wrong', - $this->request, - $this->response - ); - - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->throwException($exception)); - - $this->setExpectedException( - 'GuzzleHttp\Exception\RequestException', - 'Something went terribly wrong' - ); - - $this->object->send($this->request); - } - - /** - * Make sure that an exception with a error response is wrapped properly. - * - * @return void - */ - public function testSendConnectorException() - { - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('application/json')); - - $data = [ - 'error_code' => 'ERROR_CODE_1', - 'error_messages' => [ - 'Oh dear...', - 'Oh no...' - ], - 'correlation_id' => 'corr_id_1' - ]; - - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue($data)); - - $exception = new RequestException( - 'Something went terribly wrong', - $this->request, - $this->response - ); - - $this->client->expects($this->once()) - ->method('send') - ->with($this->request) - ->will($this->throwException($exception)); - - $this->setExpectedException( - 'Klarna\Rest\Transport\Exception\ConnectorException', - 'ERROR_CODE_1: Oh dear..., Oh no... (#corr_id_1)' - ); - - $this->object->send($this->request); - } - - /** - * Make sure that the factory method creates a connector properly. - * - * @return void - */ - public function testCreate() - { - $connector = Connector::create( - self::MERCHANT_ID, - self::SHARED_SECRET, - self::BASE_URL, - $this->userAgent - ); - - $client = $connector->getClient(); - $this->assertInstanceOf('GuzzleHttp\ClientInterface', $client); - - $this->assertEquals(self::BASE_URL, $client->getBaseUrl()); - - $userAgent = $connector->getUserAgent(); - - $this->assertSame($this->userAgent, $userAgent); - $this->assertEquals('a-user-agent', strval($userAgent)); - } - - /** - * Make sure that the factory method uses the default user agent. - * - * @return void - */ - public function testCreateDefaultUserAgent() - { - $connector = Connector::create( - self::MERCHANT_ID, - self::SHARED_SECRET, - self::BASE_URL - ); - - $userAgent = $connector->getUserAgent(); - $this->assertInstanceOf('Klarna\Rest\Transport\UserAgent', $userAgent); - $this->assertContains('Library/Klarna.kco_rest_php', strval($userAgent)); - } - - /** - * Make sure that the client is retrievable. - * - * @return void - */ - public function testGetClient() - { - $client = $this->object->getClient(); - - $this->assertInstanceOf('GuzzleHttp\ClientInterface', $client); - $this->assertSame($this->client, $client); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php deleted file mode 100644 index 11163fc4f9a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php +++ /dev/null @@ -1,80 +0,0 @@ - 'ERROR_CODE_1', - 'error_messages' => [ - 'Oh dear...', - 'Oh no...' - ], - 'correlation_id' => 'corr_id_1' - ]; - - $request = $this->getMockBuilder('GuzzleHttp\Message\RequestInterface') - ->getMock(); - $response = $this->getMockBuilder('GuzzleHttp\Message\ResponseInterface') - ->getMock(); - - $response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('500')); - - $previous = new RequestException('Error', $request, $response); - - $exception = new ConnectorException($data, $previous); - - $this->assertEquals(500, $exception->getCode()); - $this->assertSame($response, $exception->getResponse()); - - $this->assertContains( - $data['error_messages'][0], - $exception->getMessages() - ); - $this->assertContains( - $data['error_messages'][1], - $exception->getMessages() - ); - - $this->assertEquals($data['error_code'], $exception->getErrorCode()); - $this->assertEquals($data['correlation_id'], $exception->getCorrelationId()); - - $this->assertSame($previous, $exception->getPrevious()); - $this->assertEquals( - 'ERROR_CODE_1: Oh dear..., Oh no... (#corr_id_1)', - $exception->getMessage() - ); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php deleted file mode 100644 index 09c4e78ddd6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php +++ /dev/null @@ -1,249 +0,0 @@ -response = $this->getMockBuilder($interface) - ->getMock(); - - $this->validator = new ResponseValidator($this->response); - } - - /** - * Make sure the response is retrievable. - * - * @return void - */ - public function testGetResponse() - { - $this->assertSame($this->response, $this->validator->getResponse()); - } - - /** - * Make sure that the JSON data is possible to retrieve. - * - * @return void - */ - public function testGetJson() - { - $this->response->expects($this->once()) - ->method('json') - ->will($this->returnValue('json response')); - - $this->assertEquals('json response', $this->validator->getJson()); - } - - /** - * Make sure that the location header can be retrieved. - * - * @return void - */ - public function testGetLocation() - { - $this->response->expects($this->once()) - ->method('hasHeader') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Location') - ->will($this->returnValue('a location')); - - $this->assertEquals('a location', $this->validator->getLocation()); - } - - /** - * Make sure that a missing Location header throws an exception. - * - * @return void - */ - public function testGetLocationException() - { - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Location') - ->will($this->returnValue(false)); - - $this->setExpectedException( - 'RuntimeException', - 'Response is missing a Location header' - ); - - $this->validator->getLocation(); - } - - /** - * Make sure that the content type is asserted properly. - * - * @return void - */ - public function testContentType() - { - $this->response->expects($this->once()) - ->method('hasHeader') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $this->assertSame( - $this->validator, - $this->validator->contentType('text/plain') - ); - } - - /** - * Make sure that a missing Content-Type header throws an exception. - * - * @return void - */ - public function testContentTypeMissingException() - { - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(false)); - - $this->setExpectedException( - 'RuntimeException', - 'Response is missing a Content-Type header' - ); - - $this->validator->contentType('text/plain'); - } - - /** - * Make sure that a different Content-Type header throws an exception. - * - * @return void - */ - public function testContentTypeWrongException() - { - $this->response->expects($this->once()) - ->method('hasHeader') - ->with('Content-Type') - ->will($this->returnValue(true)); - - $this->response->expects($this->once()) - ->method('getHeader') - ->with('Content-Type') - ->will($this->returnValue('text/plain')); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected Content-Type header received: text/plain' - ); - - $this->validator->contentType('application/json'); - } - - /** - * Make sure that the status code is asserted properly. - * - * @return void - */ - public function testStatus() - { - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->assertSame($this->validator, $this->validator->status('200')); - } - - /** - * Make sure that multiple status codes are asserted properly. - * - * @return void - */ - public function testStatuses() - { - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('204')); - - $this->assertSame( - $this->validator, - $this->validator->status(['201', '204']) - ); - } - - /** - * Make sure that a different status code throws an exception. - * - * @return void - */ - public function testStatusException() - { - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('201')); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 201' - ); - - $this->validator->status('200'); - } - - /** - * Make sure that a different status code throws an exception. - * - * @return void - */ - public function testStatusesException() - { - $this->response->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue('200')); - - $this->setExpectedException( - 'RuntimeException', - 'Unexpected response status code: 200' - ); - - $this->validator->status(['201', '204']); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php deleted file mode 100644 index b2e3903c2f1..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php +++ /dev/null @@ -1,125 +0,0 @@ -agent = new UserAgent(); - } - - /** - * Make sure the default user agent components are present. - * - * @return void - */ - public function testCreateDefault() - { - $agent = UserAgent::createDefault(); - $text = $agent->__toString(); - - $this->assertContains( - 'Language/PHP_' . phpversion(), - $text, - 'No PHP language component present' - ); - - $this->assertContains( - 'OS/' . php_uname('s') . '_' . php_uname('r'), - $text, - 'No OS component present' - ); - - $this->assertContains( - 'Library/' . UserAgent::NAME . '_' . UserAgent::VERSION, - $text, - 'No Library component present', - false - ); - } - - /** - * Make sure the key and component are present in the user agent. - * - * @return void - */ - public function testSetField() - { - $this->agent->setField('key', 'component'); - - $this->assertEquals('key/component', strval($this->agent)); - } - - /** - * Make sure the key, component and version are present. - * - * @return void - */ - public function testSetFieldVersion() - { - $this->agent->setField('key', 'component', '1.0.0'); - - $this->assertEquals('key/component_1.0.0', strval($this->agent)); - } - - /** - * Make sure the key, component, version and options are present. - * - * @return void - */ - public function testSetFieldOptions() - { - $this->agent->setField('key', 'component', '1.0.0', ['attr']); - - $this->assertEquals( - 'key/component_1.0.0 (attr)', - strval($this->agent) - ); - } - - /** - * Make sure the key, component, version and multiple options are present. - * - * @return void - */ - public function testSetFieldTwoOptions() - { - $this->agent->setField('key', 'component', '1.0.0', ['attr1', 'attr2']); - - $this->assertEquals( - 'key/component_1.0.0 (attr1; attr2)', - strval($this->agent) - ); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php b/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php deleted file mode 100644 index 9065528ce5b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ -addPsr4('Klarna\\Rest\\Tests\\', __DIR__.'/'); - -date_default_timezone_set('UTC'); diff --git a/upload/system/storage/vendor/scssphp/scssphp/composer.json b/upload/system/storage/vendor/scssphp/scssphp/composer.json index f81203dd7af..d17ffb92428 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/composer.json +++ b/upload/system/storage/vendor/scssphp/scssphp/composer.json @@ -43,7 +43,7 @@ "thoughtbot/bourbon": "^7.0", "twbs/bootstrap": "~5.0", "twbs/bootstrap4": "4.6.1", - "zurb/foundation": "~6.5" + "zurb/foundation": "~6.7.0" }, "repositories": [ { diff --git a/upload/system/storage/vendor/scssphp/scssphp/src/Block/CallableBlock.php b/upload/system/storage/vendor/scssphp/scssphp/src/Block/CallableBlock.php index a18a87c2add..9b32d8ce757 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/src/Block/CallableBlock.php +++ b/upload/system/storage/vendor/scssphp/scssphp/src/Block/CallableBlock.php @@ -14,6 +14,7 @@ use ScssPhp\ScssPhp\Block; use ScssPhp\ScssPhp\Compiler\Environment; +use ScssPhp\ScssPhp\Node\Number; /** * @internal @@ -26,7 +27,7 @@ class CallableBlock extends Block public $name; /** - * @var array|null + * @var list|null */ public $args; diff --git a/upload/system/storage/vendor/scssphp/scssphp/src/Compiler.php b/upload/system/storage/vendor/scssphp/scssphp/src/Compiler.php index ecafc8cb953..d4e7c68961a 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/src/Compiler.php +++ b/upload/system/storage/vendor/scssphp/scssphp/src/Compiler.php @@ -458,10 +458,33 @@ public function compile($code, $path = null) } /** - * Compile scss + * Compiles the provided scss file into CSS. + * + * @param string $path + * + * @return CompilationResult + * + * @throws SassException when the source fails to compile + */ + public function compileFile($path) + { + $source = file_get_contents($path); + + if ($source === false) { + throw new \RuntimeException('Could not read the file content'); + } + + return $this->compileString($source, $path); + } + + /** + * Compiles the provided scss source code into CSS. + * + * If provided, the path is considered to be the path from which the source code comes + * from, which will be used to resolve relative imports. * * @param string $source - * @param string|null $path + * @param string|null $path The path for the source, used to resolve relative imports * * @return CompilationResult * @@ -548,7 +571,7 @@ public function compileString($source, $path = null) $sourceMap = null; - if (! empty($out) && $this->sourceMap && $this->sourceMap !== self::SOURCE_MAP_NONE) { + if (! empty($out) && $this->sourceMap !== self::SOURCE_MAP_NONE && $this->sourceMap) { assert($sourceMapGenerator !== null); $sourceMap = $sourceMapGenerator->generateJson($prefix); $sourceMapUrl = null; @@ -1508,6 +1531,7 @@ protected function filterScopeWithWithout($scope, $with, $without) // start from the root while ($scope->parent && $scope->parent->type !== Type::T_ROOT) { array_unshift($childStash, $scope); + \assert($scope->parent !== null); $scope = $scope->parent; } @@ -2090,6 +2114,11 @@ protected function collapseSelectors($selectors) foreach ($selector as $node) { $compound = ''; + if (!is_array($node)) { + $output[] = $node; + continue; + } + array_walk_recursive( $node, function ($value, $key) use (&$compound) { @@ -2124,12 +2153,16 @@ private function collapseSelectorsAsList($selectors) foreach ($selector as $node) { $compound = ''; - array_walk_recursive( - $node, - function ($value, $key) use (&$compound) { - $compound .= $value; - } - ); + if (!is_array($node)) { + $compound .= $node; + } else { + array_walk_recursive( + $node, + function ($value, $key) use (&$compound) { + $compound .= $value; + } + ); + } if ($this->isImmediateRelationshipCombinator($compound)) { if (\count($output)) { @@ -2885,7 +2918,7 @@ protected function compileChild($child, OutputBlock $out) { if (isset($child[Parser::SOURCE_LINE])) { $this->sourceIndex = isset($child[Parser::SOURCE_INDEX]) ? $child[Parser::SOURCE_INDEX] : null; - $this->sourceLine = isset($child[Parser::SOURCE_LINE]) ? $child[Parser::SOURCE_LINE] : -1; + $this->sourceLine = $child[Parser::SOURCE_LINE]; $this->sourceColumn = isset($child[Parser::SOURCE_COLUMN]) ? $child[Parser::SOURCE_COLUMN] : -1; } elseif (\is_array($child) && isset($child[1]->sourceLine) && $child[1] instanceof Block) { $this->sourceIndex = $child[1]->sourceIndex; @@ -4529,8 +4562,10 @@ public function compileValue($value, $quote = true) return $colorName; } - if (is_numeric($alpha)) { + if (\is_int($alpha) || \is_float($alpha)) { $a = new Number($alpha, ''); + } elseif (is_numeric($alpha)) { + $a = new Number((float) $alpha, ''); } else { $a = $alpha; } @@ -5806,13 +5841,13 @@ public function findImport($url, $currentDir = null) if (! \is_null($file)) { if (\is_array($dir)) { - $callableDescription = (\is_object($dir[0]) ? \get_class($dir[0]) : $dir[0]).'::'.$dir[1]; + $callableDescription = (\is_object($dir[0]) ? \get_class($dir[0]) : $dir[0]) . '::' . $dir[1]; } elseif ($dir instanceof \Closure) { $r = new \ReflectionFunction($dir); if (false !== strpos($r->name, '{closure}')) { $callableDescription = sprintf('closure{%s:%s}', $r->getFileName(), $r->getStartLine()); } elseif ($class = $r->getClosureScopeClass()) { - $callableDescription = $class->name.'::'.$r->name; + $callableDescription = $class->name . '::' . $r->name; } else { $callableDescription = $r->name; } @@ -5925,15 +5960,15 @@ private function checkImportPathConflicts(array $paths) private function tryImportPathWithExtensions($path) { $result = array_merge( - $this->tryImportPath($path.'.sass'), - $this->tryImportPath($path.'.scss') + $this->tryImportPath($path . '.sass'), + $this->tryImportPath($path . '.scss') ); if ($result) { return $result; } - return $this->tryImportPath($path.'.css'); + return $this->tryImportPath($path . '.css'); } /** @@ -5943,7 +5978,7 @@ private function tryImportPathWithExtensions($path) */ private function tryImportPath($path) { - $partial = dirname($path).'/_'.basename($path); + $partial = dirname($path) . '/_' . basename($path); $candidates = []; @@ -5969,7 +6004,7 @@ private function tryImportPathAsDirectory($path) return null; } - return $this->checkImportPathConflicts($this->tryImportPathWithExtensions($path.'/index')); + return $this->checkImportPathConflicts($this->tryImportPathWithExtensions($path . '/index')); } /** @@ -5984,7 +6019,7 @@ private function getPrettyPath($path) } $normalizedPath = $path; - $normalizedRootDirectory = $this->rootDirectory.'/'; + $normalizedRootDirectory = $this->rootDirectory . '/'; if (\DIRECTORY_SEPARATOR === '\\') { $normalizedRootDirectory = str_replace('\\', '/', $normalizedRootDirectory); @@ -6371,8 +6406,6 @@ public static function isNativeFunction($name) */ protected function sortNativeFunctionArgs($functionName, $prototypes, $args) { - static $parser = null; - if (! isset($prototypes)) { $keyArgs = []; $posArgs = []; @@ -6526,7 +6559,7 @@ private function parseFunctionPrototype(array $prototype) * * @return array * - * @phpstan-param non-empty-list, rest_argument: string|null}> $prototypes + * @phpstan-param non-empty-array, rest_argument: string|null}> $prototypes * @phpstan-return array{arguments: list, rest_argument: string|null} */ private function selectFunctionPrototype(array $prototypes, $positional, array $names) @@ -6984,10 +7017,14 @@ protected function coerceValue($value) return static::$null; } - if (is_numeric($value)) { + if (\is_int($value) || \is_float($value)) { return new Number($value, ''); } + if (is_numeric($value)) { + return new Number((float) $value, ''); + } + if ($value === '') { return static::$emptyString; } @@ -7675,9 +7712,9 @@ private function HWBtoRGB($hue, $whiteness, $blackness) $b = min(1.0 - $w, $b); $rgb = $this->toRGB($hue, 100, 50); - for($i = 1; $i < 4; $i++) { - $rgb[$i] *= (1.0 - $w - $b); - $rgb[$i] = round($rgb[$i] + 255 * $w + 0.0001); + for ($i = 1; $i < 4; $i++) { + $rgb[$i] *= (1.0 - $w - $b); + $rgb[$i] = round($rgb[$i] + 255 * $w + 0.0001); } return $rgb; @@ -7704,7 +7741,6 @@ private function RGBtoHWB($red, $green, $blue) if ((int) $d === 0) { $h = 0; } else { - if ($red == $max) { $h = 60 * ($green - $blue) / $d; } elseif ($green == $max) { @@ -7714,7 +7750,7 @@ private function RGBtoHWB($red, $green, $blue) } } - return [Type::T_HWB, fmod($h, 360), $min / 255 * 100, 100 - $max / 255 *100]; + return [Type::T_HWB, fmod($h, 360), $min / 255 * 100, 100 - $max / 255 * 100]; } @@ -7923,7 +7959,13 @@ protected function alterColor(array $args, $operation, $fn) $scale = $operation === 'scale'; $change = $operation === 'change'; - /** @phpstan-var callable(string, float|int, bool=, bool=): (float|int|null) $getParam */ + /** + * @param string $name + * @param float|int $max + * @param bool $checkPercent + * @param bool $assertPercent + * @return float|int|null + */ $getParam = function ($name, $max, $checkPercent = false, $assertPercent = false) use (&$kwargs, $scale, $change) { if (!isset($kwargs[$name])) { return null; @@ -8065,7 +8107,7 @@ protected function libAdjustColor($args) protected static $libChangeColor = ['color', 'kwargs...']; protected function libChangeColor($args) { - return $this->alterColor($args,'change', function ($base, $alter, $max) { + return $this->alterColor($args, 'change', function ($base, $alter, $max) { if ($alter === null) { return $base; } diff --git a/upload/system/storage/vendor/scssphp/scssphp/src/Node/Number.php b/upload/system/storage/vendor/scssphp/scssphp/src/Node/Number.php index 48e711f0855..6c044587644 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/src/Node/Number.php +++ b/upload/system/storage/vendor/scssphp/scssphp/src/Node/Number.php @@ -33,7 +33,7 @@ * * @template-implements \ArrayAccess */ -class Number extends Node implements \ArrayAccess +class Number extends Node implements \ArrayAccess, \JsonSerializable { const PRECISION = 10; @@ -131,7 +131,7 @@ public function getDimension() } /** - * @return string[] + * @return list */ public function getNumeratorUnits() { @@ -139,13 +139,23 @@ public function getNumeratorUnits() } /** - * @return string[] + * @return list */ public function getDenominatorUnits() { return $this->denominatorUnits; } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + // Passing a compiler instance makes the method output a Sass representation instead of a CSS one, supporting full units. + return $this->output(new Compiler()); + } + /** * @return bool */ @@ -554,7 +564,7 @@ public function equals(Number $other) try { return $this->coerceUnits($other, function ($num1, $num2) { - return round($num1,self::PRECISION) == round($num2, self::PRECISION); + return round($num1, self::PRECISION) == round($num2, self::PRECISION); }); } catch (SassScriptException $e) { return false; diff --git a/upload/system/storage/vendor/scssphp/scssphp/src/OutputStyle.php b/upload/system/storage/vendor/scssphp/scssphp/src/OutputStyle.php index c284639c13f..a1d8b425568 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/src/OutputStyle.php +++ b/upload/system/storage/vendor/scssphp/scssphp/src/OutputStyle.php @@ -1,9 +1,62 @@ saveEncoding(); $this->extractLineNumbers($buffer); + if ($this->utf8 && !preg_match('//u', $buffer)) { + $message = $this->sourceName ? 'Invalid UTF-8 file: ' . $this->sourceName : 'Invalid UTF-8 file'; + throw new ParserException($message); + } + $this->pushBlock(null); // root block $this->whitespace(); $this->pushBlock(null); @@ -323,6 +328,13 @@ public function parseValue($buffer, &$out) $list = $this->valueList($out); + if ($this->count !== \strlen($this->buffer)) { + $error = $this->parseError('Expected end of value'); + $message = 'Passing trailing content after the expression when parsing a value is deprecated since Scssphp 1.12.0 and will be an error in 2.0. ' . $error->getMessage(); + + @trigger_error($message, E_USER_DEPRECATED); + } + $this->restoreEncoding(); return $list; @@ -383,10 +395,13 @@ public function parseMediaQueryList($buffer, &$out) $this->inParens = false; $this->eatWhiteDefault = true; $this->buffer = (string) $buffer; + $this->discardComments = true; $this->saveEncoding(); $this->extractLineNumbers($this->buffer); + $this->whitespace(); + $isMediaQuery = $this->mediaQueryList($out); $this->restoreEncoding(); @@ -1678,9 +1693,9 @@ protected function whitespace() */ protected function appendComment($comment) { - assert($this->env !== null); - if (! $this->discardComments) { + assert($this->env !== null); + $this->env->comments[] = $comment; } } diff --git a/upload/system/storage/vendor/scssphp/scssphp/src/Version.php b/upload/system/storage/vendor/scssphp/scssphp/src/Version.php index d604a505764..89bd595265f 100644 --- a/upload/system/storage/vendor/scssphp/scssphp/src/Version.php +++ b/upload/system/storage/vendor/scssphp/scssphp/src/Version.php @@ -19,5 +19,5 @@ */ class Version { - const VERSION = '1.11.0'; + const VERSION = '1.12.1'; } diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/LICENSE b/upload/system/storage/vendor/symfony/polyfill-ctype/LICENSE index 3f853aaf35f..7536caeae80 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json index 1b3efff5725..b222fdab999 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php index 86710b94e5f..3dc0612096c 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php @@ -11,8 +11,6 @@ namespace Symfony\Polyfill\Intl\Idn; -use Exception; -use Normalizer; use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; @@ -167,7 +165,7 @@ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, if (1 === preg_match('/[^\x00-\x7F]/', $label)) { try { $label = 'xn--'.self::punycodeEncode($label); - } catch (Exception $e) { + } catch (\Exception $e) { $info->errors |= self::ERROR_PUNYCODE; } @@ -335,8 +333,8 @@ private static function process($domain, array $options, Info $info) $domain = self::mapCodePoints($domain, $options, $info); // Step 2. Normalize the domain name string to Unicode Normalization Form C. - if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { - $domain = Normalizer::normalize($domain, Normalizer::FORM_C); + if (!\Normalizer::isNormalized($domain, \Normalizer::FORM_C)) { + $domain = \Normalizer::normalize($domain, \Normalizer::FORM_C); } // Step 3. Break the string into labels at U+002E (.) FULL STOP. @@ -350,7 +348,7 @@ private static function process($domain, array $options, Info $info) if ('xn--' === substr($label, 0, 4)) { try { $label = self::punycodeDecode(substr($label, 4)); - } catch (Exception $e) { + } catch (\Exception $e) { $info->errors |= self::ERROR_PUNYCODE; continue; @@ -496,7 +494,7 @@ private static function validateLabel($label, Info $info, array $options, $canBe } // Step 1. The label must be in Unicode Normalization Form C. - if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { + if (!\Normalizer::isNormalized($label, \Normalizer::FORM_C)) { $info->errors |= self::ERROR_INVALID_ACE_LABEL; } @@ -583,7 +581,7 @@ private static function punycodeDecode($input) for ($j = 0; $j < $b; ++$j) { if ($bytes[$j] > 0x7F) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } $output[$out++] = $input[$j]; @@ -599,17 +597,17 @@ private static function punycodeDecode($input) for ($k = self::BASE; /* no condition */; $k += self::BASE) { if ($in >= $inputLength) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; if ($digit < 0) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } if ($digit > intdiv(self::MAX_INT - $i, $w)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $i += $digit * $w; @@ -629,7 +627,7 @@ private static function punycodeDecode($input) $baseMinusT = self::BASE - $t; if ($w > intdiv(self::MAX_INT, $baseMinusT)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $w *= $baseMinusT; @@ -639,7 +637,7 @@ private static function punycodeDecode($input) $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $n += intdiv($i, $outPlusOne); @@ -694,7 +692,7 @@ private static function punycodeEncode($input) } if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $delta += ($m - $n) * ($h + 1); @@ -702,7 +700,7 @@ private static function punycodeEncode($input) foreach ($iter as $codePoint) { if ($codePoint < $n && 0 === ++$delta) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } if ($codePoint === $n) { diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE index 03c5e25774f..fd0a0626a33 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham +Copyright (c) 2018-present Fabien Potencier and Trevor Rowbotham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php index 5bb70e48aca..d285acd13ef 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; /** diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php index 5c1c51ddeec..3c6af0c1320 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; /** diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json index 105e3d06cc1..12f75bcebeb 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json @@ -33,9 +33,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd3007..6e3afce692a 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json index 65f72d645d8..1b93573aeb9 100644 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -28,9 +28,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE b/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd3007..6e3afce692a 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php index bce5c4a84ab..2e0b96940aa 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -69,7 +69,7 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private const CASE_FOLD = [ + private const SIMPLE_CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; @@ -301,7 +301,11 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -406,6 +410,12 @@ public static function mb_encoding_aliases($encoding) public static function mb_check_encoding($var = null, $encoding = null) { + if (PHP_VERSION_ID < 70200 && \is_array($var)) { + trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + if (null === $encoding) { if (null === $var) { return false; @@ -413,7 +423,21 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; + } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -638,8 +662,10 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -674,8 +700,11 @@ public static function mb_strrichr($haystack, $needle, $part = false, $encoding public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -798,6 +827,50 @@ public static function mb_ord($s, $encoding = null) return $code; } + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } + + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 00000000000..512bba0bfde --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7c84..ecf1a035227 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -132,6 +132,10 @@ function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php index 82f5ac4d0f1..2f9fb5b421e 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -128,6 +128,10 @@ function mb_scrub(?string $string, ?string $encoding = null): string { $encoding function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json index 44895536bad..bd99d4b9d9f 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE index 4cd8bdd3007..6e3afce692a 100644 --- a/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/composer.json b/upload/system/storage/vendor/symfony/polyfill-php72/composer.json index 5f17af3438a..1882576dfbf 100644 --- a/upload/system/storage/vendor/symfony/polyfill-php72/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-php72/composer.json @@ -24,9 +24,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE index 5593b1d84f7..0ed3a246553 100644 --- a/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE +++ b/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Fabien Potencier +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/composer.json b/upload/system/storage/vendor/symfony/polyfill-php80/composer.json index bd9a3262a97..46ccde2036d 100644 --- a/upload/system/storage/vendor/symfony/polyfill-php80/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-php80/composer.json @@ -29,9 +29,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/upload/system/storage/vendor/twig/twig/CHANGELOG b/upload/system/storage/vendor/twig/twig/CHANGELOG index c3d65518e1f..2b8341fd846 100644 --- a/upload/system/storage/vendor/twig/twig/CHANGELOG +++ b/upload/system/storage/vendor/twig/twig/CHANGELOG @@ -1,3 +1,21 @@ +# 3.8.0 (2023-11-21) + + * Catch errors thrown during template rendering + * Fix IntlExtension::formatDateTime use of date formatter prototype + * Fix premature loop exit in Security Policy lookup of allowed methods/properties + * Remove NumberFormatter::TYPE_CURRENCY (deprecated in PHP 8.3) + * Restore return type annotations + * Allow Symfony 7 packages to be installed + * Deprecate `twig_test_iterable` function. Use the native `is_iterable` instead. + +# 3.7.1 (2023-08-28) + + * Fix some phpdocs + +# 3.7.0 (2023-07-26) + + * Add support for the ...spread operator on arrays and hashes + # 3.6.1 (2023-06-08) * Suppress some native return type deprecation messages diff --git a/upload/system/storage/vendor/twig/twig/composer.json b/upload/system/storage/vendor/twig/twig/composer.json index aeea64053ff..1b1726fe882 100644 --- a/upload/system/storage/vendor/twig/twig/composer.json +++ b/upload/system/storage/vendor/twig/twig/composer.json @@ -25,11 +25,12 @@ ], "require": { "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.22", "symfony/polyfill-mbstring": "^1.3", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", + "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0", "psr/container": "^1.0|^2.0" }, "autoload": { diff --git a/upload/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php b/upload/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php index e075563aef6..4024adbd70d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php +++ b/upload/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php @@ -63,7 +63,7 @@ public function write(string $key, string $content): void if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { // Compile cached file into bytecode cache - if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { + if (\function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { @opcache_invalidate($key, true); } elseif (\function_exists('apc_compile_file')) { apc_compile_file($key); diff --git a/upload/system/storage/vendor/twig/twig/src/Environment.php b/upload/system/storage/vendor/twig/twig/src/Environment.php index 70405b0d7e7..d7d51cdb1c5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Environment.php +++ b/upload/system/storage/vendor/twig/twig/src/Environment.php @@ -40,11 +40,11 @@ */ class Environment { - public const VERSION = '3.6.1'; - public const VERSION_ID = 30601; + public const VERSION = '3.8.0'; + public const VERSION_ID = 30800; public const MAJOR_VERSION = 3; - public const MINOR_VERSION = 6; - public const RELEASE_VERSION = 1; + public const MINOR_VERSION = 8; + public const RELEASE_VERSION = 0; public const EXTRA_VERSION = ''; private $charset; @@ -345,7 +345,6 @@ public function loadTemplate(string $cls, string $name, int $index = null): Temp $this->cache->load($key); } - $source = null; if (!class_exists($cls, false)) { $source = $this->getLoader()->getSourceContext($name); $content = $this->compileSource($source); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/Error.php b/upload/system/storage/vendor/twig/twig/src/Error/Error.php index a68be65f203..bca1fa64c5b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/Error.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/Error.php @@ -53,7 +53,7 @@ class Error extends \Exception * @param int $lineno The template line where the error occurred * @param Source|null $source The source context where the error occurred */ - public function __construct(string $message, int $lineno = -1, Source $source = null, \Exception $previous = null) + public function __construct(string $message, int $lineno = -1, Source $source = null, \Throwable $previous = null) { parent::__construct('', 0, $previous); @@ -130,13 +130,13 @@ private function updateRepr(): void } $dot = false; - if ('.' === substr($this->message, -1)) { + if (str_ends_with($this->message, '.')) { $this->message = substr($this->message, 0, -1); $dot = true; } $questionMark = false; - if ('?' === substr($this->message, -1)) { + if (str_ends_with($this->message, '?')) { $this->message = substr($this->message, 0, -1); $questionMark = true; } @@ -172,7 +172,7 @@ private function guessTemplateInfo(): void foreach ($backtrace as $trace) { if (isset($trace['object']) && $trace['object'] instanceof Template) { $currentClass = \get_class($trace['object']); - $isEmbedContainer = null === $templateClass ? false : 0 === strpos($templateClass, $currentClass); + $isEmbedContainer = null === $templateClass ? false : str_starts_with($templateClass, $currentClass); if (null === $this->name || ($this->name == $trace['object']->getTemplateName() && !$isEmbedContainer)) { $template = $trace['object']; $templateClass = \get_class($trace['object']); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php b/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php index 726b3309e5b..77c437c6882 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php @@ -30,7 +30,7 @@ public function addSuggestions(string $name, array $items): void $alternatives = []; foreach ($items as $item) { $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) { + if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { $alternatives[$item] = $lev; } } diff --git a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php index 2048c3c5486..13e0f0876ed 100644 --- a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php +++ b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php @@ -183,11 +183,14 @@ private function parseConditionalExpression($expr): AbstractExpression if (!$this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ':')) { $expr2 = $this->parseExpression(); if ($this->parser->getStream()->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ':')) { + // Ternary operator (expr ? expr2 : expr3) $expr3 = $this->parseExpression(); } else { + // Ternary without else (expr ? expr2) $expr3 = new ConstantExpression('', $this->parser->getCurrentToken()->getLine()); } } else { + // Ternary without then (expr ?: expr3) $expr2 = $expr; $expr3 = $this->parseExpression(); } @@ -334,7 +337,14 @@ public function parseArrayExpression() } $first = false; - $node->addElement($this->parseExpression()); + if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { + $stream->next(); + $expr = $this->parseExpression(); + $expr->setAttribute('spread', true); + $node->addElement($expr); + } else { + $node->addElement($this->parseExpression()); + } } $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']', 'An opened array is not properly closed'); @@ -359,6 +369,14 @@ public function parseHashExpression() } $first = false; + if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { + $stream->next(); + $value = $this->parseExpression(); + $value->setAttribute('spread', true); + $node->addElement($value); + continue; + } + // a hash key can be: // // * a number -- 12 @@ -491,10 +509,6 @@ public function parseSubscriptExpression($node) } if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { - if (!$arg instanceof ConstantExpression) { - throw new SyntaxError(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext()); - } - $name = $arg->getAttribute('value'); $node = new MethodCallExpression($node, 'macro_'.$name, $arguments, $lineno); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php index f99adda451b..36aa8f10a7f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php @@ -251,7 +251,7 @@ public function getTests(): array new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class, 'one_mandatory_argument' => true]), new TwigTest('constant', null, ['node_class' => ConstantTest::class]), new TwigTest('empty', 'twig_test_empty'), - new TwigTest('iterable', 'twig_test_iterable'), + new TwigTest('iterable', 'is_iterable'), ]; } @@ -343,9 +343,9 @@ function twig_cycle($values, $position) * @param \Traversable|array|int|float|string $values The values to pick a random item from * @param int|null $max Maximum value used when $values is an int * - * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is) - * * @return mixed A random value from the given sequence + * + * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is) */ function twig_random(Environment $env, $values = null, $max = null) { @@ -364,7 +364,6 @@ function twig_random(Environment $env, $values = null, $max = null) } } else { $min = $values; - $max = $max; } return mt_rand((int) $min, (int) $max); @@ -392,7 +391,7 @@ function twig_random(Environment $env, $values = null, $max = null) } } - if (!twig_test_iterable($values)) { + if (!is_iterable($values)) { return $values; } @@ -529,7 +528,7 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) */ function twig_replace_filter($str, $from) { - if (!twig_test_iterable($from)) { + if (!is_iterable($from)) { throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); } @@ -609,32 +608,34 @@ function twig_urlencode_filter($url) } /** - * Merges an array with another one. + * Merges any number of arrays or Traversable objects. * * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} * - * {% set items = items|merge({ 'peugeot': 'car' }) %} + * {% set items = items|merge({ 'peugeot': 'car' }, { 'banana': 'fruit' }) %} * - * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #} + * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'banana': 'fruit' } #} * - * @param array|\Traversable $arr1 An array - * @param array|\Traversable $arr2 An array + * @param array|\Traversable ...$arrays Any number of arrays or Traversable objects to merge * * @return array The merged array */ -function twig_array_merge($arr1, $arr2) +function twig_array_merge(...$arrays) { - if (!twig_test_iterable($arr1)) { - throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1))); - } + $result = []; - if (!twig_test_iterable($arr2)) { - throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2))); + foreach ($arrays as $argNumber => $array) { + if (!is_iterable($array)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" for argument %d.', \gettype($array), $argNumber + 1)); + } + + $result = array_merge($result, twig_to_array($array)); } - return array_merge(twig_to_array($arr1), twig_to_array($arr2)); + return $result; } + /** * Slices a variable. * @@ -654,7 +655,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) { try { - return iterator_to_array(new \LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys); + return iterator_to_array(new \LimitIterator($item, $start, $length ?? -1), $preserveKeys); } catch (\OutOfBoundsException $e) { return []; } @@ -667,7 +668,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe return \array_slice($item, $start, $length, $preserveKeys); } - return (string) mb_substr((string) $item, $start, $length, $env->getCharset()); + return mb_substr((string) $item, $start, $length, $env->getCharset()); } /** @@ -720,7 +721,7 @@ function twig_last(Environment $env, $item) */ function twig_join_filter($value, $glue = '', $and = null) { - if (!twig_test_iterable($value)) { + if (!is_iterable($value)) { $value = (array) $value; } @@ -766,7 +767,7 @@ function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) { $value = $value ?? ''; - if (\strlen($delimiter) > 0) { + if ('' !== $delimiter) { return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } @@ -924,7 +925,7 @@ function twig_in_filter($value, $compare) if (\is_string($compare)) { if (\is_string($value) || \is_int($value) || \is_float($value)) { - return '' === $value || false !== strpos($compare, (string) $value); + return '' === $value || str_contains($compare, (string) $value); } return false; @@ -1020,9 +1021,6 @@ function twig_compare($a, $b) } /** - * @param string $pattern - * @param string|null $subject - * * @return int * * @throws RuntimeError When an invalid pattern is used @@ -1121,7 +1119,7 @@ function twig_length_filter(Environment $env, $thing) return 0; } - if (is_scalar($thing)) { + if (\is_scalar($thing)) { return mb_strlen($thing, $env->getCharset()); } @@ -1231,7 +1229,7 @@ function twig_call_macro(Template $template, string $method, array $args, int $l */ function twig_ensure_traversable($seq) { - if ($seq instanceof \Traversable || \is_array($seq)) { + if (is_iterable($seq)) { return $seq; } @@ -1294,21 +1292,23 @@ function twig_test_empty($value) * @param mixed $value A variable * * @return bool true if the value is traversable + * + * @deprecated since Twig 3.8, to be removed in 4.0 (use the native "is_iterable" function instead) */ function twig_test_iterable($value) { - return $value instanceof \Traversable || \is_array($value); + return is_iterable($value); } /** * Renders a template. * - * @param array $context - * @param string|array $template The template to render or an array of templates to try consecutively - * @param array $variables The variables to pass to the template - * @param bool $withContext - * @param bool $ignoreMissing Whether to ignore missing templates or not - * @param bool $sandboxed Whether to sandbox the template or not + * @param array $context + * @param string|array|TemplateWrapper $template The template to render or an array of templates to try consecutively + * @param array $variables The variables to pass to the template + * @param bool $withContext + * @param bool $ignoreMissing Whether to ignore missing templates or not + * @param bool $sandboxed Whether to sandbox the template or not * * @return string The rendered template */ @@ -1429,7 +1429,7 @@ function twig_constant_is_defined($constant, $object = null) */ function twig_array_batch($items, $size, $fill = null, $preserveKeys = true) { - if (!twig_test_iterable($items)) { + if (!is_iterable($items)) { throw new RuntimeError(sprintf('The "batch" filter expects an array or "Traversable", got "%s".', \is_object($items) ? \get_class($items) : \gettype($items))); } @@ -1571,13 +1571,13 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar $classCache[$method] = $method; $classCache[$lcName = $lcMethods[$i]] = $method; - if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) { + if ('g' === $lcName[0] && str_starts_with($lcName, 'get')) { $name = substr($method, 3); $lcName = substr($lcName, 3); - } elseif ('i' === $lcName[0] && 0 === strpos($lcName, 'is')) { + } elseif ('i' === $lcName[0] && str_starts_with($lcName, 'is')) { $name = substr($method, 2); $lcName = substr($lcName, 2); - } elseif ('h' === $lcName[0] && 0 === strpos($lcName, 'has')) { + } elseif ('h' === $lcName[0] && str_starts_with($lcName, 'has')) { $name = substr($method, 3); $lcName = substr($lcName, 3); if (\in_array('is'.$lcName, $lcMethods)) { @@ -1673,7 +1673,7 @@ function twig_array_column($array, $name, $index = null): array function twig_array_filter(Environment $env, $array, $arrow) { - if (!twig_test_iterable($array)) { + if (!is_iterable($array)) { throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array))); } diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php index bfb23d7bd4f..c0f10d5a303 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php @@ -19,10 +19,10 @@ public function getFunctions(): array // dump is safe if var_dump is overridden by xdebug $isDumpOutputHtmlSafe = \extension_loaded('xdebug') // false means that it was not set (and the default is on) or it explicitly enabled - && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump')) + && (false === \ini_get('xdebug.overload_var_dump') || \ini_get('xdebug.overload_var_dump')) // false means that it was not set (and the default is on) or it explicitly enabled // xdebug.overload_var_dump produces HTML only when html_errors is also enabled - && (false === ini_get('html_errors') || ini_get('html_errors')) + && (false === \ini_get('html_errors') || \ini_get('html_errors')) || 'cli' === \PHP_SAPI ; diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php index 9d2251dc6e1..ef8879dbdc6 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -341,7 +341,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char * The following replaces characters undefined in HTML with the * hex entity for the Unicode replacement character. */ - if (($ord <= 0x1f && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7f && $ord <= 0x9f)) { + if (($ord <= 0x1F && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7F && $ord <= 0x9F)) { return '�'; } @@ -388,7 +388,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char default: $escapers = $env->getExtension(EscaperExtension::class)->getEscapers(); - if (array_key_exists($strategy, $escapers)) { + if (\array_key_exists($strategy, $escapers)) { return $escapers[$strategy]($env, $string, $charset); } diff --git a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php index 65198bbb649..812071bf971 100644 --- a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php +++ b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php @@ -37,7 +37,7 @@ public static function guess(string $name) return 'html'; // return html for directories } - if ('.twig' === substr($name, -5)) { + if (str_ends_with($name, '.twig')) { $name = substr($name, 0, -5); } diff --git a/upload/system/storage/vendor/twig/twig/src/Lexer.php b/upload/system/storage/vendor/twig/twig/src/Lexer.php index 975b0b924ff..b23080f58e0 100644 --- a/upload/system/storage/vendor/twig/twig/src/Lexer.php +++ b/upload/system/storage/vendor/twig/twig/src/Lexer.php @@ -315,8 +315,13 @@ private function lexExpression(): void } } + // spread operator + if ('.' === $this->code[$this->cursor] && ($this->cursor + 2 < $this->end) && '.' === $this->code[$this->cursor + 1] && '.' === $this->code[$this->cursor + 2]) { + $this->pushToken(Token::SPREAD_TYPE, '...'); + $this->moveCursor('...'); + } // arrow function - if ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { + elseif ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { $this->pushToken(Token::ARROW_TYPE, '=>'); $this->moveCursor('=>'); } @@ -340,13 +345,13 @@ private function lexExpression(): void $this->moveCursor($match[0]); } // punctuation - elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) { + elseif (str_contains(self::PUNCTUATION, $this->code[$this->cursor])) { // opening bracket - if (false !== strpos('([{', $this->code[$this->cursor])) { + if (str_contains('([{', $this->code[$this->cursor])) { $this->brackets[] = [$this->code[$this->cursor], $this->lineno]; } // closing bracket - elseif (false !== strpos(')]}', $this->code[$this->cursor])) { + elseif (str_contains(')]}', $this->code[$this->cursor])) { if (empty($this->brackets)) { throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); } @@ -417,7 +422,7 @@ private function lexString(): void $this->pushToken(/* Token::INTERPOLATION_START_TYPE */ 10); $this->moveCursor($match[0]); $this->pushState(self::STATE_INTERPOLATION); - } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && \strlen($match[0]) > 0) { + } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && '' !== $match[0]) { $this->pushToken(/* Token::STRING_TYPE */ 7, stripcslashes($match[0])); $this->moveCursor($match[0]); } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/FilesystemLoader.php b/upload/system/storage/vendor/twig/twig/src/Loader/FilesystemLoader.php index 62267a11c89..1073a406a06 100644 --- a/upload/system/storage/vendor/twig/twig/src/Loader/FilesystemLoader.php +++ b/upload/system/storage/vendor/twig/twig/src/Loader/FilesystemLoader.php @@ -36,7 +36,7 @@ class FilesystemLoader implements LoaderInterface */ public function __construct($paths = [], string $rootPath = null) { - $this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR; + $this->rootPath = ($rootPath ?? getcwd()).\DIRECTORY_SEPARATOR; if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) { $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; } @@ -250,7 +250,7 @@ private function parseName(string $name, string $default = self::MAIN_NAMESPACE) private function validateName(string $name): void { - if (false !== strpos($name, "\0")) { + if (str_contains($name, "\0")) { throw new LoaderError('A template name cannot contain NUL bytes.'); } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php index 0e25fe46ad8..44428380239 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php @@ -66,20 +66,70 @@ public function addElement(AbstractExpression $value, AbstractExpression $key = public function compile(Compiler $compiler): void { + $keyValuePairs = $this->getKeyValuePairs(); + $needsArrayMergeSpread = \PHP_VERSION_ID < 80100 && $this->hasSpreadItem($keyValuePairs); + + if ($needsArrayMergeSpread) { + $compiler->raw('twig_array_merge('); + } $compiler->raw('['); $first = true; - foreach ($this->getKeyValuePairs() as $pair) { + $reopenAfterMergeSpread = false; + $nextIndex = 0; + foreach ($keyValuePairs as $pair) { + if ($reopenAfterMergeSpread) { + $compiler->raw(', ['); + $reopenAfterMergeSpread = false; + } + + if ($needsArrayMergeSpread && $pair['value']->hasAttribute('spread')) { + $compiler->raw('], ')->subcompile($pair['value']); + $first = true; + $reopenAfterMergeSpread = true; + continue; + } if (!$first) { $compiler->raw(', '); } $first = false; - $compiler - ->subcompile($pair['key']) - ->raw(' => ') - ->subcompile($pair['value']) - ; + if ($pair['value']->hasAttribute('spread') && !$needsArrayMergeSpread) { + $compiler->raw('...')->subcompile($pair['value']); + ++$nextIndex; + } else { + $key = $pair['key'] instanceof ConstantExpression ? $pair['key']->getAttribute('value') : null; + + if ($nextIndex !== $key) { + if (\is_int($key)) { + $nextIndex = $key + 1; + } + $compiler + ->subcompile($pair['key']) + ->raw(' => ') + ; + } else { + ++$nextIndex; + } + + $compiler->subcompile($pair['value']); + } + } + if (!$reopenAfterMergeSpread) { + $compiler->raw(']'); } - $compiler->raw(']'); + if ($needsArrayMergeSpread) { + $compiler->raw(')'); + } + } + + private function hasSpreadItem(array $pairs): bool + { + foreach ($pairs as $pair) { + if ($pair['value']->hasAttribute('spread')) { + return true; + } + } + + return false; } } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php index c3516b853fc..73fa20b1f66 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php @@ -24,7 +24,7 @@ public function compile(Compiler $compiler): void ->subcompile($this->getNode('left')) ->raw(sprintf(') && is_string($%s = ', $right)) ->subcompile($this->getNode('right')) - ->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right)) + ->raw(sprintf(') && str_ends_with($%1$s, $%2$s))', $left, $right)) ; } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php index d0df1c4b639..22eff92a794 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php @@ -24,7 +24,7 @@ public function compile(Compiler $compiler): void ->subcompile($this->getNode('left')) ->raw(sprintf(') && is_string($%s = ', $right)) ->subcompile($this->getNode('right')) - ->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right)) + ->raw(sprintf(') && str_starts_with($%1$s, $%2$s))', $left, $right)) ; } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php index 11a6b1abcae..3a2d7a4fca4 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php @@ -24,7 +24,7 @@ protected function compileCallable(Compiler $compiler) { $callable = $this->getAttribute('callable'); - if (\is_string($callable) && false === strpos($callable, '::')) { + if (\is_string($callable) && !str_contains($callable, '::')) { $compiler->raw($callable); } else { [$r, $callable] = $this->reflectCallable($callable); @@ -297,13 +297,13 @@ private function reflectCallable($callable) } $r = new \ReflectionFunction($closure); - if (false !== strpos($r->name, '{closure}')) { + if (str_contains($r->name, '{closure}')) { return $this->reflector = [$r, $callable, 'Closure']; } if ($object = $r->getClosureThis()) { $callable = [$object, $r->name]; - $callableName = (\function_exists('get_debug_type') ? get_debug_type($object) : \get_class($object)).'::'.$r->name; + $callableName = get_debug_type($object).'::'.$r->name; } elseif (\PHP_VERSION_ID >= 80111 && $class = $r->getClosureCalledClass()) { $callableName = $class->name.'::'.$r->name; } elseif (\PHP_VERSION_ID < 80111 && $class = $r->getClosureScopeClass()) { diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php index 2c7bd0a276c..d7db993579c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php @@ -23,14 +23,23 @@ public function __construct(AbstractExpression $expr1, AbstractExpression $expr2 public function compile(Compiler $compiler): void { - $compiler - ->raw('((') - ->subcompile($this->getNode('expr1')) - ->raw(') ? (') - ->subcompile($this->getNode('expr2')) - ->raw(') : (') - ->subcompile($this->getNode('expr3')) - ->raw('))') - ; + // Ternary with no then uses Elvis operator + if ($this->getNode('expr1') === $this->getNode('expr2')) { + $compiler + ->raw('((') + ->subcompile($this->getNode('expr1')) + ->raw(') ?: (') + ->subcompile($this->getNode('expr3')) + ->raw('))'); + } else { + $compiler + ->raw('((') + ->subcompile($this->getNode('expr1')) + ->raw(') ? (') + ->subcompile($this->getNode('expr2')) + ->raw(') : (') + ->subcompile($this->getNode('expr3')) + ->raw('))'); + } } } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php index e972b6ba582..9b485eeaf03 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php @@ -355,6 +355,9 @@ protected function compileMacros(Compiler $compiler) protected function compileGetTemplateName(Compiler $compiler) { $compiler + ->write("/**\n") + ->write(" * @codeCoverageIgnore\n") + ->write(" */\n") ->write("public function getTemplateName()\n", "{\n") ->indent() ->write('return ') @@ -409,6 +412,9 @@ protected function compileIsTraitable(Compiler $compiler) } $compiler + ->write("/**\n") + ->write(" * @codeCoverageIgnore\n") + ->write(" */\n") ->write("public function isTraitable()\n", "{\n") ->indent() ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) @@ -420,6 +426,9 @@ protected function compileIsTraitable(Compiler $compiler) protected function compileDebugInfo(Compiler $compiler) { $compiler + ->write("/**\n") + ->write(" * @codeCoverageIgnore\n") + ->write(" */\n") ->write("public function getDebugInfo()\n", "{\n") ->indent() ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Node.php b/upload/system/storage/vendor/twig/twig/src/Node/Node.php index c0558b9afdc..30659ae0fd1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Node.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Node.php @@ -27,7 +27,6 @@ class Node implements \Countable, \IteratorAggregate protected $lineno; protected $tag; - private $name; private $sourceContext; /** diff --git a/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php b/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php index 56a334496e9..2ac9123d0d1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php @@ -45,7 +45,7 @@ public function compile(Compiler $compiler): void ->write(sprintf('$%s = ', $varsName)) ->subcompile($node) ->raw(";\n") - ->write(sprintf("if (!twig_test_iterable(\$%s)) {\n", $varsName)) + ->write(sprintf("if (!is_iterable(\$%s)) {\n", $varsName)) ->indent() ->write("throw new RuntimeError('Variables passed to the \"with\" tag must be a hash.', ") ->repr($node->getTemplateLine()) diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php index fe56ea30741..c390d7cc71b 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php @@ -57,7 +57,7 @@ public function enterNode(Node $node, Environment $env): Node } elseif ($node instanceof AutoEscapeNode) { $this->statusStack[] = $node->getAttribute('value'); } elseif ($node instanceof BlockNode) { - $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); + $this->statusStack[] = $this->blocks[$node->getAttribute('name')] ?? $this->needEscaping(); } elseif ($node instanceof ImportNode) { $this->safeVars[] = $node->getNode('var')->getAttribute('name'); } @@ -73,7 +73,7 @@ public function leaveNode(Node $node, Environment $env): ?Node $this->blocks = []; } elseif ($node instanceof FilterExpression) { return $this->preEscapeFilterNode($node, $env); - } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping($env)) { + } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping()) { $expression = $node->getNode('expr'); if ($expression instanceof ConditionalExpression && $this->shouldUnwrapConditional($expression, $env, $type)) { return new DoNode($this->unwrapConditional($expression, $env, $type), $expression->getTemplateLine()); @@ -85,7 +85,7 @@ public function leaveNode(Node $node, Environment $env): ?Node if ($node instanceof AutoEscapeNode || $node instanceof BlockNode) { array_pop($this->statusStack); } elseif ($node instanceof BlockReferenceNode) { - $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env); + $this->blocks[$node->getAttribute('name')] = $this->needEscaping(); } return $node; @@ -183,13 +183,13 @@ private function isSafeFor(string $type, Node $expression, Environment $env): bo return \in_array($type, $safe) || \in_array('all', $safe); } - private function needEscaping(Environment $env) + private function needEscaping() { if (\count($this->statusStack)) { return $this->statusStack[\count($this->statusStack) - 1]; } - return $this->defaultStrategy ? $this->defaultStrategy : false; + return $this->defaultStrategy ?: false; } private function getEscaperFilter(string $type, Node $node): FilterExpression diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php index af477e65356..d6a7781ba27 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php @@ -50,10 +50,10 @@ public function leaveNode(Node $node, Environment $env): Node } } elseif ($this->inAModule) { if ( - $node instanceof GetAttrExpression && - $node->getNode('node') instanceof NameExpression && - '_self' === $node->getNode('node')->getAttribute('name') && - $node->getNode('attribute') instanceof ConstantExpression + $node instanceof GetAttrExpression + && $node->getNode('node') instanceof NameExpression + && '_self' === $node->getNode('node')->getAttribute('name') + && $node->getNode('attribute') instanceof ConstantExpression ) { $this->hasMacroCalls = true; diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php index 7ac75e41ad3..6b39f00947c 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php @@ -63,7 +63,7 @@ public function __construct(int $optimizers = -1) public function enterNode(Node $node, Environment $env): Node { if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->enterOptimizeFor($node, $env); + $this->enterOptimizeFor($node); } return $node; @@ -72,14 +72,14 @@ public function enterNode(Node $node, Environment $env): Node public function leaveNode(Node $node, Environment $env): ?Node { if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->leaveOptimizeFor($node, $env); + $this->leaveOptimizeFor($node); } if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { - $node = $this->optimizeRawFilter($node, $env); + $node = $this->optimizeRawFilter($node); } - $node = $this->optimizePrintNode($node, $env); + $node = $this->optimizePrintNode($node); return $node; } @@ -91,7 +91,7 @@ public function leaveNode(Node $node, Environment $env): ?Node * * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" */ - private function optimizePrintNode(Node $node, Environment $env): Node + private function optimizePrintNode(Node $node): Node { if (!$node instanceof PrintNode) { return $node; @@ -99,8 +99,8 @@ private function optimizePrintNode(Node $node, Environment $env): Node $exprNode = $node->getNode('expr'); if ( - $exprNode instanceof BlockReferenceExpression || - $exprNode instanceof ParentExpression + $exprNode instanceof BlockReferenceExpression + || $exprNode instanceof ParentExpression ) { $exprNode->setAttribute('output', true); @@ -113,7 +113,7 @@ private function optimizePrintNode(Node $node, Environment $env): Node /** * Removes "raw" filters. */ - private function optimizeRawFilter(Node $node, Environment $env): Node + private function optimizeRawFilter(Node $node): Node { if ($node instanceof FilterExpression && 'raw' == $node->getNode('filter')->getAttribute('value')) { return $node->getNode('node'); @@ -125,7 +125,7 @@ private function optimizeRawFilter(Node $node, Environment $env): Node /** * Optimizes "for" tag by removing the "loop" variable creation whenever possible. */ - private function enterOptimizeFor(Node $node, Environment $env): void + private function enterOptimizeFor(Node $node): void { if ($node instanceof ForNode) { // disable the loop variable by default @@ -166,7 +166,7 @@ private function enterOptimizeFor(Node $node, Environment $env): void && 'include' === $node->getAttribute('name') && (!$node->getNode('arguments')->hasNode('with_context') || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') - ) + ) ) { $this->addLoopToAll(); } @@ -175,12 +175,12 @@ private function enterOptimizeFor(Node $node, Environment $env): void elseif ($node instanceof GetAttrExpression && (!$node->getNode('attribute') instanceof ConstantExpression || 'parent' === $node->getNode('attribute')->getAttribute('value') - ) + ) && (true === $this->loops[0]->getAttribute('with_loop') - || ($node->getNode('node') instanceof NameExpression - && 'loop' === $node->getNode('node')->getAttribute('name') - ) - ) + || ($node->getNode('node') instanceof NameExpression + && 'loop' === $node->getNode('node')->getAttribute('name') + ) + ) ) { $this->addLoopToAll(); } @@ -189,7 +189,7 @@ private function enterOptimizeFor(Node $node, Environment $env): void /** * Optimizes "for" tag by removing the "loop" variable creation whenever possible. */ - private function leaveOptimizeFor(Node $node, Environment $env): void + private function leaveOptimizeFor(Node $node): void { if ($node instanceof ForNode) { array_shift($this->loops); diff --git a/upload/system/storage/vendor/twig/twig/src/Parser.php b/upload/system/storage/vendor/twig/twig/src/Parser.php index 4428208fed3..4016a5f39ab 100644 --- a/upload/system/storage/vendor/twig/twig/src/Parser.php +++ b/upload/system/storage/vendor/twig/twig/src/Parser.php @@ -303,10 +303,9 @@ private function filterBodyNodes(Node $node, bool $nested = false): ?Node // check that the body does not contain non-empty output nodes if ( ($node instanceof TextNode && !ctype_space($node->getAttribute('data'))) - || - (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) + || (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) ) { - if (false !== strpos((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { + if (str_contains((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { $t = substr($node->getAttribute('data'), 3); if ('' === $t || ctype_space($t)) { // bypass empty nodes starting with a BOM diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php index 1f2433b4d36..3c0daf1c8d3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php @@ -37,7 +37,7 @@ protected function formatTemplate(Profile $profile, $prefix): string protected function formatNonTemplate(Profile $profile, $prefix): string { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); + return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), self::$colors[$profile->getType()] ?? 'auto', $profile->getName()); } protected function formatTime(Profile $profile, $percent): string diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php index 252ca9b0cf4..7979a23c67a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php @@ -32,7 +32,7 @@ public function __construct(string $template = 'main', string $type = self::ROOT { $this->template = $template; $this->type = $type; - $this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name; + $this->name = str_starts_with($name, '__internal_') ? 'INTERNAL' : $name; $this->enter(); } diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php index 2fc0d01318a..a725aa4f104 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php @@ -94,9 +94,8 @@ public function checkMethodAllowed($obj, $method): void $allowed = false; $method = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); foreach ($this->allowedMethods as $class => $methods) { - if ($obj instanceof $class) { - $allowed = \in_array($method, $methods); - + if ($obj instanceof $class && \in_array($method, $methods)) { + $allowed = true; break; } } @@ -111,9 +110,8 @@ public function checkPropertyAllowed($obj, $property): void { $allowed = false; foreach ($this->allowedProperties as $class => $properties) { - if ($obj instanceof $class) { - $allowed = \in_array($property, \is_array($properties) ? $properties : [$properties]); - + if ($obj instanceof $class && \in_array($property, \is_array($properties) ? $properties : [$properties])) { + $allowed = true; break; } } diff --git a/upload/system/storage/vendor/twig/twig/src/Template.php b/upload/system/storage/vendor/twig/twig/src/Template.php index e04bd04a63e..ffbaae1ea1c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Template.php +++ b/upload/system/storage/vendor/twig/twig/src/Template.php @@ -181,7 +181,7 @@ public function displayBlock($name, array $context, array $blocks = [], $useBloc } throw $e; - } catch (\Exception $e) { + } catch (\Throwable $e) { $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e); $e->guess(); @@ -404,7 +404,7 @@ protected function displayWithErrorHandling(array $context, array $blocks = []) } throw $e; - } catch (\Exception $e) { + } catch (\Throwable $e) { $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e); $e->guess(); diff --git a/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php b/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php index c9c6b07c669..1ecd82251f3 100644 --- a/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php +++ b/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php @@ -35,9 +35,7 @@ public function __construct(Environment $env, Template $template) public function render(array $context = []): string { - // using func_get_args() allows to not expose the blocks argument - // as it should only be used by internal code - return $this->template->render($context, \func_get_args()[1] ?? []); + return $this->template->render($context); } public function display(array $context = []) diff --git a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php index 307302bb624..e97ad417062 100644 --- a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -84,6 +84,7 @@ public function testIntegration($file, $message, $condition, $templates, $except /** * @dataProvider getLegacyTests + * * @group legacy */ public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') @@ -101,7 +102,7 @@ public function getTests($name, $legacyTests = false) continue; } - if ($legacyTests xor false !== strpos($file->getRealpath(), '.legacy.test')) { + if ($legacyTests xor str_contains($file->getRealpath(), '.legacy.test')) { continue; } @@ -257,7 +258,7 @@ protected static function parseTemplates($test) $templates = []; preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER); foreach ($matches as $match) { - $templates[($match[1] ?: 'index.twig')] = $match[2]; + $templates[$match[1] ?: 'index.twig'] = $match[2]; } return $templates; diff --git a/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php b/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php index 3b8b2c86c67..8b1bef776d3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php +++ b/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php @@ -43,7 +43,7 @@ public function assertNodeCompilation($source, Node $node, Environment $environm protected function getCompiler(Environment $environment = null) { - return new Compiler(null === $environment ? $this->getEnvironment() : $environment); + return new Compiler($environment ?? $this->getEnvironment()); } protected function getEnvironment() diff --git a/upload/system/storage/vendor/twig/twig/src/Token.php b/upload/system/storage/vendor/twig/twig/src/Token.php index 53a6cafc350..59279b8fe7c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Token.php +++ b/upload/system/storage/vendor/twig/twig/src/Token.php @@ -35,6 +35,7 @@ final class Token public const INTERPOLATION_START_TYPE = 10; public const INTERPOLATION_END_TYPE = 11; public const ARROW_TYPE = 12; + public const SPREAD_TYPE = 13; public function __construct(int $type, $value, int $lineno) { @@ -67,9 +68,9 @@ public function test($type, $values = null): bool } return ($this->type === $type) && ( - null === $values || - (\is_array($values) && \in_array($this->value, $values)) || - $this->value == $values + null === $values + || (\is_array($values) && \in_array($this->value, $values)) + || $this->value == $values ); } @@ -133,6 +134,9 @@ public static function typeToString(int $type, bool $short = false): string case self::ARROW_TYPE: $name = 'ARROW_TYPE'; break; + case self::SPREAD_TYPE: + $name = 'SPREAD_TYPE'; + break; default: throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); } @@ -171,6 +175,8 @@ public static function typeToEnglish(int $type): string return 'end of string interpolation'; case self::ARROW_TYPE: return 'arrow function'; + case self::SPREAD_TYPE: + return 'spread operator'; default: throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); } diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php index 35098c267b1..31b6cde4148 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php @@ -32,7 +32,7 @@ public function parse(Token $token): Node $stream->expect(/* Token::NAME_TYPE */ 5, 'import'); $targets = []; - do { + while (true) { $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); $alias = $name; @@ -45,7 +45,7 @@ public function parse(Token $token): Node if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { break; } - } while (true); + } $stream->expect(/* Token::BLOCK_END_TYPE */ 3); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php index d0a2de41a2e..3cdbb98ad01 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php @@ -43,7 +43,7 @@ public function parse(Token $token): Node $targets = []; if ($stream->nextIf('with')) { - do { + while (true) { $name = $stream->expect(/* Token::NAME_TYPE */ 5)->getValue(); $alias = $name; @@ -56,7 +56,7 @@ public function parse(Token $token): Node if (!$stream->nextIf(/* Token::PUNCTUATION_TYPE */ 9, ',')) { break; } - } while (true); + } } $stream->expect(/* Token::BLOCK_END_TYPE */ 3); diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php index 94e5f9b012b..8993026c8cb 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php @@ -29,7 +29,7 @@ final class TwigFilter private $arguments = []; /** - * @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array{class-string, string}|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -57,7 +57,7 @@ public function getName(): string /** * Returns the callable to execute for this filter. * - * @return callable|null + * @return callable|array{class-string, string}|null */ public function getCallable() { diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php index 494d45b08c5..d910d1fd531 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php @@ -29,7 +29,7 @@ final class TwigFunction private $arguments = []; /** - * @param callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array{class-string, string}|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -55,7 +55,7 @@ public function getName(): string /** * Returns the callable to execute for this function. * - * @return callable|null + * @return callable|array{class-string, string}|null */ public function getCallable() { diff --git a/upload/system/storage/vendor/twig/twig/src/TwigTest.php b/upload/system/storage/vendor/twig/twig/src/TwigTest.php index 4c18632f559..3769ec162b6 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigTest.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigTest.php @@ -28,7 +28,7 @@ final class TwigTest private $arguments = []; /** - * @param callable|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array{class-string, string}|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -51,7 +51,7 @@ public function getName(): string /** * Returns the callable to execute for this test. * - * @return callable|null + * @return callable|array{class-string, string}|null */ public function getCallable() { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/App.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/App.php index f2cf383ca96..30e1e9c9180 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/App.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/App.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Bill.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Bill.php index 995e906326a..b303d0fdb9f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Bill.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Bill.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; @@ -36,7 +38,7 @@ public function __construct(array $options) /** * 创建数据操作 * @param array $options - * @return mixed + * @return array|bool * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Pos.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Pos.php index 800104e1366..60ce7b646e3 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Pos.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Pos.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; @@ -37,7 +39,7 @@ public function __construct(array $options) /** * 创建数据操作 * @param array $options - * @return mixed + * @return array|bool * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Scan.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Scan.php index df9973c7752..9f6456d8593 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Scan.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Scan.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; @@ -36,7 +38,7 @@ public function __construct(array $options) /** * 创建数据操作 * @param array $options - * @return mixed + * @return array|bool * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Trade.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Trade.php new file mode 100644 index 00000000000..ad4e3f6edb7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Trade.php @@ -0,0 +1,82 @@ +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 + * @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/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Transfer.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Transfer.php index 46e9f21fb3f..2f061a74f2a 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Transfer.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Transfer.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; @@ -27,7 +29,7 @@ class Transfer extends BasicAliPay /** * 旧版 向指定支付宝账户转账 * @param array $options - * @return mixed + * @return array|bool * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ @@ -61,7 +63,6 @@ public function queryResult($options = []) { $this->options->set('method', 'alipay.fund.trans.common.query'); return $this->getResult($options); - } /** diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Wap.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Wap.php index e97ac948e6d..a60591cfff6 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Wap.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Wap.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Web.php b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Web.php index 2ad937cc428..c885efdc587 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Web.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/AliPay/Web.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace AliPay; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/We.php b/upload/system/storage/vendor/zoujingli/wechat-developer/We.php index a81ff1a25a7..7d782530627 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/We.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/We.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- use WeChat\Contracts\DataArray; @@ -23,6 +25,16 @@ * @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\Trade AliPayTrade($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 微信客服消息 @@ -33,7 +45,7 @@ * @method \WeChat\Pay WeChatPay($options = []) static 微信支付商户 * @method \WeChat\Product WeChatProduct($options = []) static 微信商店管理 * @method \WeChat\Qrcode WeChatQrcode($options = []) static 微信二维码管理 - * @method \WeChat\Receive WeChatReceive($options = []) static 微信推送管理 + * @method \WeChat\Receive WeChatReceive($options = [], $showEchoStr = true) static 微信推送管理 * @method \WeChat\Scan WeChatScan($options = []) static 微信扫一扫接入管理 * @method \WeChat\Script WeChatScript($options = []) static 微信前端支持 * @method \WeChat\Shake WeChatShake($options = []) static 微信揺一揺周边 @@ -41,17 +53,26 @@ * @method \WeChat\Template WeChatTemplate($options = []) static 微信模板消息 * @method \WeChat\User WeChatUser($options = []) static 微信粉丝管理 * @method \WeChat\Wifi WeChatWifi($options = []) static 微信门店WIFI管理 + * @method \WeChat\Draft WeChatDraft($options = []) static 微信草稿箱 + * @method \WeChat\Freepublish WeChatFreepublish($options = []) static 微信发布能力 * * ----- WeMini ----- * @method \WeMini\Crypt WeMiniCrypt($options = []) static 小程序数据加密处理 * @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送 + * @method \WeMini\Shipping WeMiniShipping($options = []) satic 小程序发货信息 + * @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\Scheme WeMiniScheme($options = []) static 小程序 URL-Scheme + * @method \WeMini\Search WeMiniSearch($options = []) static 小程序搜索 * @method \WeMini\Security WeMiniSecurity($options = []) static 小程序内容安全 * @method \WeMini\Soter WeMiniSoter($options = []) static 小程序生物认证 * @method \WeMini\Template WeMiniTemplate($options = []) static 小程序模板消息支持 @@ -60,20 +81,13 @@ * ----- WePay ----- * @method \WePay\Bill WePayBill($options = []) static 微信商户账单及评论 * @method \WePay\Order WePayOrder($options = []) static 微信商户订单 - * @method \WePay\Refund WePayRefund($options = []) static 微信商户退款 * @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券 + * @method \WePay\Custom WePayCustom($options = []) static 微信商户海关 + * @method \WePay\Refund WePayRefund($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 支付宝网站支付 + * @method \WePay\ProfitSharing WePayProfitSharing($options = []) static 微信分账 */ class We { @@ -81,7 +95,7 @@ class We * 定义当前版本 * @var string */ - const VERSION = '1.2.17'; + const VERSION = '1.2.54'; /** * 静态配置 @@ -120,6 +134,8 @@ public static function __callStatic($name, $arguments) $class = 'WeMini\\' . substr($name, 6); } elseif (substr($name, 0, 6) === 'AliPay') { $class = 'AliPay\\' . substr($name, 6); + } elseif (substr($name, 0, 7) === 'WePayV3') { + $class = 'WePayV3\\' . substr($name, 7); } elseif (substr($name, 0, 5) === 'WePay') { $class = 'WePay\\' . substr($name, 5); } @@ -131,4 +147,4 @@ public static function __callStatic($name, $arguments) throw new InvalidInstanceException("class {$name} not found"); } -} \ No newline at end of file +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Card.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Card.php index b392781eb1b..436024b0f10 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Card.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Card.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -33,38 +35,35 @@ class Card extends BasicWeChat public function create(array $data) { $url = "https://api.weixin.qq.com/card/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 设置买单接口 - * @param string $card_id - * @param bool $is_open + * @param string $cardId + * @param bool $isOpen * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function setPaycell($card_id, $is_open = true) + public function setPaycell($cardId, $isOpen = true) { $url = "https://api.weixin.qq.com/card/paycell/set?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'is_open' => $is_open]); + return $this->callPostApi($url, ['card_id' => $cardId, 'is_open' => $isOpen]); } /** * 设置自助核销接口 - * @param string $card_id - * @param bool $is_open + * @param string $cardId + * @param bool $isOpen * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function setConsumeCell($card_id, $is_open = true) + public function setConsumeCell($cardId, $isOpen = true) { $url = "https://api.weixin.qq.com/card/selfconsumecell/set?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'is_open' => $is_open]); + return $this->callPostApi($url, ['card_id' => $cardId, 'is_open' => $isOpen]); } /** @@ -77,8 +76,7 @@ public function setConsumeCell($card_id, $is_open = true) public function createQrc(array $data) { $url = "https://api.weixin.qq.com/card/qrcode/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -91,66 +89,61 @@ public function createQrc(array $data) public function createLandingPage(array $data) { $url = "https://api.weixin.qq.com/card/landingpage/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 导入自定义code - * @param string $card_id + * @param string $cardId * @param array $code * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function deposit($card_id, array $code) + public function deposit($cardId, array $code) { $url = "https://api.weixin.qq.com/card/code/deposit?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'code' => $code]); + return $this->callPostApi($url, ['card_id' => $cardId, 'code' => $code]); } /** * 查询导入code数目 - * @param string $card_id + * @param string $cardId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getDepositCount($card_id) + public function getDepositCount($cardId) { $url = "https://api.weixin.qq.com/card/code/getdepositcount?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id]); + return $this->callPostApi($url, ['card_id' => $cardId]); } /** * 核查code接口 - * @param string $card_id 进行导入code的卡券ID + * @param string $cardId 进行导入code的卡券ID * @param array $code 已经微信卡券后台的自定义code,上限为100个 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function checkCode($card_id, array $code) + public function checkCode($cardId, array $code) { $url = "https://api.weixin.qq.com/card/code/checkcode?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'code' => $code]); + return $this->callPostApi($url, ['card_id' => $cardId, 'code' => $code]); } /** * 图文消息群发卡券 - * @param string $card_id + * @param string $cardId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getNewsHtml($card_id) + public function getNewsHtml($cardId) { $url = "https://api.weixin.qq.com/card/mpnews/gethtml?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id]); + return $this->callPostApi($url, ['card_id' => $cardId]); } /** @@ -164,27 +157,25 @@ public function getNewsHtml($card_id) public function setTestWhiteList($openids = [], $usernames = []) { $url = "https://api.weixin.qq.com/card/testwhitelist/set?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid' => $openids, 'username' => $usernames]); + return $this->callPostApi($url, ['openid' => $openids, 'username' => $usernames]); } /** * 线下核销查询Code * @param string $code 单张卡券的唯一标准 - * @param string $card_id 卡券ID代表一类卡券。自定义code卡券必填 - * @param bool $check_consume 是否校验code核销状态,填入true和false时的code异常状态返回数据不同 + * @param string $cardId 卡券ID代表一类卡券。自定义code卡券必填 + * @param bool $checkConsume 是否校验code核销状态,填入true和false时的code异常状态返回数据不同 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCode($code, $card_id = null, $check_consume = null) + public function getCode($code, $cardId = null, $checkConsume = null) { $data = ['code' => $code]; - is_null($card_id) || $data['card_id'] = $card_id; - is_null($check_consume) || $data['check_consume'] = $check_consume; + is_null($cardId) || $data['card_id'] = $cardId; + is_null($checkConsume) || $data['check_consume'] = $checkConsume; $url = "https://api.weixin.qq.com/card/code/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -200,86 +191,80 @@ public function consume($code, $card_id = null) $data = ['code' => $code]; is_null($card_id) || $data['card_id'] = $card_id; $url = "https://api.weixin.qq.com/card/code/consume?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * Code解码接口 - * @param string $encrypt_code + * @param string $encryptCode * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function decrypt($encrypt_code) + public function decrypt($encryptCode) { $url = "https://api.weixin.qq.com/card/code/decrypt?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['encrypt_code' => $encrypt_code]); + return $this->callPostApi($url, ['encrypt_code' => $encryptCode]); } /** * 获取用户已领取卡券接口 * @param string $openid - * @param null|string $card_id + * @param null|string $cardId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardList($openid, $card_id = null) + public function getCardList($openid, $cardId = null) { $data = ['openid' => $openid]; - is_null($card_id) || $data['card_id'] = $card_id; + is_null($cardId) || $data['card_id'] = $cardId; $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查看卡券详情 - * @param string $card_id + * @param string $cardId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCard($card_id) + public function getCard($cardId) { $url = "https://api.weixin.qq.com/card/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id]); + return $this->callPostApi($url, ['card_id' => $cardId]); } /** * 批量查询卡券列表 * @param int $offset 查询卡列表的起始偏移量,从0开始,即offset: 5是指从从列表里的第六个开始读取 * @param int $count 需要查询的卡片的数量(数量最大50) - * @param array $status_list 支持开发者拉出指定状态的卡券列表 + * @param array $statusList 支持开发者拉出指定状态的卡券列表 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function batchGet($offset, $count = 50, array $status_list = []) + public function batchGet($offset, $count = 50, array $statusList = []) { $data = ['offset' => $offset, 'count' => $count]; - empty($status_list) || $data['status_list'] = $status_list; + empty($statusList) || $data['status_list'] = $statusList; $url = "https://api.weixin.qq.com/card/batchget?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 更改卡券信息接口 - * @param string $card_id - * @param array $member_card + * @param string $cardId + * @param array $memberCard * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function updateCard($card_id, array $member_card) + public function updateCard($cardId, array $memberCard) { $url = "https://api.weixin.qq.com/card/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'member_card' => $member_card]); + return $this->callPostApi($url, ['card_id' => $cardId, 'member_card' => $memberCard]); } /** @@ -294,11 +279,10 @@ public function updateCard($card_id, array $member_card) public function modifyStock($card_id, $increase_stock_value = null, $reduce_stock_value = null) { $data = ['card_id' => $card_id]; - is_null($increase_stock_value) || $data['increase_stock_value'] = $increase_stock_value; is_null($reduce_stock_value) || $data['reduce_stock_value'] = $reduce_stock_value; + is_null($increase_stock_value) || $data['increase_stock_value'] = $increase_stock_value; $url = "https://api.weixin.qq.com/card/modifystock?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -315,76 +299,71 @@ public function updateCode($code, $new_code, $card_id = null) $data = ['code' => $code, 'new_code' => $new_code]; is_null($card_id) || $data['card_id'] = $card_id; $url = "https://api.weixin.qq.com/card/code/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 删除卡券接口 - * @param string $card_id + * @param string $cardId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function deleteCard($card_id) + public function deleteCard($cardId) { $url = "https://api.weixin.qq.com/card/delete?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id]); + return $this->callPostApi($url, ['card_id' => $cardId]); } /** * 设置卡券失效接口 * @param string $code - * @param string $card_id + * @param string $cardId * @param null|string $reason * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function unAvailable($code, $card_id, $reason = null) + public function unAvailable($code, $cardId, $reason = null) { - $data = ['code' => $code, 'card_id' => $card_id]; + $data = ['code' => $code, 'card_id' => $cardId]; is_null($reason) || $data['reason'] = $reason; $url = "https://api.weixin.qq.com/card/code/unavailable?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 拉取卡券概况数据接口 - * @param string $begin_date 查询数据的起始时间 - * @param string $end_date 查询数据的截至时间 - * @param string $cond_source 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据) + * @param string $beginDate 查询数据的起始时间 + * @param string $endDate 查询数据的截至时间 + * @param string $condSource 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据) * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardBizuininfo($begin_date, $end_date, $cond_source) + public function getCardBizuininfo($beginDate, $endDate, $condSource) { - $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'cond_source' => $cond_source]; $url = "https://api.weixin.qq.com/datacube/getcardbizuininfo?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['begin_date' => $beginDate, 'end_date' => $endDate, 'cond_source' => $condSource]; + return $this->callPostApi($url, $data); } /** * 获取免费券数据接口 - * @param string $begin_date 查询数据的起始时间 - * @param string $end_date 查询数据的截至时间 - * @param integer $cond_source 卡券来源,0为公众平台创建的卡券数据、1是API创建的卡券数据 - * @param null $card_id 卡券ID + * @param string $beginDate 查询数据的起始时间 + * @param string $endDate 查询数据的截至时间 + * @param integer $condSource 卡券来源,0为公众平台创建的卡券数据、1是API创建的卡券数据 + * @param null $cardId 卡券ID * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardCardinfo($begin_date, $end_date, $cond_source, $card_id = null) + public function getCardCardinfo($beginDate, $endDate, $condSource, $cardId = null) { - $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'cond_source' => $cond_source]; - is_null($card_id) || $data['card_id'] = $card_id; $url = "https://api.weixin.qq.com/datacube/getcardcardinfo?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['begin_date' => $beginDate, 'end_date' => $endDate, 'cond_source' => $condSource]; + is_null($cardId) || $data['card_id'] = $cardId; + return $this->callPostApi($url, $data); } @@ -398,8 +377,7 @@ public function getCardCardinfo($begin_date, $end_date, $cond_source, $card_id = public function activateMemberCard(array $data) { $url = 'https://api.weixin.qq.com/card/membercard/activate?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -413,23 +391,21 @@ public function activateMemberCard(array $data) public function setActivateMemberCardUser(array $data) { $url = 'https://api.weixin.qq.com/card/membercard/activateuserform/set?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 获取用户提交资料 * 根据activate_ticket获取到用户填写的信息 - * @param string $activate_ticket + * @param string $activateTicket * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getActivateMemberCardTempinfo($activate_ticket) + public function getActivateMemberCardTempinfo($activateTicket) { $url = 'https://api.weixin.qq.com/card/membercard/activatetempinfo/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['activate_ticket' => $activate_ticket]); + return $this->callPostApi($url, ['activate_ticket' => $activateTicket]); } /** @@ -442,58 +418,54 @@ public function getActivateMemberCardTempinfo($activate_ticket) public function updateMemberCardUser(array $data) { $url = 'https://api.weixin.qq.com/card/membercard/updateuser?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 拉取会员卡概况数据接口 - * @param string $begin_date 查询数据的起始时间 - * @param string $end_date 查询数据的截至时间 - * @param string $cond_source 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据) + * @param string $beginDate 查询数据的起始时间 + * @param string $endDate 查询数据的截至时间 + * @param string $condSource 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据) * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardMemberCardinfo($begin_date, $end_date, $cond_source) + public function getCardMemberCardinfo($beginDate, $endDate, $condSource) { - $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'cond_source' => $cond_source]; $url = "https://api.weixin.qq.com/datacube/getcardmembercardinfo?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['begin_date' => $beginDate, 'end_date' => $endDate, 'cond_source' => $condSource]; + return $this->callPostApi($url, $data); } /** * 拉取单张会员卡数据接口 - * @param string $begin_date 查询数据的起始时间 - * @param string $end_date 查询数据的截至时间 - * @param string $card_id 卡券id + * @param string $beginDate 查询数据的起始时间 + * @param string $endDate 查询数据的截至时间 + * @param string $cardId 卡券id * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardMemberCardDetail($begin_date, $end_date, $card_id) + public function getCardMemberCardDetail($beginDate, $endDate, $cardId) { - $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'card_id' => $card_id]; $url = "https://api.weixin.qq.com/datacube/getcardmembercarddetail?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['begin_date' => $beginDate, 'end_date' => $endDate, 'card_id' => $cardId]; + return $this->callPostApi($url, $data); } /** * 拉取会员信息(积分查询)接口 - * @param string $card_id 查询会员卡的cardid + * @param string $cardId 查询会员卡的cardid * @param string $code 所查询用户领取到的code值 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getCardMemberCard($card_id, $code) + public function getCardMemberCard($cardId, $code) { - $data = ['card_id' => $card_id, 'code' => $code]; + $data = ['card_id' => $cardId, 'code' => $code]; $url = "https://api.weixin.qq.com/card/membercard/userinfo/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -506,36 +478,33 @@ public function getCardMemberCard($card_id, $code) public function payGiftCard(array $data) { $url = "https://api.weixin.qq.com/card/paygiftcard/add?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 删除支付后投放卡券规则 - * @param integer $rule_id 支付即会员的规则名称 + * @param integer $ruleId 支付即会员的规则名称 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function delPayGiftCard($rule_id) + public function delPayGiftCard($ruleId) { $url = "https://api.weixin.qq.com/card/paygiftcard/add?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['rule_id' => $rule_id]); + return $this->callPostApi($url, ['rule_id' => $ruleId]); } /** * 查询支付后投放卡券规则详情 - * @param integer $rule_id 要查询规则id + * @param integer $ruleId 要查询规则id * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getPayGiftCard($rule_id) + public function getPayGiftCard($ruleId) { $url = "https://api.weixin.qq.com/card/paygiftcard/getbyid?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['rule_id' => $rule_id]); + return $this->callPostApi($url, ['rule_id' => $ruleId]); } /** @@ -549,10 +518,9 @@ public function getPayGiftCard($rule_id) */ public function batchGetPayGiftCard($offset = 0, $count = 10, $effective = true) { - $data = ['type' => 'RULE_TYPE_PAY_MEMBER_CARD', 'offset' => $offset, 'count' => $count, 'effective' => $effective]; $url = "https://api.weixin.qq.com/card/paygiftcard/batchget?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['type' => 'RULE_TYPE_PAY_MEMBER_CARD', 'offset' => $offset, 'count' => $count, 'effective' => $effective]; + return $this->callPostApi($url, $data); } /** @@ -565,8 +533,7 @@ public function batchGetPayGiftCard($offset = 0, $count = 10, $effective = true) public function addActivity(array $data) { $url = "https://api.weixin.qq.com/card/mkt/activity/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -578,23 +545,21 @@ public function addActivity(array $data) public function payActivate() { $url = "https://api.weixin.qq.com/card/pay/activate?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 对优惠券批价 - * @param string $card_id 需要来配置库存的card_id + * @param string $cardId 需要来配置库存的card_id * @param integer $quantity 本次需要兑换的库存数目 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getPayprice($card_id, $quantity) + public function getPayprice($cardId, $quantity) { $url = "POST https://api.weixin.qq.com/card/pay/getpayprice?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['card_id' => $card_id, 'quantity' => $quantity]); + return $this->callPostApi($url, ['card_id' => $cardId, 'quantity' => $quantity]); } /** @@ -606,53 +571,49 @@ public function getPayprice($card_id, $quantity) public function getCoinsInfo() { $url = "https://api.weixin.qq.com/card/pay/getcoinsinfo?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 确认兑换库存接口 - * @param string $card_id 需要来兑换库存的card_id + * @param string $cardId 需要来兑换库存的card_id * @param integer $quantity 本次需要兑换的库存数目 - * @param string $order_id 仅可以使用上面得到的订单号,保证批价有效性 + * @param string $orderId 仅可以使用上面得到的订单号,保证批价有效性 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function payConfirm($card_id, $quantity, $order_id) + public function payConfirm($cardId, $quantity, $orderId) { - $data = ['card_id' => $card_id, 'quantity' => $quantity, 'order_id' => $order_id]; $url = "https://api.weixin.qq.com/card/pay/confirm?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['card_id' => $cardId, 'quantity' => $quantity, 'order_id' => $orderId]; + return $this->callPostApi($url, $data); } /** * 充值券点接口 - * @param integer $coin_count + * @param integer $coinCount * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function payRecharge($coin_count) + public function payRecharge($coinCount) { $url = "https://api.weixin.qq.com/card/pay/recharge?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['coin_count' => $coin_count]); + return $this->callPostApi($url, ['coin_count' => $coinCount]); } /** * 查询订单详情接口 - * @param string $order_id + * @param string $orderId * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function payGetOrder($order_id) + public function payGetOrder($orderId) { $url = "https://api.weixin.qq.com/card/pay/getorder?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['order_id' => $order_id]); + return $this->callPostApi($url, ['order_id' => $orderId]); } /** @@ -665,8 +626,6 @@ public function payGetOrder($order_id) public function payGetList(array $data) { $url = "https://api.weixin.qq.com/card/pay/getorderlist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php index b2d320acf49..6fe3cbf94ef 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicAliPay.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -61,20 +63,26 @@ abstract class BasicAliPay */ public function __construct($options) { - $this->params = new DataArray([]); - $this->config = new DataArray($options); if (empty($options['appid'])) { - throw new InvalidArgumentException("Missing Config -- [appid]"); + throw new InvalidArgumentException('Missing Config -- [appid]'); + } + if (empty($options['public_key']) && !empty($options['alipay_cert_path']) && is_file($options['alipay_cert_path'])) { + $options['public_key'] = file_get_contents($options['alipay_cert_path']); + } + if (empty($options['private_key']) && !empty($options['private_key_path']) && is_file($options['private_key_path'])) { + $options['private_key'] = file_get_contents($options['private_key_path']); } if (empty($options['public_key'])) { - throw new InvalidArgumentException("Missing Config -- [public_key]"); + throw new InvalidArgumentException('Missing Config -- [public_key]'); } if (empty($options['private_key'])) { - throw new InvalidArgumentException("Missing Config -- [private_key]"); + throw new InvalidArgumentException('Missing Config -- [private_key]'); } if (!empty($options['debug'])) { - $this->gateway = 'https://openapi.alipaydev.com/gateway.do?charset=utf-8'; + $this->gateway = 'https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8'; } + $this->params = new DataArray([]); + $this->config = new DataArray($options); $this->options = new DataArray([ 'app_id' => $this->config->get('appid'), 'charset' => empty($options['charset']) ? 'utf-8' : $options['charset'], @@ -92,6 +100,16 @@ public function __construct($options) if (isset($options['app_auth_token']) && $options['app_auth_token'] !== '') { $this->options->set('app_auth_token', $options['app_auth_token']); } + + // 证书模式读取证书 + $appCertPath = $this->config->get('app_cert_path'); + $aliRootPath = $this->config->get('alipay_root_path'); + if (!$this->config->get('app_cert') && !empty($appCertPath) && is_file($appCertPath)) { + $this->config->set('app_cert', file_get_contents($appCertPath)); + } + if (!$this->config->get('root_cert') && !empty($aliRootPath) && is_file($aliRootPath)) { + $this->config->set('root_cert', file_get_contents($aliRootPath)); + } } /** @@ -108,28 +126,28 @@ public static function instance(array $config) /** * 查询支付宝订单状态 - * @param string $out_trade_no + * @param string $outTradeNo * @return array|boolean - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function query($out_trade_no = '') + public function query($outTradeNo = '') { $this->options->set('method', 'alipay.trade.query'); - return $this->getResult(['out_trade_no' => $out_trade_no]); + return $this->getResult(['out_trade_no' => $outTradeNo]); } /** * 支付宝订单退款操作 * @param array|string $options 退款参数或退款商户订单号 - * @param null $refund_amount 退款金额 + * @param null $refundAmount 退款金额 * @return array|boolean - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function refund($options, $refund_amount = null) + public function refund($options, $refundAmount = null) { - if (!is_array($options)) $options = ['out_trade_no' => $options, 'refund_amount' => $refund_amount]; + if (!is_array($options)) $options = ['out_trade_no' => $options, 'refund_amount' => $refundAmount]; $this->options->set('method', 'alipay.trade.refund'); return $this->getResult($options); } @@ -138,7 +156,7 @@ public function refund($options, $refund_amount = null) * 关闭支付宝进行中的订单 * @param array|string $options * @return array|boolean - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function close($options) @@ -150,20 +168,21 @@ public function close($options) /** * 获取通知数据 + * * @param boolean $needSignType 是否需要sign_type字段 - * @return boolean|array - * @throws InvalidResponseException + * @param array $parameters + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException */ - public function notify($needSignType = false) + public function notify($needSignType = false, array $parameters = []) { - $data = $_POST; + $data = empty($parameters) ? $_POST : $parameters; + if (empty($data) || empty($data['sign'])) { throw new InvalidResponseException('Illegal push request.', 0, $data); } $string = $this->getSignContent($data, $needSignType); - $content = wordwrap($this->config->get('public_key'), 64, "\n", true); - $res = "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----"; - if (openssl_verify($string, base64_decode($data['sign']), $res, OPENSSL_ALGO_SHA256) !== 1) { + if (openssl_verify($string, base64_decode($data['sign']), $this->getAliPublicKey(), OPENSSL_ALGO_SHA256) !== 1) { throw new InvalidResponseException('Data signature verification failed.', 0, $data); } return $data; @@ -173,20 +192,19 @@ public function notify($needSignType = false) * 验证接口返回的数据签名 * @param array $data 通知数据 * @param null|string $sign 数据签名 - * @return array|boolean - * @throws InvalidResponseException + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException */ protected function verify($data, $sign) { - $content = wordwrap($this->config->get('public_key'), 64, "\n", true); - $res = "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----"; + unset($data['sign']); if ($this->options->get('sign_type') === 'RSA2') { - if (openssl_verify(json_encode($data, 256), base64_decode($sign), $res, OPENSSL_ALGO_SHA256) !== 1) { - throw new InvalidResponseException('Data signature verification failed.'); + if (openssl_verify(json_encode($data, 256), base64_decode($sign), $this->getAliPublicKey(), OPENSSL_ALGO_SHA256) !== 1) { + throw new InvalidResponseException('Data signature verification failed by RSA2.'); } } else { - if (openssl_verify(json_encode($data, 256), base64_decode($sign), $res, OPENSSL_ALGO_SHA1) !== 1) { - throw new InvalidResponseException('Data signature verification failed.'); + if (openssl_verify(json_encode($data, 256), base64_decode($sign), $this->getAliPublicKey(), OPENSSL_ALGO_SHA1) !== 1) { + throw new InvalidResponseException('Data signature verification failed by RSA.'); } } return $data; @@ -198,21 +216,29 @@ protected function verify($data, $sign) */ protected function getSign() { - $content = wordwrap($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); + openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA256); } else { - openssl_sign($this->getSignContent($this->options->get(), true), $sign, $string, OPENSSL_ALGO_SHA1); + openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA1); } return base64_encode($sign); } + /** + * 去除证书前后内容及空白 + * @param string $sign + * @return string + */ + protected function trimCert($sign) + { + return preg_replace(['/\s+/', '/-{5}.*?-{5}/'], '', $sign); + } + /** * 数据签名处理 * @param array $data 需要进行签名数据 * @param boolean $needSignType 是否需要sign_type字段 - * @return bool|string + * @return string */ private function getSignContent(array $data, $needSignType = false) { @@ -221,7 +247,7 @@ private function getSignContent(array $data, $needSignType = false) if (empty($needSignType)) unset($data['sign_type']); foreach ($data as $key => $value) { if ($value === '' || is_null($value)) continue; - array_push($attrs, "{$key}={$value}"); + $attrs[] = "{$key}={$value}"; } return join('&', $attrs); } @@ -232,6 +258,9 @@ private function getSignContent(array $data, $needSignType = false) */ protected function applyData($options) { + if ($this->config->get('app_cert') && $this->config->get('root_cert')) { + $this->setAppCertSnAndRootCertSn(); + } $this->options->set('biz_content', json_encode($this->params->merge($options), 256)); $this->options->set('sign', $this->getSign()); } @@ -240,7 +269,7 @@ protected function applyData($options) * 请求接口并验证访问数据 * @param array $options * @return array|boolean - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ protected function getResult($options) @@ -257,7 +286,7 @@ protected function getResult($options) ); } return $data[$method]; - // 去除返回结果签名检查 + // 返回结果签名检查 // return $this->verify($data[$method], $data['sign']); } @@ -276,11 +305,124 @@ protected function buildPayHtml() return "{$html}"; } + /** + * 获取应用私钥内容 + * @return string + */ + private function getAppPrivateKey() + { + $content = wordwrap($this->trimCert($this->config->get('private_key')), 64, "\n", true); + return "-----BEGIN RSA PRIVATE KEY-----\n{$content}\n-----END RSA PRIVATE KEY-----"; + } + + /** + * 获取支付公钥内容 + * @return string + */ + public function getAliPublicKey() + { + $cert = $this->config->get('public_key'); + if (strpos(trim($cert), '-----BEGIN CERTIFICATE-----') !== false) { + $pkey = openssl_pkey_get_public($cert); + $keyData = openssl_pkey_get_details($pkey); + return trim($keyData['key']); + } else { + $content = wordwrap($this->trimCert($cert), 64, "\n", true); + return "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----"; + } + } + + /** + * 新版 从证书中提取序列号 + * @param string $sign + * @return string + */ + private function getAppCertSN($sign) + { + $ssl = openssl_x509_parse($sign, true); + return md5($this->_arr2str(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); + } + + /** + * 新版 提取根证书序列号 + * @param string $sign + * @return string|null + */ + private function getRootCertSN($sign) + { + $sn = null; + $array = explode('-----END CERTIFICATE-----', $sign); + for ($i = 0; $i < count($array) - 1; $i++) { + $ssl[$i] = openssl_x509_parse($array[$i] . '-----END CERTIFICATE-----', true); + if (strpos($ssl[$i]['serialNumber'], '0x') === 0) { + $ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumberHex']); + } + 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; + } + + /** + * 新版 设置网关应用公钥证书SN、支付宝根证书SN + */ + protected function setAppCertSnAndRootCertSn() + { + if (!($appCert = $this->config->get('app_cert'))) { + throw new InvalidArgumentException('Missing Config -- [app_cert|app_cert_path]'); + } + if (!($rootCert = $this->config->get('root_cert'))) { + throw new InvalidArgumentException('Missing Config -- [root_cert|alipay_root_path]'); + } + $this->options->set('app_cert_sn', $this->getAppCertSN($appCert)); + $this->options->set('alipay_root_cert_sn', $this->getRootCertSN($rootCert)); + 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]'); + } + } + + /** + * 新版 数组转字符串 + * @param array $array + * @return string + */ + private function _arr2str($array) + { + $string = []; + if ($array && is_array($array)) { + foreach ($array as $key => $value) { + $string[] = $key . '=' . $value; + } + } + return join(',', $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 * @return mixed */ abstract public function apply($options); - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicPushEvent.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicPushEvent.php index c21e6e492f7..85936931c0f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicPushEvent.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicPushEvent.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -17,6 +19,7 @@ use WeChat\Exceptions\InvalidArgumentException; use WeChat\Exceptions\InvalidDecryptException; use WeChat\Exceptions\InvalidResponseException; +use WeChat\Prpcrypt\Prpcrypt; /** * 微信通知处理基本类 @@ -69,10 +72,11 @@ class BasicPushEvent /** * BasicPushEvent constructor. - * @param array $options - * @throws InvalidResponseException + * @param array $options 配置参数 + * @param boolean $showEchoStr 回显内容 + * @throws \WeChat\Exceptions\InvalidResponseException */ - public function __construct(array $options) + public function __construct(array $options, $showEchoStr = true) { if (empty($options['appid'])) { throw new InvalidArgumentException("Missing Config -- [appid]"); @@ -89,16 +93,13 @@ public function __construct(array $options) $this->appid = $this->config->get('appid'); // 推送消息处理 if ($_SERVER['REQUEST_METHOD'] == "POST") { - $this->postxml = file_get_contents("php://input"); + $this->postxml = Tools::getRawInput(); $this->encryptType = $this->input->get('encrypt_type'); if ($this->isEncrypt()) { if (empty($options['encodingaeskey'])) { throw new InvalidArgumentException("Missing Config -- [encodingaeskey]"); } - if (!class_exists('Prpcrypt', false)) { - require __DIR__ . '/Prpcrypt.php'; - } - $prpcrypt = new \Prpcrypt($this->config->get('encodingaeskey')); + $prpcrypt = new Prpcrypt($this->config->get('encodingaeskey')); $result = Tools::xml2arr($this->postxml); $array = $prpcrypt->decrypt($result['Encrypt']); if (intval($array[0]) > 0) { @@ -108,13 +109,28 @@ public function __construct(array $options) } $this->receive = new DataArray(Tools::xml2arr($this->postxml)); } elseif ($_SERVER['REQUEST_METHOD'] == "GET" && $this->checkSignature()) { - @ob_clean(); - exit($this->input->get('echostr')); + $this->receive = new DataArray([]); + if ($showEchoStr && ob_clean()) { + echo($this->input->get('echostr')); + } } else { throw new InvalidResponseException('Invalid interface request.', '0'); } } + /** + * 获取回显字串 + * @return string + */ + public function getEchoStr() + { + if ($_SERVER['REQUEST_METHOD'] == "GET" && $this->checkSignature()) { + return $this->input->get('echostr'); + } else { + return ''; + } + } + /** * 消息是否需要加密 * @return boolean @@ -129,17 +145,14 @@ public function isEncrypt() * @param array $data 消息内容 * @param boolean $return 是否返回XML内容 * @param boolean $isEncrypt 是否加密内容 - * @return string - * @throws InvalidDecryptException + * @return string|void + * @throws \WeChat\Exceptions\InvalidDecryptException */ public function reply(array $data = [], $return = false, $isEncrypt = false) { $xml = Tools::arr2xml(empty($data) ? $this->message : $data); if ($this->isEncrypt() || $isEncrypt) { - if (!class_exists('Prpcrypt', false)) { - require __DIR__ . '/Prpcrypt.php'; - } - $prpcrypt = new \Prpcrypt($this->config->get('encodingaeskey')); + $prpcrypt = new Prpcrypt($this->config->get('encodingaeskey')); // 如果是第三方平台,加密得使用 component_appid $component_appid = $this->config->get('component_appid'); $appid = empty($component_appid) ? $this->appid : $component_appid; @@ -160,16 +173,15 @@ public function reply(array $data = [], $return = false, $isEncrypt = false) /** * 验证来自微信服务器 - * @param string $str * @return bool */ - private function checkSignature($str = '') + private function checkSignature() { $nonce = $this->input->get('nonce'); $timestamp = $this->input->get('timestamp'); $msg_signature = $this->input->get('msg_signature'); $signature = empty($msg_signature) ? $this->input->get('signature') : $msg_signature; - $tmpArr = [$this->config->get('token'), $timestamp, $nonce, $str]; + $tmpArr = [$this->config->get('token'), $timestamp, $nonce, '']; sort($tmpArr, SORT_STRING); return sha1(implode($tmpArr)) === $signature; } diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php index 81c36455945..09cb1bea3ca 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -94,7 +96,7 @@ public static function instance(array $config) } /** - * 获取访问accessToken + * 获取访问 AccessToken * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -128,21 +130,21 @@ public function getAccessToken() /** * 设置外部接口 AccessToken - * @param string $access_token + * @param string $accessToken * @throws \WeChat\Exceptions\LocalCacheException * @author 高一平 * - * 当用户使用自己的缓存驱动时,直接实例化对象后可直接设置 AccessToekn + * 当用户使用自己的缓存驱动时,直接实例化对象后可直接设置 AccessToken * - 多用于分布式项目时保持 AccessToken 统一 - * - 使用此方法后就由用户来保证传入的 AccessToekn 为有效 AccessToekn + * - 使用此方法后就由用户来保证传入的 AccessToken 为有效 AccessToken */ - public function setAccessToken($access_token) + public function setAccessToken($accessToken) { - if (!is_string($access_token)) { + if (!is_string($accessToken)) { throw new InvalidArgumentException("Invalid AccessToken type, need string."); } $cache = $this->config->get('appid') . '_access_token'; - Tools::setCache($cache, $this->access_token = $access_token); + Tools::setCache($cache, $this->access_token = $accessToken); } /** @@ -159,22 +161,21 @@ public function delAccessToken() * 以GET获取接口数据并转为数组 * @param string $url 接口地址 * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ protected function httpGetForJson($url) { try { return Tools::json2arr(Tools::get($url)); - } catch (InvalidResponseException $e) { + } catch (InvalidResponseException $exception) { if (isset($this->currentMethod['method']) && empty($this->isTry)) { - if (in_array($e->getCode(), ['40014', '40001', '41001', '42001'])) { - $this->delAccessToken(); - $this->isTry = true; + if (in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) { + [$this->delAccessToken(), $this->isTry = true]; return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); } } - throw new InvalidResponseException($e->getMessage(), $e->getCode()); + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); } } @@ -184,19 +185,21 @@ protected function httpGetForJson($url) * @param array $data 请求数据 * @param bool $buildToJson * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ protected function httpPostForJson($url, array $data, $buildToJson = true) { try { - return Tools::json2arr(Tools::post($url, $buildToJson ? Tools::arr2json($data) : $data)); - } catch (InvalidResponseException $e) { - if (!$this->isTry && in_array($e->getCode(), ['40014', '40001', '41001', '42001'])) { + $options = []; + if ($buildToJson) $options['headers'] = ['Content-Type: application/json']; + return Tools::json2arr(Tools::post($url, $buildToJson ? Tools::arr2json($data) : $data, $options)); + } catch (InvalidResponseException $exception) { + if (!$this->isTry && in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) { [$this->delAccessToken(), $this->isTry = true]; return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); } - throw new InvalidResponseException($e->getMessage(), $e->getCode()); + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); } } @@ -205,17 +208,15 @@ protected function httpPostForJson($url, array $data, $buildToJson = true) * @param string $url 接口地址 * @param string $method 当前接口方法 * @param array $arguments 请求参数 - * @return mixed + * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ protected function registerApi(&$url, $method, $arguments = []) { $this->currentMethod = ['method' => $method, 'arguments' => $arguments]; - if (empty($this->access_token)) { - $this->access_token = $this->getAccessToken(); - } - return $url = str_replace('ACCESS_TOKEN', $this->access_token, $url); + if (empty($this->access_token)) $this->access_token = $this->getAccessToken(); + return $url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url); } /** @@ -224,7 +225,7 @@ protected function registerApi(&$url, $method, $arguments = []) * @param array $data POST提交接口参数 * @param bool $isBuildJson * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function callPostApi($url, array $data, $isBuildJson = true) @@ -237,7 +238,7 @@ public function callPostApi($url, array $data, $isBuildJson = true) * 接口通用GET请求方法 * @param string $url 接口URL * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function callGetApi($url) diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWePay.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWePay.php index 55a70800456..5697485ad53 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWePay.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWePay.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -90,12 +92,13 @@ public static function instance(array $config) /** * 获取微信支付通知 + * @param string $xml * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException */ - public function getNotify() + public function getNotify($xml = '') { - $data = Tools::xml2arr(file_get_contents('php://input')); + $data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml); if (isset($data['sign']) && $this->getPaySign($data) === $data['sign']) { return $data; } @@ -122,7 +125,10 @@ public function getPaySign(array $data, $signType = 'MD5', $buff = '') { ksort($data); if (isset($data['sign'])) unset($data['sign']); - foreach ($data as $k => $v) $buff .= "{$k}={$v}&"; + foreach ($data as $k => $v) { + if ('' === $v || null === $v) continue; + $buff .= "{$k}={$v}&"; + } $buff .= ("key=" . $this->config->get('mch_key')); if (strtoupper($signType) === 'MD5') { return strtoupper(md5($buff)); @@ -134,7 +140,7 @@ public function getPaySign(array $data, $signType = 'MD5', $buff = '') * 转换短链接 * @param string $longUrl 需要转换的URL,签名用原串,传输需URLencode * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function shortUrl($longUrl) @@ -143,34 +149,32 @@ public function shortUrl($longUrl) return $this->callPostApi($url, ['long_url' => $longUrl]); } - /** * 数组直接转xml数据输出 * @param array $data * @param bool $isReturn - * @return string + * @return string|void */ public function toXml(array $data, $isReturn = false) { $xml = Tools::arr2xml($data); - if ($isReturn) { - return $xml; - } + if ($isReturn) return $xml; echo $xml; } /** - * 以Post请求接口 + * 以 Post 请求接口 * @param string $url 请求 * @param array $data 接口参数 * @param bool $isCert 是否需要使用双向证书 * @param string $signType 数据签名类型 MD5|SHA256 * @param bool $needSignType 是否需要传签名类型参数 + * @param bool $needNonceStr * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - protected function callPostApi($url, array $data, $isCert = false, $signType = 'HMAC-SHA256', $needSignType = true) + protected function callPostApi($url, array $data, $isCert = false, $signType = 'HMAC-SHA256', $needSignType = true, $needNonceStr = true) { $option = []; if ($isCert) { @@ -192,7 +196,8 @@ protected function callPostApi($url, array $data, $isCert = false, $signType = ' } } $params = $this->params->merge($data); - $needSignType && ($params['sign_type'] = strtoupper($signType)); + if (!$needNonceStr) unset($params['nonce_str']); + if ($needSignType) $params['sign_type'] = strtoupper($signType); $params['sign'] = $this->getPaySign($params, $signType); $result = Tools::xml2arr(Tools::post($url, Tools::arr2xml($params), $option)); if ($result['return_code'] !== 'SUCCESS') { @@ -200,4 +205,4 @@ protected function callPostApi($url, array $data, $isCert = false, $signType = ' } return $result; } -} \ No newline at end of file +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeWork.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeWork.php new file mode 100644 index 00000000000..bde60b6705f --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeWork.php @@ -0,0 +1,43 @@ +access_token) return $this->access_token; + $ckey = $this->config->get('appid') . '_access_token'; + if ($this->access_token = Tools::getCache($ckey)) return $this->access_token; + list($appid, $secret) = [$this->config->get('appid'), $this->config->get('appsecret')]; + $result = Tools::json2arr(Tools::get("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={$appid}&corpsecret={$secret}")); + if (isset($result['access_token']) && $result['access_token']) Tools::setCache($ckey, $result['access_token'], 7000); + return $this->access_token = $result['access_token']; + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataArray.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataArray.php index c932c7daf5a..628da33215e 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataArray.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataArray.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -51,7 +53,7 @@ public function set($offset, $value) /** * 获取配置项参数 * @param string|null $offset - * @return array|string|null + * @return array|string|null|mixed */ public function get($offset = null) { @@ -76,7 +78,9 @@ public function merge(array $data, $append = false) * 设置配置项值 * @param string $offset * @param string|array|null|integer $value + * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -91,6 +95,7 @@ public function offsetSet($offset, $value) * @param string $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->config[$offset]); @@ -99,7 +104,9 @@ public function offsetExists($offset) /** * 清理配置项 * @param string|null $offset + * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset = null) { if (is_null($offset)) { @@ -112,13 +119,12 @@ public function offsetUnset($offset = null) /** * 获取配置项参数 * @param string|null $offset - * @return array|string|null + * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset = null) { - if (is_null($offset)) { - return $this->config; - } + if (is_null($offset)) return $this->config; return isset($this->config[$offset]) ? $this->config[$offset] : null; } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataError.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataError.php index 51cd9a2eea0..7f064a6d7e5 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataError.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/DataError.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/MyCurlFile.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/MyCurlFile.php index e81e3da46c8..5284e0e5ba3 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/MyCurlFile.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/MyCurlFile.php @@ -1,5 +1,19 @@ filename = Tools::pushFile($this->tempname, base64_decode($this->content)); if (class_exists('CURLFile')) { return new \CURLFile($this->filename, $this->mimetype, $this->postname); + } else { + return "@{$this->tempname};filename={$this->postname};type={$this->mimetype}"; } - return "@{$this->tempname};filename={$this->postname};type={$this->mimetype}"; } /** - * 类销毁处理 + * 通用销毁函数清理缓存文件 + * 提前删除过期因此放到了网络请求之后 */ public function __destruct() { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php index 60a435d5ce3..f408b80256b 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Contracts; @@ -63,13 +65,25 @@ public static function createNoncestr($length = 32, $str = "") return $str; } + /** + * 获取输入对象 + * @return false|mixed|string + */ + public static function getRawInput() + { + if (empty($GLOBALS['HTTP_RAW_POST_DATA'])) { + return file_get_contents('php://input'); + } else { + return $GLOBALS['HTTP_RAW_POST_DATA']; + } + } /** * 根据文件后缀获取文件类型 * @param string|array $ext 文件后缀 * @param array $mine 文件后缀MINE信息 * @return string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function getExtMine($ext, $mine = []) { @@ -83,7 +97,7 @@ public static function getExtMine($ext, $mine = []) /** * 获取所有文件扩展的类型 * @return array - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ private static function getMines() { @@ -99,21 +113,22 @@ private static function getMines() /** * 创建CURL文件对象 - * @param $filename + * @param mixed $filename * @param string $mimetype * @param string $postname * @return \CURLFile|string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function createCurlFile($filename, $mimetype = null, $postname = null) { if (is_string($filename) && file_exists($filename)) { if (is_null($postname)) $postname = basename($filename); if (is_null($mimetype)) $mimetype = self::getExtMine(pathinfo($filename, 4)); - if (function_exists('curl_file_create')) { - return curl_file_create($filename, $mimetype, $postname); + if (class_exists('CURLFile')) { + return new \CURLFile($filename, $mimetype, $postname); + } else { + return "@{$filename};filename={$postname};type={$mimetype}"; } - return "@{$filename};filename={$postname};type={$mimetype}"; } return $filename; } @@ -158,20 +173,35 @@ private static function _arr2xml($data, $content = '') */ public static function xml2arr($xml) { - $entity = libxml_disable_entity_loader(true); - $data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA); - libxml_disable_entity_loader($entity); + if (PHP_VERSION_ID < 80000) { + $backup = libxml_disable_entity_loader(true); + $data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($backup); + } else { + $data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA); + } return json_decode(json_encode($data), true); } + /** + * 解析XML文本内容 + * @param string $xml + * @return array|false + */ + 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) { - $json = json_encode(self::buildEnEmojiData($data), JSON_UNESCAPED_UNICODE); + $json = json_encode($data, JSON_UNESCAPED_UNICODE); return $json === '[]' ? '{}' : $json; } @@ -241,7 +271,7 @@ public static function emojiDecode($content) * 解析JSON内容到数组 * @param string $json * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException */ public static function json2arr($json) { @@ -261,7 +291,7 @@ public static function json2arr($json) * @param array $query GET数 * @param array $options * @return boolean|string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function get($url, $query = [], $options = []) { @@ -275,7 +305,7 @@ public static function get($url, $query = [], $options = []) * @param array $data POST数据 * @param array $options * @return boolean|string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function post($url, $data = [], $options = []) { @@ -289,7 +319,7 @@ public static function post($url, $data = [], $options = []) * @param string $url 请求方法 * @param array $options 请求参数[headers,data,ssl_cer,ssl_key] * @return boolean|string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function doRequest($method, $url, $options = []) { @@ -342,13 +372,18 @@ public static function doRequest($method, $url, $options = []) private static function _buildHttpData($data, $build = true) { if (!is_array($data)) return $data; - foreach ($data as $key => $value) if (is_object($value) && $value instanceof \CURLFile) { + foreach ($data as $key => $value) if ($value instanceof \CURLFile) { $build = false; } elseif (is_object($value) && isset($value->datatype) && $value->datatype === 'MY_CURL_FILE') { $build = false; $mycurl = new MyCurlFile((array)$value); $data[$key] = $mycurl->get(); - array_push(self::$cache_curl, $mycurl->tempname); + self::$cache_curl[] = $mycurl->tempname; + } elseif (is_array($value) && isset($value['datatype']) && $value['datatype'] === 'MY_CURL_FILE') { + $build = false; + $mycurl = new MyCurlFile($value); + $data[$key] = $mycurl->get(); + self::$cache_curl[] = $mycurl->tempname; } elseif (is_string($value) && class_exists('CURLFile', false) && stripos($value, '@') === 0) { if (($filename = realpath(trim($value, '@'))) && file_exists($filename)) { $build = false; @@ -363,7 +398,7 @@ private static function _buildHttpData($data, $build = true) * @param string $name 文件名称 * @param string $content 文件内容 * @return string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function pushFile($name, $content) { @@ -383,7 +418,7 @@ public static function pushFile($name, $content) * @param string $value 缓存内容 * @param int $expired 缓存时间(0表示永久缓存) * @return string - * @throws LocalCacheException + * @throws \WeChat\Exceptions\LocalCacheException */ public static function setCache($name, $value = '', $expired = 3600) { @@ -409,7 +444,7 @@ public static function getCache($name) return call_user_func_array(self::$cache_callable['get'], func_get_args()); } $file = self::_getCacheName($name); - if (file_exists($file) && ($content = file_get_contents($file))) { + if (file_exists($file) && is_file($file) && ($content = file_get_contents($file))) { $data = unserialize($content); if (isset($data['expired']) && (intval($data['expired']) === 0 || intval($data['expired']) >= time())) { return $data['value']; @@ -430,7 +465,7 @@ public static function delCache($name) return call_user_func_array(self::$cache_callable['del'], func_get_args()); } $file = self::_getCacheName($name); - return file_exists($file) ? unlink($file) : true; + return !file_exists($file) || @unlink($file); } /** @@ -447,4 +482,4 @@ private static function _getCacheName($name) file_exists(self::$cache_path) || mkdir(self::$cache_path, 0755, true); return self::$cache_path . $name; } -} \ No newline at end of file +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Custom.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Custom.php index 6d030914007..bfca666fafa 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Custom.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Custom.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -34,56 +36,49 @@ class Custom extends BasicWeChat */ public function addAccount($kf_account, $nickname) { - $data = ['kf_account' => $kf_account, 'nickname' => $nickname]; $url = "https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['kf_account' => $kf_account, 'nickname' => $nickname]); } /** * 修改客服帐号 - * @param string $kf_account 客服账号 + * @param string $kfAccount 客服账号 * @param string $nickname 客服昵称 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function updateAccount($kf_account, $nickname) + public function updateAccount($kfAccount, $nickname) { - $data = ['kf_account' => $kf_account, 'nickname' => $nickname]; $url = "https://api.weixin.qq.com/customservice/kfaccount/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['kf_account' => $kfAccount, 'nickname' => $nickname]); } /** * 删除客服帐号 - * @param string $kf_account 客服账号 + * @param string $kfAccount 客服账号 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function deleteAccount($kf_account) + public function deleteAccount($kfAccount) { - $data = ['kf_account' => $kf_account]; $url = "https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['kf_account' => $kfAccount]); } /** * 邀请绑定客服帐号 - * @param string $kf_account 完整客服帐号,格式为:帐号前缀@公众号微信号 + * @param string $kfAccount 完整客服帐号,格式为:帐号前缀@公众号微信号 * @param string $invite_wx 接收绑定邀请的客服微信号 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function inviteWorker($kf_account, $invite_wx) + public function inviteWorker($kfAccount, $invite_wx) { $url = 'https://api.weixin.qq.com/customservice/kfaccount/inviteworker?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['kf_account' => $kf_account, 'invite_wx' => $invite_wx]); + return $this->callPostApi($url, ['kf_account' => $kfAccount, 'invite_wx' => $invite_wx]); } /** @@ -95,8 +90,7 @@ public function inviteWorker($kf_account, $invite_wx) public function getAccountList() { $url = "https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** @@ -109,9 +103,8 @@ public function getAccountList() */ public function uploadHeadimg($kf_account, $image) { - $url = "http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account={$kf_account}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($image)]); + $url = "https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account={$kf_account}"; + return $this->callPostApi($url, ['media' => Tools::createCurlFile($image)], false); } /** @@ -124,8 +117,7 @@ public function uploadHeadimg($kf_account, $image) public function send(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -139,8 +131,7 @@ public function send(array $data) public function typing($openid, $command = 'Typing') { $url = "https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['touser' => $openid, 'command' => $command]); + return $this->callPostApi($url, ['touser' => $openid, 'command' => $command]); } /** @@ -153,8 +144,7 @@ public function typing($openid, $command = 'Typing') public function massSendAll(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -167,8 +157,7 @@ public function massSendAll(array $data) public function massSend(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -184,8 +173,7 @@ public function massDelete($msg_id, $article_idx = null) $data = ['msg_id' => $msg_id]; is_null($article_idx) || $data['article_idx'] = $article_idx; $url = "https://api.weixin.qq.com/cgi-bin/message/mass/delete?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -198,22 +186,20 @@ public function massDelete($msg_id, $article_idx = null) public function massPreview(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询群发消息发送状态【订阅号与服务号认证后均可用】 - * @param integer $msg_id 群发消息后返回的消息id + * @param integer $msgId 群发消息后返回的消息id * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function massGet($msg_id) + public function massGet($msgId) { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['msg_id' => $msg_id]); + return $this->callPostApi($url, ['msg_id' => $msgId]); } /** @@ -225,8 +211,7 @@ public function massGet($msg_id) public function massGetSeed() { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/speed/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, []); + return $this->callPostApi($url, []); } /** @@ -239,9 +224,6 @@ public function massGetSeed() public function massSetSeed($speed) { $url = "https://api.weixin.qq.com/cgi-bin/message/mass/speed/set?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['speed' => $speed]); + return $this->callPostApi($url, ['speed' => $speed]); } - - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Draft.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Draft.php new file mode 100644 index 00000000000..0a097afe924 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Draft.php @@ -0,0 +1,124 @@ +callPostApi($url, ['articles' => $articles]); + } + + /** + * 获取草稿 + * @param string $mediaId + * @param string $outType 返回处理函数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function get($mediaId, $outType = null) + { + $url = "https://api.weixin.qq.com/cgi-bin/draft/get?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['media_id' => $mediaId]); + } + + /** + * 删除草稿 + * @param string $mediaId + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delete($mediaId) + { + $url = "https://api.weixin.qq.com/cgi-bin/draft/delete?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['media_id' => $mediaId]); + } + + /** + * 新增图文素材 + * @param array $data 文件名称 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addNews($data) + { + $url = "https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data); + } + + /** + * 修改草稿 + * @param string $media_id 要修改的图文消息的id + * @param int $index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0 + * @param $articles + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function update($media_id, $index, $articles) + { + $url = "https://api.weixin.qq.com/cgi-bin/draft/update?access_token=ACCESS_TOKEN"; + $data = ['media_id' => $media_id, 'index' => $index, 'articles' => $articles]; + return $this->callPostApi($url, $data); + } + + /** + * 获取草稿总数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getCount() + { + $url = "https://api.weixin.qq.com/cgi-bin/draft/count?access_token=ACCESS_TOKEN"; + return $this->callGetApi($url); + } + + /** + * 获取草稿列表 + * @param int $offset 从全部素材的该偏移位置开始返回,0表示从第一个素材返回 + * @param int $count 返回素材的数量,取值在1到20之间 + * @param int $noContent 1 表示不返回 content 字段,0 表示正常返回,默认为 0 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function batchGet($offset = 0, $count = 20, $noContent = 0) + { + $url = "https://api.weixin.qq.com/cgi-bin/draft/batchget?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['no_content' => $noContent, 'offset' => $offset, 'count' => $count]); + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidArgumentException.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidArgumentException.php index 993c4e0083a..1c38e67f612 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidArgumentException.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidArgumentException.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Exceptions; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidDecryptException.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidDecryptException.php index f45c0581e85..cc0d6e5325c 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidDecryptException.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidDecryptException.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Exceptions; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidInstanceException.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidInstanceException.php index e4c6816f82c..e9a3c157d8c 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidInstanceException.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidInstanceException.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Exceptions; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidResponseException.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidResponseException.php index c3cb8926735..5e3e9bcb07f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidResponseException.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/InvalidResponseException.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Exceptions; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/LocalCacheException.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/LocalCacheException.php index 35be83a8dcb..14ebc71d83b 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/LocalCacheException.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Exceptions/LocalCacheException.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat\Exceptions; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Freepublish.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Freepublish.php new file mode 100644 index 00000000000..1cd96142577 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Freepublish.php @@ -0,0 +1,98 @@ +callPostApi($url, ['media_id' => $mediaId]); + } + + /** + * 发布状态轮询接口 + * @param mixed $publishId + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function get($publishId) + { + $url = "https://api.weixin.qq.com/cgi-bin/freepublish/get?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['publish_id' => $publishId]); + } + + /** + * 删除发布 + * 发布成功之后,随时可以通过该接口删除。此操作不可逆,请谨慎操作。 + * @param mixed $articleId 成功发布时返回的 article_id + * @param int $index 要删除的文章在图文消息中的位置,第一篇编号为1,该字段不填或填0会删除全部文章 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delete($articleId, $index = 0) + { + $url = "https://api.weixin.qq.com/cgi-bin/freepublish/delete?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['article_id' => $articleId, 'index' => $index]); + } + + /** + * 通过 article_id 获取已发布文章 + * @param mixed $articleId 要获取的草稿的article_id + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getArticle($articleId) + { + $url = "https://api.weixin.qq.com/cgi-bin/freepublish/getarticle?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['article_id' => $articleId]); + } + + /** + * 获取成功发布列表 + * @param int $offset 从全部素材的该偏移位置开始返回,0表示从第一个素材返回 + * @param int $count 返回素材的数量,取值在1到20之间 + * @param int $noContent 1 表示不返回 content 字段,0 表示正常返回,默认为 0 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function batchGet($offset = 0, $count = 20, $noContent = 0) + { + $url = "https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, ['no_content' => $noContent, 'offset' => $offset, 'count' => $count]); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Limit.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Limit.php index 6ccc6f48830..05973c99b2b 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Limit.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Limit.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -27,13 +29,12 @@ class Limit extends BasicWeChat /** * 公众号调用或第三方平台帮公众号调用对公众号的所有api调用(包括第三方帮其调用)次数进行清零 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function clearQuota() { $url = 'https://api.weixin.qq.com/cgi-bin/clear_quota?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['appid' => $this->config->get('appid')]); } @@ -42,27 +43,24 @@ public function clearQuota() * @param string $action 执行的检测动作 * @param string $operator 指定平台从某个运营商进行检测 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function ping($action = 'all', $operator = 'DEFAULT') { $url = 'https://api.weixin.qq.com/cgi-bin/callback/check?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['action' => $action, 'check_operator' => $operator]); } /** * 获取微信服务器IP地址 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getCallbackIp() { $url = 'https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Media.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Media.php index 8c7ca02d238..22feec275a1 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Media.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Media.php @@ -3,19 +3,21 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; -use WeChat\Contracts\Tools; use WeChat\Contracts\BasicWeChat; +use WeChat\Contracts\Tools; use WeChat\Exceptions\InvalidResponseException; /** @@ -30,8 +32,8 @@ class Media extends BasicWeChat * @param string $filename 文件名称 * @param string $type 媒体文件类型(image|voice|video|thumb) * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function add($filename, $type = 'image') { @@ -39,8 +41,7 @@ public function add($filename, $type = 'image') throw new InvalidResponseException('Invalid Media Type.', '0'); } $url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type={$type}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($filename)], false); + return $this->callPostApi($url, ['media' => Tools::createCurlFile($filename)], false); } /** @@ -48,13 +49,14 @@ public function add($filename, $type = 'image') * @param string $media_id * @param string $outType 返回处理函数 * @return array|string - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function get($media_id, $outType = null) { $url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id={$media_id}"; $this->registerApi($url, __FUNCTION__, func_get_args()); + if ($outType == 'url') return $url; $result = Tools::get($url); if (is_array($json = json_decode($result, true))) { if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) { @@ -70,14 +72,13 @@ public function get($media_id, $outType = null) * 新增图文素材 * @param array $data 文件名称 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function addNews($data) { $url = "https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -86,39 +87,36 @@ public function addNews($data) * @param int $index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0 * @param array $news 文章内容 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function updateNews($media_id, $index, $news) { - $data = ['media_id' => $media_id, 'index' => $index, 'articles' => $news]; $url = "https://api.weixin.qq.com/cgi-bin/material/update_news?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['media_id' => $media_id, 'index' => $index, 'articles' => $news]); } /** * 上传图文消息内的图片获取URL - * @param string $filename + * @param mixed $filename * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function uploadImg($filename) { $url = "https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($filename)], false); + return $this->callPostApi($url, ['media' => Tools::createCurlFile($filename)], false); } /** * 新增其他类型永久素材 - * @param string $filename 文件名称 + * @param mixed $filename 文件名称 * @param string $type 媒体文件类型(image|voice|video|thumb) * @param array $description 包含素材的描述信息 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function addMaterial($filename, $type = 'image', $description = []) { @@ -126,8 +124,7 @@ public function addMaterial($filename, $type = 'image', $description = []) throw new InvalidResponseException('Invalid Media Type.', '0'); } $url = "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=ACCESS_TOKEN&type={$type}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($filename), 'description' => Tools::arr2json($description)], false); + return $this->callPostApi($url, ['media' => Tools::createCurlFile($filename), 'description' => Tools::arr2json($description)], false); } /** @@ -135,13 +132,14 @@ public function addMaterial($filename, $type = 'image', $description = []) * @param string $media_id * @param null|string $outType 输出类型 * @return array|string - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getMaterial($media_id, $outType = null) { $url = "https://api.weixin.qq.com/cgi-bin/material/get_material?access_token=ACCESS_TOKEN"; $this->registerApi($url, __FUNCTION__, func_get_args()); + if ($outType == 'url') return $url; $result = Tools::post($url, ['media_id' => $media_id]); if (is_array($json = json_decode($result, true))) { if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) { @@ -155,29 +153,27 @@ public function getMaterial($media_id, $outType = null) /** * 删除永久素材 - * @param string $media_id + * @param string $mediaId * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function delMaterial($media_id) + public function delMaterial($mediaId) { $url = "https://api.weixin.qq.com/cgi-bin/material/del_material?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media_id' => $media_id]); + return $this->httpPostForJson($url, ['media_id' => $mediaId]); } /** * 获取素材总数 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getMaterialCount() { $url = "https://api.weixin.qq.com/cgi-bin/material/get_materialcount?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** @@ -186,8 +182,8 @@ public function getMaterialCount() * @param int $offset * @param int $count * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function batchGetMaterial($type = 'image', $offset = 0, $count = 20) { @@ -195,7 +191,6 @@ public function batchGetMaterial($type = 'image', $offset = 0, $count = 20) throw new InvalidResponseException('Invalid Media Type.', '0'); } $url = "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['type' => $type, 'offset' => $offset, 'count' => $count]); + return $this->callPostApi($url, ['type' => $type, 'offset' => $offset, 'count' => $count]); } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Menu.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Menu.php index c006a8eae02..4f31c770dc1 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Menu.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Menu.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -27,83 +29,76 @@ class Menu extends BasicWeChat /** * 自定义菜单查询接口 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function get() { $url = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 自定义菜单删除接口 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function delete() { $url = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 自定义菜单创建 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function create(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 创建个性化菜单 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function addConditional(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 删除个性化菜单 * @param string $menuid * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function delConditional($menuid) { $url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['menuid' => $menuid]); + return $this->callPostApi($url, ['menuid' => $menuid]); } /** * 测试个性化菜单匹配结果 * @param string $openid * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function tryConditional($openid) { $url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['user_id' => $openid]); + return $this->callPostApi($url, ['user_id' => $openid]); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Oauth.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Oauth.php index a8be2729e60..0dd5b132c9c 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Oauth.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Oauth.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -40,15 +42,16 @@ public function getOauthRedirect($redirect_url, $state = '', $scope = 'snsapi_ba /** * 通过 code 获取 AccessToken 和 openid - * @return bool|array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @param string $code 授权Code值,不传则取GET参数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function getOauthAccessToken() + public function getOauthAccessToken($code = '') { $appid = $this->config->get('appid'); $appsecret = $this->config->get('appsecret'); - $code = isset($_GET['code']) ? $_GET['code'] : ''; + $code = $code ? $code : (isset($_GET['code']) ? $_GET['code'] : ''); $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$appid}&secret={$appsecret}&code={$code}&grant_type=authorization_code"; return $this->httpGetForJson($url); } @@ -56,9 +59,9 @@ public function getOauthAccessToken() /** * 刷新AccessToken并续期 * @param string $refresh_token - * @return bool|array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getOauthRefreshToken($refresh_token) { @@ -69,31 +72,30 @@ public function getOauthRefreshToken($refresh_token) /** * 检验授权凭证(access_token)是否有效 - * @param string $access_token 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 + * @param string $accessToken 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 * @param string $openid 用户的唯一标识 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function checkOauthAccessToken($access_token, $openid) + public function checkOauthAccessToken($accessToken, $openid) { - $url = "https://api.weixin.qq.com/sns/auth?access_token={$access_token}&openid={$openid}"; + $url = "https://api.weixin.qq.com/sns/auth?access_token={$accessToken}&openid={$openid}"; return $this->httpGetForJson($url); } /** * 拉取用户信息(需scope为 snsapi_userinfo) - * @param string $access_token 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 + * @param string $accessToken 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 * @param string $openid 用户的唯一标识 * @param string $lang 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function getUserInfo($access_token, $openid, $lang = 'zh_CN') + public function getUserInfo($accessToken, $openid, $lang = 'zh_CN') { - $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang={$lang}"; + $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$accessToken}&openid={$openid}&lang={$lang}"; return $this->httpGetForJson($url); } - } diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Pay.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Pay.php index dcc87cede65..59fac873cb0 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Pay.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Pay.php @@ -3,19 +3,20 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; use WeChat\Contracts\BasicWePay; -use WeChat\Exceptions\InvalidResponseException; use WePay\Bill; use WePay\Order; use WePay\Refund; @@ -34,8 +35,8 @@ class Pay extends BasicWePay * 统一下单 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createOrder(array $options) { @@ -46,8 +47,8 @@ public function createOrder(array $options) * 刷卡支付 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createMicropay($options) { @@ -88,8 +89,8 @@ public function createParamsForRuleQrc($product_id) * 查询订单 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryOrder(array $options) { @@ -100,8 +101,8 @@ public function queryOrder(array $options) * 关闭订单 * @param string $out_trade_no 商户订单号 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function closeOrder($out_trade_no) { @@ -112,8 +113,8 @@ public function closeOrder($out_trade_no) * 申请退款 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createRefund(array $options) { @@ -124,8 +125,8 @@ public function createRefund(array $options) * 查询退款 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryRefund(array $options) { @@ -136,8 +137,8 @@ public function queryRefund(array $options) * 交易保障 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function report(array $options) { @@ -148,8 +149,8 @@ public function report(array $options) * 授权码查询openid * @param string $authCode 扫码支付授权码,设备读取用户微信中的条码或者二维码信息 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryAuthCode($authCode) { @@ -161,8 +162,8 @@ public function queryAuthCode($authCode) * @param array $options 静音参数 * @param null|string $outType 输出类型 * @return bool|string - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function billDownload(array $options, $outType = null) { @@ -173,8 +174,8 @@ public function billDownload(array $options, $outType = null) * 拉取订单评价数据 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function billCommtent(array $options) { @@ -185,8 +186,8 @@ public function billCommtent(array $options) * 企业付款到零钱 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createTransfers(array $options) { @@ -197,8 +198,8 @@ public function createTransfers(array $options) * 查询企业付款到零钱 * @param string $partner_trade_no 商户调用企业付款API时使用的商户订单号 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryTransfers($partner_trade_no) { @@ -209,9 +210,9 @@ public function queryTransfers($partner_trade_no) * 企业付款到银行卡 * @param array $options * @return array - * @throws Exceptions\LocalCacheException - * @throws Exceptions\InvalidDecryptException - * @throws Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\InvalidDecryptException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createTransfersBank(array $options) { @@ -222,8 +223,8 @@ public function createTransfersBank(array $options) * 商户企业付款到银行卡操作进行结果查询 * @param string $partner_trade_no 商户订单号,需保持唯一 * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryTransFresBank($partner_trade_no) { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Product.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Product.php index 74eb3eed4ac..7c6fc443540 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Product.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Product.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -29,15 +31,14 @@ class Product extends BasicWeChat * @param string $keystr 商品编码内容 * @param string $status 设置发布状态。on为提交审核,off为取消发布 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function modStatus($keystandard, $keystr, $status = 'on') { - $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'status' => $status]; $url = "https://api.weixin.qq.com/scan/product/modstatus?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'status' => $status]; + return $this->callPostApi($url, $data); } /** @@ -45,15 +46,13 @@ public function modStatus($keystandard, $keystr, $status = 'on') * @param array $openids 测试人员的openid列表 * @param array $usernames 测试人员的微信号列表 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function setTestWhiteList(array $openids = [], array $usernames = []) { - $data = ['openid' => $openids, 'username' => $usernames]; $url = "https://api.weixin.qq.com/scan/testwhitelist/set?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['openid' => $openids, 'username' => $usernames]); } /** @@ -63,16 +62,15 @@ public function setTestWhiteList(array $openids = [], array $usernames = []) * @param integer $qrcode_size 二维码的尺寸(整型),数值代表边长像素数,不填写默认值为100 * @param array $extinfo 由商户自定义传入,建议仅使用大小写字母、数字及-_().*这6个常用字符 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getQrcode($keystandard, $keystr, $qrcode_size, $extinfo = []) { + $url = "https://api.weixin.qq.com/scan/product/getqrcode?access_token=ACCESS_TOKEN"; $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'qrcode_size' => $qrcode_size]; empty($extinfo) || $data['extinfo'] = $extinfo; - $url = "https://api.weixin.qq.com/scan/product/getqrcode?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -80,16 +78,15 @@ public function getQrcode($keystandard, $keystr, $qrcode_size, $extinfo = []) * @param string $keystandard 商品编码标准 * @param string $keystr 商品编码内容 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getProduct($keystandard, $keystr) { + $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN"; $data = ['keystandard' => $keystandard, 'keystr' => $keystr]; empty($extinfo) || $data['extinfo'] = $extinfo; - $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -99,32 +96,29 @@ public function getProduct($keystandard, $keystr) * @param null|string $status 支持按状态拉取。on为发布状态,off为未发布状态,check为审核中状态,reject为审核未通过状态,all为所有状态 * @param string $keystr 支持按部分编码内容拉取。填写该参数后,可将编码内容中包含所传参数的商品信息拉出。类似关键词搜索 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getProductList($offset, $limit = 10, $status = null, $keystr = '') { + $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN"; $data = ['offset' => $offset, 'limit' => $limit]; is_null($status) || $data['status'] = $status; empty($keystr) || $data['keystr'] = $keystr; - $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } - /** * 更新商品信息 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function updateProduct(array $data) { $url = "https://api.weixin.qq.com/scan/product/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -132,29 +126,26 @@ public function updateProduct(array $data) * @param string $keystandard 商品编码标准 * @param string $keystr 商品编码内容 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function clearProduct($keystandard, $keystr) { $url = "https://api.weixin.qq.com/scan/product/clear?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); + return $this->callPostApi($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); } - /** * 检查wxticket参数 * @param string $ticket * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function scanTicketCheck($ticket) { $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['ticket' => $ticket]); + return $this->callPostApi($url, ['ticket' => $ticket]); } /** @@ -163,15 +154,13 @@ public function scanTicketCheck($ticket) * @param string $keystr 商品编码内容 * @param string $extinfo 调用“获取商品二维码接口”时传入的extinfo,为标识参数 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function clearScanticket($keystandard, $keystr, $extinfo) { - $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'extinfo' => $extinfo]; $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'extinfo' => $extinfo]; + return $this->callPostApi($url, $data); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/ErrorCode.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/ErrorCode.php new file mode 100644 index 00000000000..d11e4eb7931 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/ErrorCode.php @@ -0,0 +1,53 @@ + '处理成功', + '40001' => '校验签名失败', + '40002' => '解析xml失败', + '40003' => '计算签名失败', + '40004' => '不合法的AESKey', + '40005' => '校验AppID失败', + '40006' => 'AES加密失败', + '40007' => 'AES解密失败', + '40008' => '公众平台发送的xml不合法', + '40009' => 'Base64编码失败', + '40010' => 'Base64解码失败', + '40011' => '公众帐号生成回包xml失败', + ]; + + /** + * 获取错误消息内容 + * @param string $code 错误代码 + * @return bool + */ + public static function getErrText($code) + { + if (isset(self::$errCode[$code])) { + return self::$errCode[$code]; + } + return false; + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/PKCS7Encoder.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/PKCS7Encoder.php new file mode 100644 index 00000000000..bac5ab04daa --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/PKCS7Encoder.php @@ -0,0 +1,46 @@ + PKCS7Encoder::$blockSize) { + $pad = 0; + } + return substr($text, 0, strlen($text) - $pad); + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Prpcrypt.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/Prpcrypt.php similarity index 51% rename from upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Prpcrypt.php rename to upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/Prpcrypt.php index 2b93c5038a5..cec9af76243 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Contracts/Prpcrypt.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Prpcrypt/Prpcrypt.php @@ -3,57 +3,16 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) // +---------------------------------------------------------------------- // | github开源项目:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- -/** - * PKCS7算法 - 加解密 - * Class PKCS7Encoder - */ -class PKCS7Encoder -{ - - public static $blockSize = 32; - - /** - * 对需要加密的明文进行填充补位 - * @param string $text 需要进行填充补位操作的明文 - * @return string 补齐明文字符串 - */ - function encode($text) - { - $amount_to_pad = PKCS7Encoder::$blockSize - (strlen($text) % PKCS7Encoder::$blockSize); - if ($amount_to_pad == 0) { - $amount_to_pad = PKCS7Encoder::$blockSize; - } - list($pad_chr, $tmp) = [chr($amount_to_pad), '']; - for ($index = 0; $index < $amount_to_pad; $index++) { - $tmp .= $pad_chr; - } - return $text . $tmp; - } - - /** - * 对解密后的明文进行补位删除 - * @param string $text 解密后的明文 - * @return string 删除填充补位后的明文 - */ - function decode($text) - { - $pad = ord(substr($text, -1)); - if ($pad < 1 || $pad > PKCS7Encoder::$blockSize) { - $pad = 0; - } - return substr($text, 0, strlen($text) - $pad); - } - -} +namespace WeChat\Prpcrypt; /** * 公众号消息 - 加解密 @@ -88,7 +47,7 @@ public function encrypt($text, $appid) $text = $pkcEncoder->encode($random . pack("N", strlen($text)) . $text . $appid); $encrypted = openssl_encrypt($text, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); return [ErrorCode::$OK, $encrypted]; - } catch (Exception $e) { + } catch (\Exception $e) { return [ErrorCode::$EncryptAESError, null]; } } @@ -103,7 +62,7 @@ public function decrypt($encrypted) try { $iv = substr($this->key, 0, 16); $decrypted = openssl_decrypt($encrypted, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); - } catch (Exception $e) { + } catch (\Exception $e) { return [ErrorCode::$DecryptAESError, null]; } try { @@ -116,7 +75,7 @@ public function decrypt($encrypted) $len_list = unpack("N", substr($content, 0, 4)); $xml_len = $len_list[1]; return [0, substr($content, 4, $xml_len), substr($content, $xml_len + 4)]; - } catch (Exception $e) { + } catch (\Exception $e) { return [ErrorCode::$IllegalBuffer, null]; } } @@ -137,53 +96,3 @@ function getRandomStr($str = "") } } - -/** - * 仅用作类内部使用 - * 不用于官方API接口的errCode码 - * Class ErrorCode - */ -class ErrorCode -{ - - public static $OK = 0; - public static $ParseXmlError = 40002; - public static $IllegalAesKey = 40004; - public static $IllegalBuffer = 40008; - public static $EncryptAESError = 40006; - public static $DecryptAESError = 40007; - public static $EncodeBase64Error = 40009; - public static $DecodeBase64Error = 40010; - public static $GenReturnXmlError = 40011; - public static $ValidateAppidError = 40005; - public static $ComputeSignatureError = 40003; - public static $ValidateSignatureError = 40001; - public static $errCode = [ - '0' => '处理成功', - '40001' => '校验签名失败', - '40002' => '解析xml失败', - '40003' => '计算签名失败', - '40004' => '不合法的AESKey', - '40005' => '校验AppID失败', - '40006' => 'AES加密失败', - '40007' => 'AES解密失败', - '40008' => '公众平台发送的xml不合法', - '40009' => 'Base64编码失败', - '40010' => 'Base64解码失败', - '40011' => '公众帐号生成回包xml失败', - ]; - - /** - * 获取错误消息内容 - * @param string $code 错误代码 - * @return bool - */ - public static function getErrText($code) - { - if (isset(self::$errCode[$code])) { - return self::$errCode[$code]; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Qrcode.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Qrcode.php index 3b6251101b8..19abd49f4b7 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Qrcode.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Qrcode.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -29,8 +31,8 @@ class Qrcode extends BasicWeChat * @param string|integer $scene 场景 * @param int $expire_seconds 有效时间 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function create($scene, $expire_seconds = 0) { @@ -46,8 +48,7 @@ public function create($scene, $expire_seconds = 0) $data['action_name'] = is_integer($scene) ? 'QR_LIMIT_SCENE' : 'QR_LIMIT_STR_SCENE'; } $url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -57,21 +58,19 @@ public function create($scene, $expire_seconds = 0) */ public function url($ticket) { - return "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket={$ticket}"; + return "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" . urlencode($ticket); } /** * 长链接转短链接接口 * @param string $longUrl 需要转换的长链接 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function shortUrl($longUrl) { $url = "https://api.weixin.qq.com/cgi-bin/shorturl?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['action' => 'long2short', 'long_url' => $longUrl]); + return $this->callPostApi($url, ['action' => 'long2short', 'long_url' => $longUrl]); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Receive.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Receive.php index 7f4d0700635..edf9920218f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Receive.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Receive.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Scan.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Scan.php index ad272eb4333..ffd2e8acf04 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Scan.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Scan.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -26,28 +28,26 @@ class Scan extends BasicWeChat /** * 获取商户信息 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getMerchantInfo() { $url = "https://api.weixin.qq.com/scan/merchantinfo/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 创建商品 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function addProduct(array $data) { $url = "https://api.weixin.qq.com/scan/product/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -56,15 +56,14 @@ public function addProduct(array $data) * @param string $keystr 商品编码内容 * @param string $status 设置发布状态。on为提交审核,off为取消发布 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function modProduct($keystandard, $keystr, $status = 'on') { - $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'status' => $status]; $url = "https://api.weixin.qq.com/scan/product/modstatus?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'status' => $status]; + return $this->callPostApi($url, $data); } /** @@ -72,15 +71,13 @@ public function modProduct($keystandard, $keystr, $status = 'on') * @param array $openids 测试人员的openid列表 * @param array $usernames 测试人员的微信号列表 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function setTestWhiteList($openids = [], $usernames = []) { - $data = ['openid' => $openids, 'username' => $usernames]; $url = "https://api.weixin.qq.com/scan/product/modstatus?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, ['openid' => $openids, 'username' => $usernames]); } /** @@ -90,16 +87,15 @@ public function setTestWhiteList($openids = [], $usernames = []) * @param null|string $extinfo * @param integer $qrcode_size * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getQrc($keystandard, $keystr, $extinfo = null, $qrcode_size = 64) { + $url = "https://api.weixin.qq.com/scan/product/getqrcode?access_token=ACCESS_TOKEN"; $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'qrcode_size' => $qrcode_size]; is_null($extinfo) || $data['extinfo'] = $extinfo; - $url = "https://api.weixin.qq.com/scan/product/getqrcode?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -107,14 +103,13 @@ public function getQrc($keystandard, $keystr, $extinfo = null, $qrcode_size = 64 * @param string $keystandard 商品编码标准 * @param string $keystr 商品编码内容 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getProductInfo($keystandard, $keystr) { $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); + return $this->callPostApi($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); } /** @@ -124,31 +119,29 @@ public function getProductInfo($keystandard, $keystr) * @param string $status 支持按状态拉取。on为发布状态,off为未发布状态,check为审核中状态,reject为审核未通过状态,all为所有状态。 * @param string $keystr 支持按部分编码内容拉取。填写该参数后,可将编码内容中包含所传参数的商品信息拉出。类似关键词搜索。 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getProductList($offset = 1, $limit = 10, $status = null, $keystr = null) { + $url = "https://api.weixin.qq.com/scan/product/getlist?access_token=ACCESS_TOKEN"; $data = ['offset' => $offset, 'limit' => $limit]; is_null($status) || $data['status'] = $status; is_null($keystr) || $data['keystr'] = $keystr; - $url = "https://api.weixin.qq.com/scan/product/getlist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 更新商品信息 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function updateProduct(array $data) { $url = "https://api.weixin.qq.com/scan/product/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -156,28 +149,26 @@ public function updateProduct(array $data) * @param string $keystandard 商品编码标准 * @param string $keystr 商品编码内容 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function clearProduct($keystandard, $keystr) { $url = "https://api.weixin.qq.com/scan/product/clear?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); + return $this->callPostApi($url, ['keystandard' => $keystandard, 'keystr' => $keystr]); } /** * 检查wxticket参数 * @param string $ticket * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function checkTicket($ticket) { $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['ticket' => $ticket]); + return $this->callPostApi($url, ['ticket' => $ticket]); } /** @@ -186,14 +177,12 @@ public function checkTicket($ticket) * @param string $keystr 商品编码内容 * @param string $extinfo 调用“获取商品二维码接口”时传入的extinfo,为标识参数 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function clearScanTicket($keystandard, $keystr, $extinfo) { $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['keystandard' => $keystandard, 'keystr' => $keystr, 'extinfo' => $extinfo]); + return $this->callPostApi($url, ['keystandard' => $keystandard, 'keystr' => $keystr, 'extinfo' => $extinfo]); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Script.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Script.php index 145e51945e1..4bdf4af9c4f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Script.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Script.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -44,8 +46,8 @@ public function delTicket($type = 'jsapi', $appid = null) * @param string $type TICKET类型(wx_card|jsapi) * @param string $appid 强制指定有效APPID * @return string - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getTicket($type = 'jsapi', $appid = null) { @@ -60,7 +62,7 @@ public function getTicket($type = 'jsapi', $appid = null) throw new InvalidResponseException('Invalid Resoponse Ticket.', '0'); } $ticket = $result['ticket']; - Tools::setCache($cache_name, $ticket, 5000); + Tools::setCache($cache_name, $ticket, 7000); } return $ticket; } @@ -70,15 +72,23 @@ public function getTicket($type = 'jsapi', $appid = null) * @param string $url 网页的URL * @param string $appid 用于多个appid时使用(可空) * @param string $ticket 强制指定ticket + * @param array $jsApiList 需初始化的 jsApiList * @return array - * @throws Exceptions\LocalCacheException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function getJsSign($url, $appid = null, $ticket = null) + public function getJsSign($url, $appid = null, $ticket = null, $jsApiList = null) { list($url,) = explode('#', $url); is_null($ticket) && $ticket = $this->getTicket('jsapi'); is_null($appid) && $appid = $this->config->get('appid'); + is_null($jsApiList) && $jsApiList = [ + 'updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', + 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', + 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', + 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', + 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard', + ]; $data = ["url" => $url, "timestamp" => '' . time(), "jsapi_ticket" => $ticket, "noncestr" => Tools::createNoncestr(16)]; return [ 'debug' => false, @@ -86,13 +96,7 @@ public function getJsSign($url, $appid = null, $ticket = null) "nonceStr" => $data['noncestr'], "timestamp" => $data['timestamp'], "signature" => $this->getSignature($data, 'sha1'), - 'jsApiList' => [ - 'updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', - 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', - 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', - 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', - 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard', - ], + 'jsApiList' => $jsApiList, ]; } @@ -107,7 +111,7 @@ protected function getSignature($data, $method = "sha1", $params = []) { ksort($data); if (!function_exists($method)) return false; - foreach ($data as $k => $v) array_push($params, "{$k}={$v}"); + foreach ($data as $k => $v) $params[] = "{$k}={$v}"; return $method(join('&', $params)); } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Shake.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Shake.php index 2d259581cde..5794c3a82ba 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Shake.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Shake.php @@ -3,20 +3,21 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; - -use WeChat\Contracts\Tools; use WeChat\Contracts\BasicWeChat; +use WeChat\Contracts\Tools; /** * 揺一揺周边 @@ -29,27 +30,25 @@ class Shake extends BasicWeChat * 申请开通功能 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function register(array $data) { $url = "https://api.weixin.qq.com/shakearound/account/register?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询审核状态 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function auditStatus() { $url = "https://api.weixin.qq.com/shakearound/account/auditstatus?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** @@ -59,8 +58,8 @@ public function auditStatus() * @param null|string $comment 备注,不超过15个汉字或30个英文字母 * @param null|string $poi_id 设备关联的门店ID,关联门店后,在门店1KM的范围内有优先摇出信息的机会。 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createApply($quantity, $apply_reason, $comment = null, $poi_id = null) { @@ -68,120 +67,111 @@ public function createApply($quantity, $apply_reason, $comment = null, $poi_id = is_null($poi_id) || $data['poi_id'] = $poi_id; is_null($comment) || $data['comment'] = $comment; $url = "https://api.weixin.qq.com/shakearound/device/applyid?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询设备ID申请审核状态 * @param integer $applyId 批次ID,申请设备ID时所返回的批次ID * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getApplyStatus($applyId) { $url = "https://api.weixin.qq.com/shakearound/device/applyid?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['apply_id' => $applyId]); + return $this->callPostApi($url, ['apply_id' => $applyId]); } /** * 编辑设备信息 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function updateApply(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 配置设备与门店的关联关系 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function bindLocation(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/bindlocation?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询设备列表 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function search(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/search?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 页面管理 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function createPage(array $data) { $url = "https://api.weixin.qq.com/shakearound/page/add?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 编辑页面信息 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function updatePage(array $data) { $url = "https://api.weixin.qq.com/shakearound/page/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询页面列表 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function searchPage(array $data) { $url = "https://api.weixin.qq.com/shakearound/page/search?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 删除页面 - * @param integer page_id 指定页面的id + * @param integer $pageId 指定页面的id * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function deletePage($page_id) + public function deletePage($pageId) { $url = "https://api.weixin.qq.com/shakearound/page/delete?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['page_id' => $page_id]); + return $this->callPostApi($url, ['page_id' => $pageId]); } /** @@ -189,116 +179,108 @@ public function deletePage($page_id) * @param string $filename 图片名字 * @param string $type Icon:摇一摇页面展示的icon图;License:申请开通摇一摇周边功能时需上传的资质文件;若不传type,则默认type=icon * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function upload($filename, $type = 'icon') { $url = "https://api.weixin.qq.com/shakearound/material/add?access_token=ACCESS_TOKEN&type={$type}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($filename)]); + return $this->callPostApi($url, ['media' => Tools::createCurlFile($filename)], false); } /** * 配置设备与页面的关联关系 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function bindPage(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/bindpage?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 查询设备与页面的关联关系 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function queryPage(array $data) { $url = "https://api.weixin.qq.com/shakearound/relation/search?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 以设备为维度的数据统计接口 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function totalDevice(array $data) { $url = "https://api.weixin.qq.com/shakearound/statistics/device?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 批量查询设备统计数据接口 * @param integer $date 指定查询日期时间戳,单位为秒 - * @param integer $page_index 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页 + * @param integer $pageIndex 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function totalDeviceList($date, $page_index = 1) + public function totalDeviceList($date, $pageIndex = 1) { $url = "https://api.weixin.qq.com/shakearound/statistics/devicelist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['date' => $date, 'page_index' => $page_index]); + return $this->callPostApi($url, ['date' => $date, 'page_index' => $pageIndex]); } /** * 以页面为维度的数据统计接口 - * @param integer $page_id 指定页面的设备ID - * @param integer $begin_date 起始日期时间戳,最长时间跨度为30天,单位为秒 - * @param integer $end_date 结束日期时间戳,最长时间跨度为30天,单位为秒 + * @param integer $pageId 指定页面的设备ID + * @param integer $beginDate 起始日期时间戳,最长时间跨度为30天,单位为秒 + * @param integer $endDate 结束日期时间戳,最长时间跨度为30天,单位为秒 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function totalPage($page_id, $begin_date, $end_date) + public function totalPage($pageId, $beginDate, $endDate) { $url = "https://api.weixin.qq.com/shakearound/statistics/page?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['page_id' => $page_id, 'begin_date' => $begin_date, 'end_date' => $end_date]); + return $this->callPostApi($url, ['page_id' => $pageId, 'begin_date' => $beginDate, 'end_date' => $endDate]); } /** * 编辑分组信息 - * @param integer $group_id 分组唯一标识,全局唯一 - * @param string $group_name 分组名称,不超过100汉字或200个英文字母 + * @param integer $groupId 分组唯一标识,全局唯一 + * @param string $groupName 分组名称,不超过100汉字或200个英文字母 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function updateGroup($group_id, $group_name) + public function updateGroup($groupId, $groupName) { $url = "https://api.weixin.qq.com/shakearound/device/group/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['group_id' => $group_id, 'group_name' => $group_name]); + return $this->callPostApi($url, ['group_id' => $groupId, 'group_name' => $groupName]); } /** * 删除分组 - * @param integer $group_id 分组唯一标识,全局唯一 + * @param integer $groupId 分组唯一标识,全局唯一 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ - public function deleteGroup($group_id) + public function deleteGroup($groupId) { $url = "https://api.weixin.qq.com/shakearound/device/group/delete?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['group_id' => $group_id]); + return $this->callPostApi($url, ['group_id' => $groupId]); } /** @@ -306,14 +288,13 @@ public function deleteGroup($group_id) * @param integer $begin 分组列表的起始索引值 * @param integer $count 待查询的分组数量,不能超过1000个 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getGroupList($begin = 0, $count = 10) { $url = "https://api.weixin.qq.com/shakearound/device/group/getlist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['begin' => $begin, 'count' => $count]); + return $this->callPostApi($url, ['begin' => $begin, 'count' => $count]); } @@ -323,42 +304,38 @@ public function getGroupList($begin = 0, $count = 10) * @param integer $begin 分组里设备的起始索引值 * @param integer $count 待查询的分组里设备的数量,不能超过1000个 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function getGroupDetail($group_id, $begin = 0, $count = 100) { $url = "https://api.weixin.qq.com/shakearound/device/group/getdetail?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['group_id' => $group_id, 'begin' => $begin, 'count' => $count]); + return $this->callPostApi($url, ['group_id' => $group_id, 'begin' => $begin, 'count' => $count]); } /** * 添加设备到分组 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function addDeviceGroup(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/group/adddevice?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** * 从分组中移除设备 * @param array $data * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException */ public function deleteDeviceGroup(array $data) { $url = "https://api.weixin.qq.com/shakearound/device/group/deletedevice?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Tags.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Tags.php index a13c79f79f6..d0e9fef72b6 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Tags.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Tags.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -31,8 +33,7 @@ class Tags extends BasicWeChat public function getTags() { $url = "https://api.weixin.qq.com/cgi-bin/tags/get?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** @@ -45,8 +46,7 @@ public function getTags() public function createTags($name) { $url = "https://api.weixin.qq.com/cgi-bin/tags/create?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['tag' => ['name' => $name]]); + return $this->callPostApi($url, ['tag' => ['name' => $name]]); } /** @@ -60,8 +60,7 @@ public function createTags($name) public function updateTags($id, $name) { $url = "https://api.weixin.qq.com/cgi-bin/tags/update?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['tag' => ['name' => $name, 'id' => $id]]); + return $this->callPostApi($url, ['tag' => ['name' => $name, 'id' => $id]]); } /** @@ -74,8 +73,7 @@ public function updateTags($id, $name) public function deleteTags($tagId) { $url = 'https://api.weixin.qq.com/cgi-bin/tags/delete?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['tag' => ['id' => $tagId]]); + return $this->callPostApi($url, ['tag' => ['id' => $tagId]]); } /** @@ -89,8 +87,7 @@ public function deleteTags($tagId) public function batchTagging(array $openids, $tagId) { $url = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid_list' => $openids, 'tagid' => $tagId]); + return $this->callPostApi($url, ['openid_list' => $openids, 'tagid' => $tagId]); } /** @@ -104,8 +101,7 @@ public function batchTagging(array $openids, $tagId) public function batchUntagging(array $openids, $tagId) { $url = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid_list' => $openids, 'tagid' => $tagId]); + return $this->callPostApi($url, ['openid_list' => $openids, 'tagid' => $tagId]); } /** @@ -118,7 +114,6 @@ public function batchUntagging(array $openids, $tagId) public function getUserTagId($openid) { $url = 'https://api.weixin.qq.com/cgi-bin/tags/getidlist?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid' => $openid]); + return $this->callPostApi($url, ['openid' => $openid]); } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Template.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Template.php index eb50ab4a23c..0410d2922a5 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Template.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Template.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -25,17 +27,16 @@ class Template extends BasicWeChat { /** * 设置所属行业 - * @param string $industry_id1 公众号模板消息所属行业编号 - * @param string $industry_id2 公众号模板消息所属行业编号 + * @param string $industryId1 公众号模板消息所属行业编号 + * @param string $industryId2 公众号模板消息所属行业编号 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function setIndustry($industry_id1, $industry_id2) + public function setIndustry($industryId1, $industryId2) { $url = "https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['industry_id1' => $industry_id1, 'industry_id2' => $industry_id2]); + return $this->callPostApi($url, ['industry_id1' => $industryId1, 'industry_id2' => $industryId2]); } /** @@ -47,22 +48,21 @@ public function setIndustry($industry_id1, $industry_id2) public function getIndustry() { $url = "https://api.weixin.qq.com/cgi-bin/template/get_industry?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 获得模板ID - * @param string $tpl_id 板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 + * @param string $templateIdShort 板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 + * @param array $keywordNameList 选用的类目模板的关键词 * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function addTemplate($tpl_id) + public function addTemplate($templateIdShort, $keywordNameList = []) { $url = "https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['template_id_short' => $tpl_id]); + return $this->callPostApi($url, ['template_id_short' => $templateIdShort, 'keyword_name_list' => $keywordNameList]); } /** @@ -74,22 +74,20 @@ public function addTemplate($tpl_id) public function getAllPrivateTemplate() { $url = "https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 删除模板ID - * @param string $tpl_id 公众帐号下模板消息ID + * @param string $tplId 公众帐号下模板消息ID * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function delPrivateTemplate($tpl_id) + public function delPrivateTemplate($tplId) { $url = "https://api.weixin.qq.com/cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['template_id' => $tpl_id]); + return $this->callPostApi($url, ['template_id' => $tplId]); } /** @@ -102,9 +100,6 @@ public function delPrivateTemplate($tpl_id) public function send(array $data) { $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } - - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/User.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/User.php index 2156cf7b28b..a69294b2d32 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/User.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/User.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; @@ -35,8 +37,7 @@ class User extends BasicWeChat public function updateMark($openid, $remark) { $url = 'https://api.weixin.qq.com/cgi-bin/user/info/updateremark?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid' => $openid, 'remark' => $remark]); + return $this->callPostApi($url, ['openid' => $openid, 'remark' => $remark]); } /** @@ -50,8 +51,7 @@ public function updateMark($openid, $remark) public function getUserInfo($openid, $lang = 'zh_CN') { $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid={$openid}&lang={$lang}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** @@ -69,8 +69,7 @@ public function getBatchUserInfo(array $openids, $lang = 'zh_CN') foreach ($openids as $openid) { $data['user_list'][] = ['openid' => $openid, 'lang' => $lang]; } - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, $data); + return $this->callPostApi($url, $data); } /** @@ -83,37 +82,34 @@ public function getBatchUserInfo(array $openids, $lang = 'zh_CN') public function getUserList($next_openid = '') { $url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid={$next_openid}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpGetForJson($url); + return $this->callGetApi($url); } /** * 获取标签下粉丝列表 * @param integer $tagid 标签ID - * @param string $next_openid 第一个拉取的OPENID + * @param string $nextOpenid 第一个拉取的OPENID * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getUserListByTag($tagid, $next_openid = '') + public function getUserListByTag($tagid, $nextOpenid = '') { $url = 'https://api.weixin.qq.com/cgi-bin/user/tag/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['tagid' => $tagid, 'next_openid' => $next_openid]); + return $this->callPostApi($url, ['tagid' => $tagid, 'next_openid' => $nextOpenid]); } /** * 获取公众号的黑名单列表 - * @param string $begin_openid + * @param string $beginOpenid * @return array * @throws Exceptions\InvalidResponseException * @throws Exceptions\LocalCacheException */ - public function getBlackList($begin_openid = '') + public function getBlackList($beginOpenid = '') { $url = "https://api.weixin.qq.com/cgi-bin/tags/members/getblacklist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['begin_openid' => $begin_openid]); + return $this->callPostApi($url, ['begin_openid' => $beginOpenid]); } /** @@ -126,8 +122,7 @@ public function getBlackList($begin_openid = '') public function batchBlackList(array $openids) { $url = "https://api.weixin.qq.com/cgi-bin/tags/members/batchblacklist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid_list' => $openids]); + return $this->callPostApi($url, ['openid_list' => $openids]); } /** @@ -140,8 +135,6 @@ public function batchBlackList(array $openids) public function batchUnblackList(array $openids) { $url = "https://api.weixin.qq.com/cgi-bin/tags/members/batchunblacklist?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->httpPostForJson($url, ['openid_list' => $openids]); + return $this->callPostApi($url, ['openid_list' => $openids]); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Wifi.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Wifi.php index ff22afffc84..c877532bd44 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Wifi.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeChat/Wifi.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeChat; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Crypt.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Crypt.php index 38fe360d2b0..24f5e7542e3 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Crypt.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Crypt.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -18,6 +20,7 @@ use WeChat\Contracts\Tools; use WeChat\Exceptions\InvalidDecryptException; use WeChat\Exceptions\InvalidResponseException; +use WXBizDataCrypt; /** @@ -33,12 +36,12 @@ class Crypt extends BasicWeChat * @param string $iv * @param string $sessionKey * @param string $encryptedData - * @return bool + * @return bool|array */ public function decode($iv, $sessionKey, $encryptedData) { require_once __DIR__ . DIRECTORY_SEPARATOR . 'crypt' . DIRECTORY_SEPARATOR . 'wxBizDataCrypt.php'; - $pc = new \WXBizDataCrypt($this->config->get('appid'), $sessionKey); + $pc = new WXBizDataCrypt($this->config->get('appid'), $sessionKey); $errCode = $pc->decryptData($encryptedData, $iv, $data); if ($errCode == 0) { return json_decode($data, true); @@ -66,8 +69,8 @@ public function session($code) * @param string $iv 加密算法的初始向量 * @param string $encryptedData 加密数据( encryptedData ) * @return array - * @throws InvalidDecryptException - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidDecryptException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function userInfo($code, $iv, $encryptedData) @@ -83,6 +86,20 @@ public function userInfo($code, $iv, $encryptedData) return array_merge($result, $userinfo); } + /** + * 通过授权码换取手机号 + * @param string $code + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getPhoneNumber($code) + { + $url = 'https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['code' => $code], true); + } + /** * 用户支付完成后,获取该用户的 UnionId * @param string $openid 支付用户唯一标识 diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Delivery.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Delivery.php index 6d6d6aff5cc..21fa777c612 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Delivery.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Delivery.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -34,7 +36,6 @@ class Delivery extends BasicWeChat public function abnormalConfirm($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/confirm_return?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -48,7 +49,6 @@ public function abnormalConfirm($data) public function addOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/add?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -62,7 +62,6 @@ public function addOrder($data) public function addTip($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/addtips?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -76,7 +75,6 @@ public function addTip($data) public function cancelOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/cancel?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -90,7 +88,6 @@ public function cancelOrder($data) public function getAllImmeDelivery($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/delivery/getall?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -104,7 +101,6 @@ public function getAllImmeDelivery($data) public function getBindAccount($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/shop/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -118,7 +114,6 @@ public function getBindAccount($data) public function getOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -132,7 +127,6 @@ public function getOrder($data) public function mockUpdateOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/test_update_order?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -146,7 +140,6 @@ public function mockUpdateOrder($data) public function preAddOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/pre_add?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -160,7 +153,6 @@ public function preAddOrder($data) public function preCancelOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/precancel?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -174,7 +166,6 @@ public function preCancelOrder($data) public function reOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/readd?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Guide.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Guide.php new file mode 100644 index 00000000000..c63327d5eb7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Guide.php @@ -0,0 +1,527 @@ +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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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'; + 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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Image.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Image.php index 16db57544f6..d2185ce3d76 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Image.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Image.php @@ -3,19 +3,20 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; use WeChat\Contracts\BasicWeChat; -use WeChat\Exceptions\InvalidResponseException; /** * 小程序图像处理 @@ -30,13 +31,12 @@ class Image extends BasicWeChat * @param string $img_url 要检测的图片 url,传这个则不用传 img 参数。 * @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function aiCrop($img_url, $img) { - $url = "https://api.weixin.qq.com/cv/img/aicrop?access_token=ACCESS_TOCKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); + $url = "https://api.weixin.qq.com/cv/img/aicrop?access_token=ACCESS_TOKEN"; return $this->callPostApi($url, ['img_url' => $img_url, 'img' => $img], true); } @@ -45,13 +45,12 @@ public function aiCrop($img_url, $img) * @param string $img_url 要检测的图片 url,传这个则不用传 img 参数。 * @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function scanQRCode($img_url, $img) { - $url = "https://api.weixin.qq.com/cv/img/qrcode?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); + $url = "https://api.weixin.qq.com/cv/img/qrcode?img_url=ENCODE_URL&access_token=ACCESS_TOKEN"; return $this->callPostApi($url, ['img_url' => $img_url, 'img' => $img], true); } @@ -60,13 +59,12 @@ public function scanQRCode($img_url, $img) * @param string $img_url 要检测的图片 url,传这个则不用传 img 参数 * @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function superresolution($img_url, $img) { - $url = "https://api.weixin.qq.com/cv/img/qrcode?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); + $url = "https://api.weixin.qq.com/cv/img/qrcode?img_url=ENCODE_URL&access_token=ACCESS_TOKEN"; return $this->callPostApi($url, ['img_url' => $img_url, 'img' => $img], true); } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Live.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Live.php new file mode 100644 index 00000000000..089fa25f5ba --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Live.php @@ -0,0 +1,171 @@ +callPostApi($url, $data, true); + } + + /** + * 获取直播房间列表 + * @param integer $start 起始拉取房间 + * @param integer $limit 每次拉取的个数上限 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getLiveList($start = 0, $limit = 10) + { + $url = 'https://api.weixin.qq.com/wxa/business/getliveinfo?access_token=ACCESS_TOKEN'; + 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 = 'https://api.weixin.qq.com/wxa/business/getliveinfo?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 直播间导入商品 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addLiveGoods($data = []) + { + $url = 'https://api.weixin.qq.com/wxaapi/broadcast/room/addgoods?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 商品添加并提审 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/add?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 商品撤回审核 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function resetAuditGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/resetaudit?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 重新提交审核 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function auditGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/audit?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 删除商品 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function deleteGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/delete?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 更新商品 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function updateGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/update?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 获取商品状态 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function stateGoods($data) + { + $url = "https://api.weixin.qq.com/wxa/business/getgoodswarehouse?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 获取商品列表 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGoods($data) + { + $url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/getapproved?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Logistics.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Logistics.php index dc048bb5e19..876ab97909d 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Logistics.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Logistics.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,7 +35,6 @@ class Logistics extends BasicWeChat public function addOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/order/add?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -47,7 +48,6 @@ public function addOrder($data) public function cancelOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/order/cancel?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -60,7 +60,6 @@ public function cancelOrder($data) public function getAllDelivery() { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/delivery/getall?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callGetApi($url); } @@ -74,7 +73,6 @@ public function getAllDelivery() public function getOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/order/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -88,7 +86,6 @@ public function getOrder($data) public function getPath($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/path/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -101,7 +98,6 @@ public function getPath($data) public function getPrinter() { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/printer/getall?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callGetApi($url); } @@ -115,7 +111,6 @@ public function getPrinter() public function getQuota($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/path/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -129,7 +124,6 @@ public function getQuota($data) public function testUpdateOrder($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/test_update_order?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -143,7 +137,6 @@ public function testUpdateOrder($data) public function updatePrinter($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/business/printer/update?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -157,7 +150,6 @@ public function updatePrinter($data) public function getContact($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/contact/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -171,7 +163,6 @@ public function getContact($data) public function previewTemplate($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/template/preview?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -185,7 +176,6 @@ public function previewTemplate($data) public function updateBusiness($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/service/business/update?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -199,8 +189,6 @@ public function updateBusiness($data) public function updatePath($data) { $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/path/update?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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Message.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Message.php index fdb06a4c620..1ef90f14968 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Message.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Message.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,7 +35,6 @@ class Message extends BasicWeChat public function createActivityId($data) { $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/activityid/create?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -47,7 +48,6 @@ public function createActivityId($data) public function setUpdatableMsg($data) { $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/updatablemsg/send?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -61,7 +61,6 @@ public function setUpdatableMsg($data) public function uniformSend($data) { $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php index 80ae2ace0bb..a88ce631e00 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,7 +35,6 @@ class Newtmpl extends BasicWeChat public function addCategory($data) { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/addcategory?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -46,7 +47,6 @@ public function addCategory($data) public function getCategory() { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getcategory?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callGetApi($url); } @@ -59,7 +59,6 @@ public function getCategory() public function deleteCategory() { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory?access_token=TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, [], true); } @@ -73,8 +72,8 @@ public function deleteCategory() public function getPubTemplateTitleList($ids) { $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); + $url .= '&' . http_build_query(['ids' => $ids, 'start' => '0', 'limit' => '30']); + return $this->callGetApi($url); } /** @@ -87,8 +86,8 @@ public function getPubTemplateTitleList($ids) public function getPubTemplateKeyWordsById($tid) { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['tid' => $tid], true); + $url .= '&' . http_build_query(['tid' => $tid]); + return $this->callGetApi($url); } /** @@ -103,7 +102,6 @@ public function getPubTemplateKeyWordsById($tid) public function addTemplate($tid, array $kidList, $sceneDesc = '') { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['tid' => $tid, 'kidList' => $kidList, 'sceneDesc' => $sceneDesc], false); } @@ -116,8 +114,7 @@ public function addTemplate($tid, array $kidList, $sceneDesc = '') public function getTemplateList() { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, [], true); + return $this->callGetApi($url); } /** @@ -130,7 +127,6 @@ public function getTemplateList() public function delTemplate($priTmplId) { $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['priTmplId' => $priTmplId], true); } @@ -144,8 +140,6 @@ public function delTemplate($priTmplId) public function send(array $data) { $url = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send?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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Ocr.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Ocr.php index 22b5048d7a0..57ca618e340 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Ocr.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Ocr.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -32,9 +34,8 @@ class Ocr extends BasicWeChat */ public function bankcard($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/bankcard?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/bankcard?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } /** @@ -46,9 +47,8 @@ public function bankcard($data) */ public function businessLicense($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/bizlicense?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/bizlicense?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } /** @@ -60,9 +60,8 @@ public function businessLicense($data) */ public function driverLicense($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/drivinglicense?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/drivinglicense?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } /** @@ -74,9 +73,8 @@ public function driverLicense($data) */ public function idcard($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/idcard?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/idcard?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } /** @@ -88,9 +86,8 @@ public function idcard($data) */ public function printedText($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/comm?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/comm?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } /** @@ -102,9 +99,7 @@ public function printedText($data) */ public function vehicleLicense($data) { - $url = 'https://api.weixin.qq.com/cv/ocr/driving?access_token=ACCESS_TOCKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, $data, true); + $url = 'https://api.weixin.qq.com/cv/ocr/driving?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, false); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Operation.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Operation.php new file mode 100644 index 00000000000..8708b24360a --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Operation.php @@ -0,0 +1,41 @@ +callPostApi($url, $data, true); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Plugs.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Plugs.php index 6110e89cdc3..a8f9a7e528a 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Plugs.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Plugs.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,7 +35,6 @@ class Plugs extends BasicWeChat public function apply($plugin_appid) { $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['action' => 'apply', 'plugin_appid' => $plugin_appid], true); } @@ -46,7 +47,6 @@ public function apply($plugin_appid) public function getList() { $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['action' => 'list'], true); } @@ -60,7 +60,6 @@ public function getList() public function unbind($plugin_appid) { $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['action' => 'unbind', 'plugin_appid' => $plugin_appid], true); } @@ -75,7 +74,6 @@ public function unbind($plugin_appid) public function devplugin($data) { $url = 'https://api.weixin.qq.com/wxa/devplugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, $data, true); } @@ -90,7 +88,6 @@ public function devplugin($data) public function devApplyList($page = 1, $num = 10) { $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); $data = ['action' => 'dev_apply_list', 'page' => $page, 'num' => $num]; return $this->callPostApi($url, $data, true); } @@ -105,8 +102,6 @@ public function devApplyList($page = 1, $num = 10) public function devAgree($action = 'dev_agree') { $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['action' => $action], true); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Poi.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Poi.php index c81ef5d2d0e..800a39bd571 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Poi.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Poi.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -36,7 +38,6 @@ class Poi extends BasicWeChat public function addBearByPoi($related_name, $related_credential, $related_address, $related_proof_material) { $url = 'https://api.weixin.qq.com/wxa/addnearbypoi?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); $data = [ 'related_name' => $related_name, 'related_credential' => $related_credential, 'related_address' => $related_address, 'related_proof_material' => $related_proof_material, @@ -55,7 +56,6 @@ public function addBearByPoi($related_name, $related_credential, $related_addres public function getNearByPoiList($page = 1, $page_rows = 1000) { $url = "https://api.weixin.qq.com/wxa/getnearbypoilist?page={$page}&page_rows={$page_rows}&access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callGetApi($url); } @@ -69,7 +69,6 @@ public function getNearByPoiList($page = 1, $page_rows = 1000) public function delNearByPoiList($poi_id) { $url = "https://api.weixin.qq.com/wxa/delnearbypoi?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['poi_id' => $poi_id], true); } @@ -84,8 +83,6 @@ public function delNearByPoiList($poi_id) public function setNearByPoiShowStatus($poi_id, $status) { $url = "https://api.weixin.qq.com/wxa/setnearbypoishowstatus?access_token=ACCESS_TOKEN"; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['poi_id' => $poi_id, 'status' => $status], true); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php index 4c238b34d80..2bb26106cfb 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -18,40 +20,40 @@ use WeChat\Contracts\Tools; /** - * 微信小程序二维码管理 + * 微信小程序二维码 * Class Qrcode * @package WeMini */ class Qrcode extends BasicWeChat { + /** + * 默认线条颜色 + * @var string[] + */ + private $lineColor = ["r" => "0", "g" => "0", "b" => "0"]; + /** * 获取小程序码(永久有效) * 接口A: 适用于需要的码数量较少的业务场景 * @param string $path 不能为空,最大长度 128 字节 * @param integer $width 二维码的宽度 - * @param bool $auto_color 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 - * @param array $line_color auto_color 为 false 时生效 - * @param boolean $is_hyaline 是否需要透明底色 - * @param null|string $outType 输出类型 - * @return array|string + * @param bool $autoColor 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 + * @param null|array $lineColor auto_color 为 false 时生效 + * @param boolean $isHyaline 透明底色 + * @param string|null $outType 输出类型 + * @param array $extra 其他参数 + * @return string|array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function createMiniPath($path, $width = 430, $auto_color = false, $line_color = ["r" => "0", "g" => "0", "b" => "0"], $is_hyaline = true, $outType = null) + public function createMiniPath($path, $width = 430, $autoColor = false, $lineColor = null, $isHyaline = true, $outType = null, array $extra = []) { $url = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=ACCESS_TOKEN'; $this->registerApi($url, __FUNCTION__, func_get_args()); - $data = ['path' => $path, 'width' => $width, 'auto_color' => $auto_color, 'line_color' => $line_color, 'is_hyaline' => $is_hyaline]; - $result = Tools::post($url, Tools::arr2json($data)); - if (is_array($json = json_decode($result, true))) { - if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) { - [$this->delAccessToken(), $this->isTry = true]; - return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); - } - return Tools::json2arr($result); - } - return is_null($outType) ? $result : $outType($result); + $lineColor = empty($lineColor) ? $this->lineColor : $lineColor; + $data = ['path' => $path, 'width' => $width, 'auto_color' => $autoColor, 'line_color' => $lineColor, 'is_hyaline' => $isHyaline]; + return $this->parseResult(Tools::post($url, Tools::arr2json(array_merge($data, $extra))), $outType); } /** @@ -60,28 +62,23 @@ public function createMiniPath($path, $width = 430, $auto_color = false, $line_c * @param string $scene 最大32个可见字符,只支持数字 * @param string $page 必须是已经发布的小程序存在的页面 * @param integer $width 二维码的宽度 - * @param bool $auto_color 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 - * @param array $line_color auto_color 为 false 时生效 - * @param boolean $is_hyaline 是否需要透明底色 + * @param bool $autoColor 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 + * @param null|array $lineColor auto_color 为 false 时生效 + * @param bool $isHyaline 是否需要透明底色 * @param null|string $outType 输出类型 + * @param array $extra 其他参数 * @return array|string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function createMiniScene($scene, $page, $width = 430, $auto_color = false, $line_color = ["r" => "0", "g" => "0", "b" => "0"], $is_hyaline = true, $outType = null) + public function createMiniScene($scene, $page = '', $width = 430, $autoColor = false, $lineColor = null, $isHyaline = true, $outType = null, array $extra = []) { $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN'; - $data = ['scene' => $scene, 'width' => $width, 'auto_color' => $auto_color, 'page' => $page, 'line_color' => $line_color, 'is_hyaline' => $is_hyaline]; $this->registerApi($url, __FUNCTION__, func_get_args()); - $result = Tools::post($url, Tools::arr2json($data)); - if (is_array($json = json_decode($result, true))) { - if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) { - [$this->delAccessToken(), $this->isTry = true]; - return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); - } - return Tools::json2arr($result); - } - return is_null($outType) ? $result : $outType($result); + $lineColor = empty($lineColor) ? $this->lineColor : $lineColor; + $data = ['scene' => $scene, 'width' => $width, 'page' => $page, 'auto_color' => $autoColor, 'line_color' => $lineColor, 'is_hyaline' => $isHyaline, 'check_path' => false]; + if (empty($page)) unset($data['page']); + return $this->parseResult(Tools::post($url, Tools::arr2json(array_merge($data, $extra))), $outType); } /** @@ -89,7 +86,7 @@ public function createMiniScene($scene, $page, $width = 430, $auto_color = false * 接口C:适用于需要的码数量较少的业务场景 * @param string $path 不能为空,最大长度 128 字节 * @param integer $width 二维码的宽度 - * @param null|string $outType 输出类型 + * @param string|null $outType 输出类型 * @return array|string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -98,15 +95,26 @@ public function createDefault($path, $width = 430, $outType = null) { $url = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN'; $this->registerApi($url, __FUNCTION__, func_get_args()); - $result = Tools::post($url, Tools::arr2json(['path' => $path, 'width' => $width])); + return $this->parseResult(Tools::post($url, Tools::arr2json(['path' => $path, 'width' => $width])), $outType); + } + + /** + * 解释接口数据 + * @param bool|string $result + * @param null|string $outType + * @return array|mixed + * @throws \WeChat\Exceptions\InvalidResponseException + */ + private function parseResult($result, $outType) + { if (is_array($json = json_decode($result, true))) { if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) { [$this->delAccessToken(), $this->isTry = true]; return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); } return Tools::json2arr($result); + } else { + return is_null($outType) ? $result : $outType($result); } - return is_null($outType) ? $result : $outType($result); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Scheme.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Scheme.php new file mode 100644 index 00000000000..909c4a38b42 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Scheme.php @@ -0,0 +1,80 @@ +callPostApi($url, $data, true); + } + + /** + * 查询 URL-Scheme + * @param string $scheme + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function query($scheme) + { + $url = 'https://api.weixin.qq.com/wxa/queryscheme?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, ['scheme' => $scheme], true); + } + + /** + * 创建 URL-Link + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function urlLink($data) + { + $url = "https://api.weixin.qq.com/wxa/generate_urllink?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询 URL-Link + * @param string $urllink + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function urlQuery($urllink) + { + $url = 'https://api.weixin.qq.com/wxa/query_urllink?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, ['url_link' => $urllink], true); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Search.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Search.php new file mode 100644 index 00000000000..2368c5e45a3 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Search.php @@ -0,0 +1,40 @@ +callPostApi($url, ['pages' => $pages], true); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Security.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Security.php index 5b1901fa4ea..0a5e7315bc8 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Security.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Security.php @@ -3,19 +3,20 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; use WeChat\Contracts\BasicWeChat; -use WeChat\Exceptions\InvalidResponseException; /** * 小程序内容安全 @@ -35,8 +36,7 @@ class Security extends BasicWeChat public function imgSecCheck($media) { $url = 'https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['media' => $media], true); + return $this->callPostApi($url, ['media' => $media], false); } /** @@ -44,13 +44,12 @@ public function imgSecCheck($media) * @param string $media_url * @param string $media_type * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function mediaCheckAsync($media_url, $media_type) { $url = 'https://api.weixin.qq.com/wxa/media_check_async?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['media_url' => $media_url, 'media_type' => $media_type], true); } @@ -58,13 +57,12 @@ public function mediaCheckAsync($media_url, $media_type) * 检查一段文本是否含有违法违规内容 * @param string $content * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function msgSecCheck($content) { $url = 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['content' => $content], true); } } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Shipping.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Shipping.php new file mode 100644 index 00000000000..b797d662eb4 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Shipping.php @@ -0,0 +1,118 @@ +callPostApi($url, $data, true); + } + + /** + * 发货信息合单录入接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function combined($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询订单发货状态 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function query($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/get_order?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询订单列表 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function qlist($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/get_order_list?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 确认收货提醒接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function confirm($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 消息跳转路径设置接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setJump($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/set_msg_jump_path?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询小程序是否已开通发货信息管理服务 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function isTrade($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/is_trade_managed?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询小程序是否已完成交易结算管理确认 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function isCompleted($data) + { + $url = 'https://api.weixin.qq.com/wxa/sec/order/is_trade_management_confirmation_completed?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Soter.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Soter.php index 789056896cc..37dc54cc3bb 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Soter.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Soter.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,8 +35,6 @@ class Soter extends BasicWeChat public function verifySignature($data) { $url = 'https://api.weixin.qq.com/cgi-bin/soter/verify_signature?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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Template.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Template.php index 516d407416d..074d8fc73b6 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Template.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Template.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -33,7 +35,6 @@ class Template extends BasicWeChat public function getTemplateLibraryList() { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/library/list?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['offset' => '0', 'count' => '20'], true); } @@ -47,7 +48,6 @@ public function getTemplateLibraryList() public function getTemplateLibrary($template_id) { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['id' => $template_id], true); } @@ -62,7 +62,6 @@ public function getTemplateLibrary($template_id) public function addTemplate($template_id, array $keyword_id_list) { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/add?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['id' => $template_id, 'keyword_id_list' => $keyword_id_list], true); } @@ -75,7 +74,6 @@ public function addTemplate($template_id, array $keyword_id_list) public function getTemplateList() { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['offset' => '0', 'count' => '20'], true); } @@ -89,7 +87,6 @@ public function getTemplateList() public function delTemplate($template_id) { $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/del?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['template_id' => $template_id], true); } @@ -103,8 +100,6 @@ public function delTemplate($template_id) public function send(array $data) { $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?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/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Total.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Total.php index 9d55a6b5b75..ad09ff9019f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Total.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/Total.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WeMini; @@ -25,32 +27,30 @@ class Total extends BasicWeChat { /** * 数据分析接口 - * @param string $begin_date 开始日期 - * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 + * @param string $beginDate 开始日期 + * @param string $endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getWeanalysisAppidDailySummarytrend($begin_date, $end_date) + public function getWeanalysisAppidDailySummarytrend($beginDate, $endDate) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); + return $this->callPostApi($url, ['begin_date' => $beginDate, 'end_date' => $endDate], true); } /** * 访问分析 - * @param string $begin_date 开始日期 - * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 + * @param string $beginDate 开始日期 + * @param string $endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getWeanalysisAppidDailyVisittrend($begin_date, $end_date) + public function getWeanalysisAppidDailyVisittrend($beginDate, $endDate) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); - return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); + return $this->callPostApi($url, ['begin_date' => $beginDate, 'end_date' => $endDate], true); } /** @@ -64,7 +64,6 @@ public function getWeanalysisAppidDailyVisittrend($begin_date, $end_date) public function getWeanalysisAppidWeeklyVisittrend($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyvisittrend?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -79,7 +78,6 @@ public function getWeanalysisAppidWeeklyVisittrend($begin_date, $end_date) public function getWeanalysisAppidMonthlyVisittrend($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyvisittrend?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -94,7 +92,6 @@ public function getWeanalysisAppidMonthlyVisittrend($begin_date, $end_date) public function getWeanalysisAppidVisitdistribution($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitdistribution?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -109,7 +106,6 @@ public function getWeanalysisAppidVisitdistribution($begin_date, $end_date) public function getWeanalysisAppidDailyRetaininfo($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyretaininfo?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -124,7 +120,6 @@ public function getWeanalysisAppidDailyRetaininfo($begin_date, $end_date) public function getWeanalysisAppidWeeklyRetaininfo($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyretaininfo?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -139,7 +134,6 @@ public function getWeanalysisAppidWeeklyRetaininfo($begin_date, $end_date) public function getWeanalysisAppidMonthlyRetaininfo($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyretaininfo?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -154,7 +148,6 @@ public function getWeanalysisAppidMonthlyRetaininfo($begin_date, $end_date) public function getWeanalysisAppidVisitPage($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitpage?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } @@ -169,8 +162,6 @@ public function getWeanalysisAppidVisitPage($begin_date, $end_date) public function getWeanalysisAppidUserportrait($begin_date, $end_date) { $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiduserportrait?access_token=ACCESS_TOKEN'; - $this->registerApi($url, __FUNCTION__, func_get_args()); return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true); } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php index d969638efff..abc80abe467 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php @@ -33,24 +33,25 @@ public function __construct($appid, $sessionKey) public function decryptData($encryptedData, $iv, &$data) { if (strlen($this->sessionKey) != 24) { - return \ErrorCode::$IllegalAesKey; + return ErrorCode::$IllegalAesKey; } $aesKey = base64_decode($this->sessionKey); if (strlen($iv) != 24) { - return \ErrorCode::$IllegalIv; + return ErrorCode::$IllegalIv; } $aesIV = base64_decode($iv); $aesCipher = base64_decode($encryptedData); $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); $dataObj = json_decode($result); if ($dataObj == null) { - return \ErrorCode::$IllegalBuffer; + return ErrorCode::$IllegalBuffer; } - if ($dataObj->watermark->appid != $this->appid) { - return \ErrorCode::$IllegalBuffer; + // 兼容新版本无 watermark 的情况 + if (isset($dataObj->watermark) && $dataObj->watermark->appid != $this->appid) { + return ErrorCode::$IllegalBuffer; } $data = $result; - return \ErrorCode::$OK; + return ErrorCode::$OK; } } diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Bill.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Bill.php index 4c853c700e5..721fff3599a 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Bill.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Bill.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; @@ -30,7 +32,7 @@ class Bill extends BasicWePay * @param array $options 静音参数 * @param null|string $outType 输出类型 * @return bool|string - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function download(array $options, $outType = null) @@ -39,7 +41,7 @@ public function download(array $options, $outType = null) $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'); } @@ -52,7 +54,7 @@ public function download(array $options, $outType = null) * 拉取订单评价数据 * @param array $options * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function comment(array $options) diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Coupon.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Coupon.php index 92ca5c06f3f..00db86f4f9c 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Coupon.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Coupon.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; @@ -33,7 +35,7 @@ class Coupon extends BasicWePay public function create(array $options) { $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/send_coupon"; - return $this->callPostApi($url, $options, true); + return $this->callPostApi($url, $options, true, 'MD5'); } /** diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Custom.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Custom.php new file mode 100644 index 00000000000..58e729f7e69 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Custom.php @@ -0,0 +1,69 @@ +callPostApi($url, $options, false, 'MD5', false, false); + } + + /** + * 订单附加信息查询接口 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function get(array $options = []) + { + $url = 'https://api.mch.weixin.qq.com/cgi-bin/mch/customs/customdeclarequery'; + return $this->callPostApi($url, $options, false, 'MD5', true, false); + } + + + /** + * 订单附加信息重推接口 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function reset(array $options = []) + { + $url = 'https://api.mch.weixin.qq.com/cgi-bin/mch/newcustoms/customdeclareredeclare'; + return $this->callPostApi($url, $options, false, 'MD5', true, false); + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Order.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Order.php index 1d93288fe6f..44165658a32 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Order.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Order.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; @@ -155,7 +157,7 @@ public function reverse(array $options) public function queryAuthCode($authCode) { $url = 'https://api.mch.weixin.qq.com/tools/authcodetoopenid'; - return $this->callPostApi($url, ['auth_code' => $authCode]); + return $this->callPostApi($url, ['auth_code' => $authCode], false, 'MD5', false); } /** diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/ProfitSharing.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/ProfitSharing.php new file mode 100644 index 00000000000..f1a93536688 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/ProfitSharing.php @@ -0,0 +1,145 @@ +callPostApi($url, $options, true); + } + + /** + * 请求多次分账 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function multiProfitSharing(array $options) + { + $url = 'https://api.mch.weixin.qq.com/secapi/pay/multiprofitsharing'; + return $this->callPostApi($url, $options, true); + } + + /** + * 查询分账结果 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingQuery(array $options) + { + $url = 'https://api.mch.weixin.qq.com/pay/profitsharingquery'; + return $this->callPostApi($url, $options); + } + + /** + * 添加分账接收方 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingAddReceiver(array $options) + { + $url = 'https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver'; + return $this->callPostApi($url, $options); + } + + /** + * 删除分账接收方 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingRemoveReceiver(array $options) + { + $url = 'https://api.mch.weixin.qq.com/pay/profitsharingremovereceiver'; + return $this->callPostApi($url, $options); + } + + /** + * 完结分账 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingFinish(array $options) + { + $url = 'https://api.mch.weixin.qq.com/secapi/pay/profitsharingfinish'; + return $this->callPostApi($url, $options, true); + } + + /** + * 查询订单待分账金额 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingOrderAmountQuery(array $options) + { + $url = 'https://api.mch.weixin.qq.com/pay/profitsharingorderamountquery'; + return $this->callPostApi($url, $options); + } + + /** + * 分账回退 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingReturn(array $options) + { + $url = 'https://api.mch.weixin.qq.com/secapi/pay/profitsharingreturn'; + return $this->callPostApi($url, $options, true); + } + + /** + * 回退结果查询 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function profitSharingReturnQuery(array $options) + { + $url = 'https://api.mch.weixin.qq.com/pay/profitsharingreturnquery'; + return $this->callPostApi($url, $options); + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Redpack.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Redpack.php index bf97ad89f53..26fd1afba76 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Redpack.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Redpack.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Refund.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Refund.php index 8e3c199fccb..14c61b051d5 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Refund.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Refund.php @@ -3,19 +3,22 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; use WeChat\Contracts\BasicWePay; use WeChat\Contracts\Tools; +use WeChat\Exceptions\InvalidDecryptException; use WeChat\Exceptions\InvalidResponseException; /** @@ -30,7 +33,7 @@ class Refund extends BasicWePay * 创建退款订单 * @param array $options * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function create(array $options) @@ -43,7 +46,7 @@ public function create(array $options) * 查询退款 * @param array $options * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function query(array $options) @@ -54,25 +57,25 @@ public function query(array $options) /** * 获取退款通知 + * @param string $xml * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidDecryptException + * @throws \WeChat\Exceptions\InvalidResponseException */ - public function getNotify() + public function getNotify($xml = '') { - $data = Tools::xml2arr(file_get_contents("php://input")); + $data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml); if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS') { throw new InvalidResponseException('获取退款通知XML失败!'); } - if (!class_exists('Prpcrypt', false)) { - include dirname(__DIR__) . '/WeChat/Contracts/Prpcrypt.php'; + try { + $key = md5($this->config->get('mch_key')); + $decrypt = base64_decode($data['req_info']); + $response = openssl_decrypt($decrypt, 'aes-256-ecb', $key, OPENSSL_RAW_DATA); + $data['result'] = Tools::xml2arr($response); + return $data; + } catch (\Exception $exception) { + throw new InvalidDecryptException($exception->getMessage(), $exception->getCode()); } - $pc = new \Prpcrypt(md5($this->config->get('mch_key'))); - $array = $pc->decrypt(base64_decode($data['req_info'])); - if (intval($array[0]) > 0) { - throw new InvalidResponseException($array[1], $array[0]); - } - $data['decode'] = $array[1]; - return $data; } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Transfers.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Transfers.php index 89ff1d8c1a3..ce5af6bfb45 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Transfers.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/Transfers.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/TransfersBank.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/TransfersBank.php index 0509d010a2a..e187c01e165 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/TransfersBank.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePay/TransfersBank.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- namespace WePay; @@ -68,7 +70,7 @@ public function create(array $options) * 商户企业付款到银行卡操作进行结果查询 * @param string $partnerTradeNo 商户订单号,需保持唯一 * @return array - * @throws InvalidResponseException + * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function query($partnerTradeNo) @@ -121,5 +123,4 @@ private function getRsaContent() Tools::setCache($cacheKey, $data['pub_key'], 600); return $data['pub_key']; } - } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Cert.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Cert.php new file mode 100644 index 00000000000..7a4f4887731 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Cert.php @@ -0,0 +1,63 @@ +config['mch_v3_key']); + $result = $this->doRequest('GET', '/v3/certificates'); + $certs = []; + foreach ($result['data'] as $vo) { + $certs[$vo['serial_no']] = [ + 'expire' => strtotime($vo['expire_time']), + 'content' => $aes->decryptToString( + $vo['encrypt_certificate']['associated_data'], + $vo['encrypt_certificate']['nonce'], + $vo['encrypt_certificate']['ciphertext'] + ) + ]; + } + $this->tmpFile("{$this->config['mch_id']}_certs", $certs); + } catch (\Exception $exception) { + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); + } + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/BasicWePay.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/BasicWePay.php new file mode 100644 index 00000000000..c271c4c5e5f --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/BasicWePay.php @@ -0,0 +1,352 @@ + '', // 微信绑定APPID,需配置 + 'mch_id' => '', // 微信商户编号,需要配置 + 'mch_v3_key' => '', // 微信商户密钥,需要配置 + 'cert_serial' => '', // 商户证书序号,无需配置 + 'cert_public' => '', // 商户公钥内容,需要配置 + 'cert_private' => '', // 商户密钥内容,需要配置 + 'mp_cert_serial' => '', // 平台证书序号,无需配置 + 'mp_cert_content' => '', // 平台证书内容,无需配置 + ]; + + /** + * BasicWePayV3 constructor. + * @param array $options [mch_id, mch_v3_key, cert_public, cert_private] + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function __construct(array $options = []) + { + if (empty($options['mch_id'])) { + throw new InvalidArgumentException("Missing Config -- [mch_id]"); + } + if (empty($options['mch_v3_key'])) { + throw new InvalidArgumentException("Missing Config -- [mch_v3_key]"); + } + if (empty($options['cert_public'])) { + throw new InvalidArgumentException("Missing Config -- [cert_public]"); + } + if (empty($options['cert_private'])) { + throw new InvalidArgumentException("Missing Config -- [cert_private]"); + } + + if (stripos($options['cert_public'], '-----BEGIN CERTIFICATE-----') === false) { + if (file_exists($options['cert_public'])) { + $options['cert_public'] = file_get_contents($options['cert_public']); + } else { + throw new InvalidArgumentException("File Non-Existent -- [cert_public]"); + } + } + + if (stripos($options['cert_private'], '-----BEGIN PRIVATE KEY-----') === false) { + if (file_exists($options['cert_private'])) { + $options['cert_private'] = file_get_contents($options['cert_private']); + } else { + throw new InvalidArgumentException("File Non-Existent -- [cert_private]"); + } + } + + $this->config['appid'] = isset($options['appid']) ? $options['appid'] : ''; + $this->config['mch_id'] = $options['mch_id']; + $this->config['mch_v3_key'] = $options['mch_v3_key']; + $this->config['cert_public'] = $options['cert_public']; + $this->config['cert_private'] = $options['cert_private']; + if (empty($options['cert_serial'])) { + $this->config['cert_serial'] = openssl_x509_parse($this->config['cert_public'], true)['serialNumberHex']; + } else { + $this->config['cert_serial'] = $options['cert_serial']; + } + if (empty($this->config['cert_serial'])) { + throw new InvalidArgumentException('Failed to parse certificate public key'); + } + + if (!empty($options['cache_path'])) { + Tools::$cache_path = $options['cache_path']; + } + + // 自动配置平台证书 + if ($this->autoCert) { + $this->_autoCert(); + } + + // 服务商参数支持 +// if (!empty($options['sp_appid'])) { +// $this->config['sp_appid'] = $options['sp_appid']; +// } +// if (!empty($options['sp_mchid'])) { +// $this->config['sp_mchid'] = $options['sp_mchid']; +// } +// if (!empty($options['sub_appid'])) { +// $this->config['sub_appid'] = $options['sub_appid']; +// } +// if (!empty($options['sub_mch_id'])) { +// $this->config['sub_mch_id'] = $options['sub_mch_id']; +// } + } + + /** + * 静态创建对象 + * @param array $config + * @return static + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public static function instance($config) + { + $key = md5(get_called_class() . serialize($config)); + if (isset(self::$cache[$key])) return self::$cache[$key]; + return self::$cache[$key] = new static($config); + } + + /** + * 模拟发起请求 + * @param string $method 请求访问 + * @param string $pathinfo 请求路由 + * @param string $jsondata 请求数据 + * @param boolean $verify 是否验证 + * @param boolean $isjson 返回JSON + * @return array|string + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function doRequest($method, $pathinfo, $jsondata = '', $verify = false, $isjson = true) + { + list($time, $nonce) = [time(), uniqid() . rand(1000, 9999)]; + $signstr = join("\n", [$method, $pathinfo, $time, $nonce, $jsondata, '']); + + // 生成数据签名TOKEN + $token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"', + $this->config['mch_id'], $nonce, $time, $this->config['cert_serial'], $this->signBuild($signstr) + ); + $location = (preg_match('|^https?://|', $pathinfo) ? '' : $this->base) . $pathinfo; + list($header, $content) = $this->_doRequestCurl($method, $location, [ + 'data' => $jsondata, 'header' => [ + 'Accept: application/json', + 'Content-Type: application/json', + 'User-Agent: https://thinkadmin.top', + "Authorization: WECHATPAY2-SHA256-RSA2048 {$token}", + "Wechatpay-Serial: {$this->config['mp_cert_serial']}" + ], + ]); + + if ($verify) { + $headers = []; + foreach (explode("\n", $header) as $line) { + if (stripos($line, 'Wechatpay') !== false) { + list($name, $value) = explode(':', $line); + list(, $keys) = explode('wechatpay-', strtolower($name)); + $headers[$keys] = trim($value); + } + } + try { + if (empty($headers)) { + return $isjson ? json_decode($content, true) : $content; + } + $string = join("\n", [$headers['timestamp'], $headers['nonce'], $content, '']); + if (!$this->signVerify($string, $headers['signature'], $headers['serial'])) { + throw new InvalidResponseException('验证响应签名失败'); + } + } catch (\Exception $exception) { + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); + } + } + + return $isjson ? json_decode($content, true) : $content; + } + + /** + * 通过CURL模拟网络请求 + * @param string $method 请求方法 + * @param string $location 请求方法 + * @param array $options 请求参数 [data, header] + * @return array [header,content] + */ + private function _doRequestCurl($method, $location, $options = []) + { + $curl = curl_init(); + // POST数据设置 + if (strtolower($method) === 'post') { + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $options['data']); + } + // CURL头信息设置 + if (!empty($options['header'])) { + curl_setopt($curl, CURLOPT_HTTPHEADER, $options['header']); + } + curl_setopt($curl, CURLOPT_URL, $location); + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_TIMEOUT, 60); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + $content = curl_exec($curl); + $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + curl_close($curl); + return [substr($content, 0, $headerSize), substr($content, $headerSize)]; + } + + /** + * 生成数据签名 + * @param string $data 签名内容 + * @return string + */ + protected function signBuild($data) + { + $pkeyid = openssl_pkey_get_private($this->config['cert_private']); + openssl_sign($data, $signature, $pkeyid, 'sha256WithRSAEncryption'); + return base64_encode($signature); + } + + /** + * 验证内容签名 + * @param string $data 签名内容 + * @param string $sign 原签名值 + * @param string $serial 证书序号 + * @return int + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + protected function signVerify($data, $sign, $serial) + { + $cert = $this->_getCert($serial); + return @openssl_verify($data, base64_decode($sign), openssl_x509_read($cert), 'sha256WithRSAEncryption'); + } + + /** + * 获取平台证书 + * @param string $serial + * @return string + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + protected function _getCert($serial = '') + { + $certs = $this->tmpFile("{$this->config['mch_id']}_certs"); + if (empty($certs) || empty($certs[$serial]['content'])) { + Cert::instance($this->config)->download(); + $certs = $this->tmpFile("{$this->config['mch_id']}_certs"); + } + if (empty($certs[$serial]['content']) || $certs[$serial]['expire'] < time()) { + throw new InvalidResponseException("读取平台证书失败!"); + } else { + return $certs[$serial]['content']; + } + } + + /** + * 自动配置平台证书 + * @return void + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + protected function _autoCert() + { + $certs = $this->tmpFile("{$this->config['mch_id']}_certs"); + if (is_array($certs)) foreach ($certs as $k => $v) { + if ($v['expire'] < time()) unset($certs[$k]); + } + if (empty($certs)) { + Cert::instance($this->config)->download(); + $certs = $this->tmpFile("{$this->config['mch_id']}_certs"); + } + if (empty($certs) || !is_array($certs)) { + throw new InvalidResponseException("读取平台证书失败!"); + } + foreach ($certs as $k => $v) if ($v['expire'] > time() + 10) { + $this->config['mp_cert_serial'] = $k; + $this->config['mp_cert_content'] = $v['content']; + break; + } + if (empty($this->config['mp_cert_serial']) || empty($this->config['mp_cert_content'])) { + throw new InvalidResponseException("自动配置平台证书失败!"); + } + } + + /** + * 写入或读取临时文件 + * @param string $name + * @param null|array|string $content + * @param integer $expire + * @return array|string + * @throws \WeChat\Exceptions\LocalCacheException + */ + protected function tmpFile($name, $content = null, $expire = 7200) + { + if (is_null($content)) { + $text = Tools::getCache($name); + if (empty($text)) return ''; + $json = json_decode(Tools::getCache($name) ?: '', true); + return isset($json[0]) ? $json[0] : ''; + } else { + return Tools::setCache($name, json_encode([$content], JSON_UNESCAPED_UNICODE), $expire); + } + } + + /** + * RSA加密处理-平台证书 + * @param string $string + * @return string + * @throws \WeChat\Exceptions\InvalidDecryptException + */ + protected function rsaEncode($string) + { + $publicKey = $this->config['mp_cert_content']; + if (openssl_public_encrypt($string, $encrypted, $publicKey, OPENSSL_PKCS1_OAEP_PADDING)) { + return base64_encode($encrypted); + } else { + throw new InvalidDecryptException('Rsa Encrypt Error.'); + } + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/DecryptAes.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/DecryptAes.php new file mode 100644 index 00000000000..f5c232cd428 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Contracts/DecryptAes.php @@ -0,0 +1,83 @@ +aesKey = $aesKey; + } + + /** + * Decrypt AEAD_AES_256_GCM ciphertext + * @param string $associatedData AES GCM additional authentication data + * @param string $nonceStr AES GCM nonce + * @param string $ciphertext AES GCM cipher text + * @return string|bool Decrypted string on success or FALSE on failure + * @throws \WeChat\Exceptions\InvalidDecryptException + */ + public function decryptToString($associatedData, $nonceStr, $ciphertext) + { + $ciphertext = \base64_decode($ciphertext); + if (strlen($ciphertext) <= self::AUTH_TAG_LENGTH_BYTE) { + return false; + } + try { + // ext-sodium (default installed on >= PHP 7.2) + if (function_exists('\sodium_crypto_aead_aes256gcm_is_available') && \sodium_crypto_aead_aes256gcm_is_available()) { + return \sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $associatedData, $nonceStr, $this->aesKey); + } + // ext-libsodium (need install libsodium-php 1.x via pecl) + if (function_exists('\Sodium\crypto_aead_aes256gcm_is_available') && \Sodium\crypto_aead_aes256gcm_is_available()) { + return \Sodium\crypto_aead_aes256gcm_decrypt($ciphertext, $associatedData, $nonceStr, $this->aesKey); + } + // openssl (PHP >= 7.1 support AEAD) + if (PHP_VERSION_ID >= 70100 && in_array('aes-256-gcm', \openssl_get_cipher_methods())) { + $ctext = substr($ciphertext, 0, -self::AUTH_TAG_LENGTH_BYTE); + $authTag = substr($ciphertext, -self::AUTH_TAG_LENGTH_BYTE); + return \openssl_decrypt($ctext, 'aes-256-gcm', $this->aesKey, \OPENSSL_RAW_DATA, $nonceStr, $authTag, $associatedData); + } + } catch (\Exception $exception) { + throw new InvalidDecryptException($exception->getMessage(), $exception->getCode()); + } catch (\SodiumException $exception) { + throw new InvalidDecryptException($exception->getMessage(), $exception->getCode()); + } + throw new InvalidDecryptException('AEAD_AES_256_GCM 需要 PHP 7.1 以上或者安装 libsodium-php'); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Order.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Order.php new file mode 100644 index 00000000000..f377aa04967 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Order.php @@ -0,0 +1,202 @@ + '/v3/pay/transactions/h5', + 'app' => '/v3/pay/transactions/app', + 'jsapi' => '/v3/pay/transactions/jsapi', + 'native' => '/v3/pay/transactions/native', + ]; + if (empty($types[$type])) { + throw new InvalidArgumentException("Payment {$type} not defined."); + } else { + // 创建预支付码 + $result = $this->doRequest('POST', $types[$type], json_encode($data, JSON_UNESCAPED_UNICODE), true); + if (empty($result['h5_url']) && empty($result['code_url']) && empty($result['prepay_id'])) { + $message = isset($result['code']) ? "[ {$result['code']} ] " : ''; + $message .= isset($result['message']) ? $result['message'] : json_encode($result, JSON_UNESCAPED_UNICODE); + throw new InvalidResponseException($message); + } + // 支付参数签名 + $time = strval(time()); + $appid = $this->config['appid']; + $nonceStr = Tools::createNoncestr(); + if ($type === 'app') { + $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $result['prepay_id'], ''])); + return ['partnerId' => $this->config['mch_id'], 'prepayId' => $result['prepay_id'], 'package' => 'Sign=WXPay', 'nonceStr' => $nonceStr, 'timeStamp' => $time, 'sign' => $sign]; + } elseif ($type === 'jsapi') { + $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$result['prepay_id']}", ''])); + return ['appId' => $appid, 'timestamp' => $time, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$result['prepay_id']}", 'signType' => 'RSA', 'paySign' => $sign]; + } else { + return $result; + } + } + } + + /** + * 支付订单查询 + * @param string $tradeNo 订单单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_2.shtml + */ + public function query($tradeNo) + { + $pathinfo = "/v3/pay/transactions/out-trade-no/{$tradeNo}"; + return $this->doRequest('GET', "{$pathinfo}?mchid={$this->config['mch_id']}", '', true); + } + + /** + * 关闭支付订单 + * @param string $tradeNo 订单单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function close($tradeNo) + { + $data = ['mchid' => $this->config['mch_id']]; + $path = "/v3/pay/transactions/out-trade-no/{$tradeNo}/close"; + return $this->doRequest('POST', $path, json_encode($data, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 支付通知解析 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidDecryptException + */ + public function notify(array $data = []) + { + if (empty($data)) { + $data = json_decode(Tools::getRawInput(), true); + } + if (isset($data['resource'])) { + $aes = new DecryptAes($this->config['mch_v3_key']); + $data['result'] = $aes->decryptToString( + $data['resource']['associated_data'], + $data['resource']['nonce'], + $data['resource']['ciphertext'] + ); + } + return $data; + } + + /** + * 创建退款订单 + * @param array $data 退款参数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_9.shtml + */ + public function createRefund($data) + { + $path = '/v3/refund/domestic/refunds'; + return $this->doRequest('POST', $path, json_encode($data, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 退款订单查询 + * @param string $refundNo 退款单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml + */ + public function queryRefund($refundNo) + { + $path = "/v3/refund/domestic/refunds/{$refundNo}"; + return $this->doRequest('GET', $path, '', true); + } + + /** + * 获取退款通知 + * @param mixed $data + * @return array + * @throws \WeChat\Exceptions\InvalidDecryptException + * @deprecated 直接使用 Notify 方法 + */ + public function notifyRefund($data = []) + { + return $this->notify($data); + } + + /** + * 申请交易账单 + * @param array|string $params + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_6.shtml + */ + public function tradeBill($params) + { + $path = '/v3/bill/tradebill?' . is_array($params) ? http_build_query($params) : $params; + return $this->doRequest('GET', $path, '', true); + } + + /** + * 申请资金账单 + * @param array|string $params + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_7.shtml + */ + public function fundflowBill($params) + { + $path = '/v3/bill/fundflowbill?' . is_array($params) ? http_build_query($params) : $params; + return $this->doRequest('GET', $path, '', true); + } + + /** + * 下载账单文件 + * @param string $fileurl + * @return string 二进制 Excel 内容 + * @throws \WeChat\Exceptions\InvalidResponseException + * @document https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_1.shtml + */ + public function downloadBill($fileurl) + { + return $this->doRequest('GET', $fileurl, '', false, false); + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/ProfitSharing.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/ProfitSharing.php new file mode 100644 index 00000000000..81b5cf5e3f7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/ProfitSharing.php @@ -0,0 +1,100 @@ +config['appid']; + return $this->doRequest('POST', '/v3/profitsharing/orders', json_encode($options, JSON_UNESCAPED_UNICODE), true); + } + + + /** + * 查询分账结果 + * @param string $outOrderNo 商户分账单号 + * @param string $transactionId 微信订单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function query($outOrderNo, $transactionId) + { + $pathinfo = "/v3/profitsharing/orders/{$outOrderNo}?&transaction_id={$transactionId}"; + return $this->doRequest('GET', $pathinfo, '', true); + } + + /** + * 解冻剩余资金 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function unfreeze($options) + { + return $this->doRequest('POST', '/v3/profitsharing/orders/unfreeze', json_encode($options, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 查询剩余待分金额 + * @param string $transactionId 微信订单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function amounts($transactionId) + { + $pathinfo = "/v3/profitsharing/transactions/{$transactionId}/amounts"; + return $this->doRequest('GET', $pathinfo, '', true); + } + + /** + * 添加分账接收方 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function addReceiver($options) + { + $options['appid'] = $this->config['appid']; + return $this->doRequest('POST', "/v3/profitsharing/receivers/add", json_encode($options, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 删除分账接收方 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function deleteReceiver($options) + { + $options['appid'] = $this->config['appid']; + return $this->doRequest('POST', "/v3/profitsharing/receivers/delete", json_encode($options, JSON_UNESCAPED_UNICODE), true); + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Refund.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Refund.php new file mode 100644 index 00000000000..eaf06966156 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Refund.php @@ -0,0 +1,82 @@ +config)->createRefund($data); + // return $this->doRequest('POST', '/v3/ecommerce/refunds/apply', json_encode($data, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 退款订单查询 + * @param string $refundNo 退款单号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function query($refundNo) + { + return Order::instance($this->config)->queryRefund($refundNo); + // $pathinfo = "/v3/ecommerce/refunds/out-refund-no/{$refundNo}"; + // return $this->doRequest('GET', "{$pathinfo}?sub_mchid={$this->config['mch_id']}", '', true); + } + + /** + * 获取退款通知 + * @param mixed $xml + * @return array + * @throws \WeChat\Exceptions\InvalidDecryptException + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function notify($xml = []) + { + return Order::instance($this->config)->notify($xml); +// $data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml); +// if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS') { +// throw new InvalidResponseException('获取退款通知XML失败!'); +// } +// try { +// $key = md5($this->config['mch_v3_key']); +// $decrypt = base64_decode($data['req_info']); +// $response = openssl_decrypt($decrypt, 'aes-256-ecb', $key, OPENSSL_RAW_DATA); +// $data['result'] = Tools::xml2arr($response); +// return $data; +// } catch (\Exception $exception) { +// throw new InvalidDecryptException($exception->getMessage(), $exception->getCode()); +// } + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Transfers.php b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Transfers.php new file mode 100644 index 00000000000..78ba5a683ba --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/WePayV3/Transfers.php @@ -0,0 +1,104 @@ +config['appid']; + } + if (isset($body['transfer_detail_list']) && is_array($body['transfer_detail_list'])) { + foreach ($body['transfer_detail_list'] as &$item) if (isset($item['user_name'])) { + $item['user_name'] = $this->rsaEncode($item['user_name']); + } + } + if (empty($body['total_num'])) { + $body['total_num'] = count($body['transfer_detail_list']); + } + return $this->doRequest('POST', '/v3/transfer/batches', json_encode($body, JSON_UNESCAPED_UNICODE), true); + } + + /** + * 通过微信批次单号查询批次单 + * @param string $batchId 微信批次单号(二选一) + * @param string $outBatchNo 商家批次单号(二选一) + * @param boolean $needQueryDetail 查询指定状态 + * @param integer $offset 请求资源的起始位置 + * @param integer $limit 最大明细条数 + * @param string $detailStatus 查询指定状态 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function query($batchId = '', $outBatchNo = '', $needQueryDetail = true, $offset = 0, $limit = 20, $detailStatus = 'ALL') + { + if (empty($batchId)) { + $pathinfo = "/v3/transfer/batches/out-batch-no/{$outBatchNo}"; + } else { + $pathinfo = "/v3/transfer/batches/batch-id/{$batchId}"; + } + $params = http_build_query([ + 'limit' => $limit, + 'offset' => $offset, + 'detail_status' => $detailStatus, + 'need_query_detail' => $needQueryDetail ? 'true' : 'false', + ]); + return $this->doRequest('GET', "{$pathinfo}?{$params}", '', true); + } + + /** + * 通过微信明细单号查询明细单 + * @param string $batchId 微信批次单号 + * @param string $detailId 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function detailBatchId($batchId, $detailId) + { + $pathinfo = "/v3/transfer/batches/batch-id/{$batchId}/details/detail-id/{$detailId}"; + return $this->doRequest('GET', $pathinfo, '', true); + } + + /** + * 通过商家明细单号查询明细单 + * @param string $outBatchNo 商户系统内部的商家批次单号,在商户系统内部唯一 + * @param string $outDetailNo 商户系统内部区分转账批次单下不同转账明细单的唯一标识 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function detailOutBatchNo($outBatchNo, $outDetailNo) + { + $pathinfo = "/v3/transfer/batches/out-batch-no/{$outBatchNo}/details/out-detail-no/{$outDetailNo}"; + return $this->doRequest('GET', $pathinfo, '', true); + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-app.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-app.php index 0070eb31c48..82e7942e431 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-app.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-app.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- // 1. 手动加载入口文件 @@ -26,12 +28,17 @@ // 请参考(请求参数):https://docs.open.alipay.com/api_1/alipay.trade.app.pay $result = $pay->apply([ - 'out_trade_no' => time(), // 商户订单号 + 'out_trade_no' => strval(time()), // 商户订单号 'total_amount' => '1', // 支付金额 - 'subject' => 'test subject', // 支付订单描述 + 'subject' => '支付宝订单标题', // 支付订单描述 ]); - echo '
';
-    var_export($result);
+    echo $result . PHP_EOL .'

'. PHP_EOL; + + // 请求关闭订单 + $result = $pay->close([ + 'out_trade_no' => strval(time()) + ]); + echo PHP_EOL . PHP_EOL . $result; } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-bill.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-bill.php index af5c493cf6c..8f9a25bc328 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-bill.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-bill.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- // 1. 手动加载入口文件 @@ -24,10 +26,19 @@ // $pay = \We::AliPayBill($config); $pay = \AliPay\Bill::instance($config); + /** + * 账单类型,商户通过接口或商户经开放平台授权后其所属服务商通过接口可以获取以下账单类型,支持: + * trade:商户基于支付宝交易收单的业务账单; + * signcustomer:基于商户支付宝余额收入及支出等资金变动的账务账单; + * merchant_act:营销活动账单,包含营销活动的发放,核销记录 + * trade_zft_merchant:直付通二级商户查询交易的业务账单; + * zft_acc:直付通平台商查询二级商户流水使用,返回所有二级商户流水。 + */ + // 请参考(请求参数):https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query $result = $pay->apply([ - 'bill_date' => '2018-10-03', // 账单时间(日账单yyyy-MM-dd,月账单 yyyy-MM) - 'bill_type' => 'signcustomer', // 账单类型(trade指商户基于支付宝交易收单的业务账单,signcustomer是指基于商户支付宝余额收入及支出等资金变动的帐务账单) + 'bill_date' => date('Y-m-d', strtotime('-1 month')), // 账单时间(日账单yyyy-MM-dd,月账单 yyyy-MM) + 'bill_type' => 'trade', ]); echo '
';
     var_export($result);
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-notify.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-notify.php
index 0d5911682bb..c400b4e5b56 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-notify.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-notify.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-pos.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-pos.php
index e55c4e2e085..d5823e04b50 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-pos.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-pos.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-refund.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-refund.php
index 487ca7b27dc..ca5b4d470d0 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-refund.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-refund.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
@@ -31,7 +33,7 @@
 
     // 参考链接: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/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-scan.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-scan.php
index 2bc880632c2..62cbd714ad0 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-scan.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-scan.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-account.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-account.php
index 1d2b289e416..a77f7c4a471 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-account.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-account.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-create.php
index 39d0fc42975..987c5464ca1 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-create.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-create.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-query.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-query.php
index 7e7d99feab2..c6942c2e1a3 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-query.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer-query.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer.php
index 4eaf6fb1f6f..11283191dbb 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-transfer.php
@@ -3,20 +3,22 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
 include "../include.php";
 
 // 2. 准备公众号配置参数
-$config = include "./alipay.php";
+$config = include "./alipay2.php";
 
 try {
     // 实例支付对象
@@ -28,10 +30,10 @@
     $result = $pay->apply([
         'out_biz_no'      => time(), // 订单号
         'payee_type'      => 'ALIPAY_LOGONID', // 收款方账户类型(ALIPAY_LOGONID | ALIPAY_USERID)
-        'payee_account'   => 'demo@sandbox.com', // 收款方账户
+        'payee_account'   => 'yvvfcr3065@sandbox.com', // 收款方账户
         'amount'          => '10', // 转账金额
         'payer_show_name' => '未寒', // 付款方姓名
-        'payee_real_name' => '张三', // 收款方真实姓名
+        'payee_real_name' => 'yvvfcr3065', // 收款方真实姓名
         'remark'          => '张三', // 转账备注
     ]);
 
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-wap.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-wap.php
index ac04021d2f0..8ddae77aa92 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-wap.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-wap.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
@@ -18,8 +20,8 @@
 // 2. 准备公众号配置参数
 $config = include "./alipay.php";
 // 参考公共参数  https://docs.open.alipay.com/203/107090/
-$config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php';
-$config['return_url'] = 'http://pay.thinkadmin.top/test/alipay-success.php';
+$config['notify_url'] = 'https://pay.thinkadmin.top/test/alipay-notify.php';
+$config['return_url'] = 'https://pay.thinkadmin.top/test/alipay-success.php';
 
 try {
     // 实例支付对象
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-web.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-web.php
index 46f0efcf07b..c3a3497b9b6 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-web.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay-web.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 1. 手动加载入口文件
@@ -19,8 +21,8 @@
 $config = include "./alipay.php";
 
 // 参考公共参数  https://docs.open.alipay.com/203/107090/
-$config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php';
-$config['return_url'] = 'http://pay.thinkadmin.top/test/alipay-success.php';
+$config['notify_url'] = 'https://pay.thinkadmin.top/test/alipay-notify.php';
+$config['return_url'] = 'https://pay.thinkadmin.top/test/alipay-success.php';
 
 try {
     // 实例支付对象
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay.php
index 25a7379d35d..54bf89c3a62 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay.php
@@ -3,28 +3,56 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
+/**
+ * 【 名词解释 】
+ * 应用私钥:用来给应用消息进行签名,请务必要妥善保管,避免遗失或泄露。
+ * 应用公钥:需要提供给支付宝开放平台,平台会对应用发送的消息进行签名验证。
+ * 支付宝公钥:应用收到支付宝发送的同步、异步消息时,使用支付宝公钥验证签名信息。
+ * CSR 文件:CSR 即证书签名请求(Certificate Signing Request),CSR 文件(.csr)是申请证书时所需要的一个数据文件。
+ * 应用公钥证书:在开放平台上传 CSR 文件后可以获取 CA 机构颁发的应用证书文件(.crt),其中包含了组织/公司名称、应用公钥、证书有效期等内容,一般有效期为 5 年。
+ * 支付宝公钥证书:用来验证支付宝消息,包含了支付宝公钥、支付宝公司名称、证书有效期等内容,一般有效期为 5 年。
+ * 支付宝根证书:用来验证支付宝消息,包含了根 CA 名称、根 CA 的公钥、证书有效期等内容。
+ */
+
+/**
+ * 应用公钥证书SN(app_cert_sn)和支付宝根证书SN(alipay_root_cert_sn)的 sn 是指什么?
+ * 使用公钥证书签名方式下, 请求参数中需要携带应用公钥证书SN(app_cert_sn)、支付宝根证书SN(alipay_root_cert_sn),这里的SN是指基于开放平台提供的计算规则,动态计算出来的公钥证书序列号,与X.509证书中内置的序列号(serialNumber)不同。
+ * 具体的计算规则如下:解析X.509证书文件,获取证书签发机构名称(name)以及证书内置序列号(serialNumber)。 将name与serialNumber拼接成字符串,再对该字符串做MD5计算。
+ * 可以参考开放平台SDK源码中的 AlipaySignature.getCertSN 方法实现
+ *
+ * 不直接使用证书文件中内置的序列号原因:开放平台支持开发者上传自己找第三方权威CA签发的证书,而证书文件中内置序列号只能保证同一家签发机构签发的证书不重复
+ */
+
 return [
     // 沙箱模式
-    'debug'       => true,
-    // 签名类型(RSA|RSA2)
-    'sign_type'   => "RSA2",
+    'debug'            => true,
+    // 签名类型 ( RSA|RSA2 )
+    'sign_type'        => 'RSA2',
     // 应用ID
-    'appid'       => '2016090900468879',
-    // 支付宝公钥(1行填写,特别注意,这里是支付宝公钥,不是应用公钥,最好从开发者中心的网页上去复制)
-    'public_key'  => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtU71NY53UDGY7JNvLYAhsNa+taTF6KthIHJmGgdio9bkqeJGhHk6ttkTKkLqFgwIfgAkHpdKiOv1uZw6gVGZ7TCu5LfHTqKrCd6Uz+N7hxhY+4IwicLgprcV1flXQLmbkJYzFMZqkXGkSgOsR2yXh4LyQZczgk9N456uuzGtRy7MoB4zQy34PLUkkxR6W1B2ftNbLRGXv6tc7p/cmDcrY6K1bSxnGmfRxFSb8lRfhe0V0UM6pKq2SGGSeovrKHN0OLp+Nn5wcULVnFgATXGCENshRlp96piPEBFwneXs19n+sX1jx60FTR7/rME3sW3AHug0fhZ9mSqW4x401WjdnwIDAQAB',
-    // 支付宝私钥(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=',
+    'appid'            => '2021000122667306',
+    // 应用私钥内容 ( 需1行填写,特别注意:这里的应用私钥通常由支付宝密钥管理工具生成 )
+    'private_key'      => 'MIIEowIBAAKCAQEAndH26KVe3Iy+8GxVxDuG9ZolYrqGNm8Jpdi9GrQdM81ad4pPyul2NVO+9C2Kr6a6jK6Qw1gyzcwYxtkUC7xoLZUSPpmSH7sH3sD6r2B7Mf5FsrVSa29lcm1+3UkyFgZjYTkx45lfbLmAFHOzOl0WfGkMW0Sq3N/5OMr074E4EnYtALdE3jVQCDf8bzqN3j/Kwe7f10Aglvxili2BrFM564silqcbiJ8U1zDmTdZvmEkP7ia/YVkmt5w3rh7ZBoaubtcM/rVGYXL2hQPwr/pquNCTu7Eh1RcWfpcnbuw+gOnaNyXmNFmZkeNlegXIifcunt1GK6a1pX090R8eFN3LjQIDAQABAoIBACrLY4OETCvL8n6pMbyLU7ZHfTm/UGN0So5xLh4OlxiT56MgmzBvjAE72zzFGKU2tcEuGM0Pnn8Vh+ZruLbR+QHbOV5GMExwX9r0Q0XJCL7uryGdb2L4iu6zaEJC9dTpGIulgbSwwyJtTqC9Gu2Jjm5f4dzhyt8n0KGozzAevwCqI9RaJSD96gGWLbMlHCyWKGy1OdBP4V/+agPyHAGZ9gqpfKY7y4L0My8gUxhWzQWOwihtFACjV66ULhutUYT2bro3j1k9UekKlX7IiWrssPmmmw2vfUbrKiNugF6zkfyStPt7jGJ0CdzAHWe3pyF72TyO5NU2NGcX8eKgYlY2crUCgYEAzOcg5Zot9X+Ao+fYH/Oq/3eGZd6krzByiXfcjuRco7mGODwmUnzt3PpPT1fPry9TxarTajt+A9LuxqWawfQ9eWAfrTGAbtDJB0LYo6CynDqUoRqBukROuNaLQiUqEreOQqt08o6VVblgVLv8475ij8s4z/6C2NSSjgUJHf0PL38CgYEAxS0bcXGI+WtempZ4Q3QMTUmp/+B3zuw9JzSV1gvbVi7MleI9V62V2IXHPSXL5mRhYOuQWR0MnVOhbo69fkEA8HpdSd1q2JjaeS+OiZ0ditcJISQJbqWtvmF2+XtQcbVwfID69GWGxyBEHHTW8AtAzIPc6T7x2izyzBw0lXDHSvMCgYEAi+Y61ckhG/9EC6TeMWKjG+21u5P6CQshCK7nzkAo6DhhZb/bwnI9zaSxxdCEom3D2rA5zMx1y5KXKNYlBcwGtPpmZk/oCsFOoECJvZ6YlIaCuERq0oyU2yrQxgat5T2iSe7a2El1uKPrG6+GiNCSZu8wCQMSv4zTy1ew0+LWHW0CgYAvX7ESRpcEZjmqprBqdH1oLGS9566hdr0SqF2/ucWPJVteP6dBY6F3Dl1aYbRlvIRxBuf9oS8gtbE5oO4CYZfaL2wujRZYyBDlwPlcMvWgIB4/aish/IiMD1rIgkpHp7JJF6w0ABiryyLSO3hQ4ENHX/85wzfUlawYQkaYCSq45QKBgCdqrv58KD8tDYn4JnaHJNE+5TgKK5cNhYLZLAsYz7x1KfPdkiC7y/hnenn3TWkm4xw8Tw1rJ1ZIJ24iZgTCTO7EEsB7jZegvg4z/4zVbSK2Y4VI1lJ7jlyqmwg0ArimXTNZFoy66h9c9t2smG40YEZCmmmTLEqVlWgyR1MU5iM5',
+    // 公钥模式,支付宝公钥内容 ( 需1行填写,特别注意:这里不是应用公钥而是支付宝公钥,通常是上传应用公钥换取支付宝公钥,在网页可以复制 )
+    'public_key'       => '',
+    // 证书模式,应用公钥证书路径 ( 新版资金类接口转 app_cert_sn,如文件 appCertPublicKey.crt )
+    'app_cert_path'    => __DIR__ . '/alipay/appPublicCert.crt', // 'app_cert' => '证书内容',
+    // 证书模式,支付宝根证书路径 ( 新版资金类接口转 alipay_root_cert_sn,如文件 alipayRootCert.crt )
+    'alipay_root_path' => __DIR__ . '/alipay/alipayRootCert.crt', // 'root_cert' => '证书内容',
+    // 证书模式,支付宝公钥证书路径 ( 未填写 public_key 时启用此参数,如文件 alipayPublicCert.crt )
+    'alipay_cert_path' => __DIR__ . '/alipay/alipayPublicCert.crt', // 'public_key' => '证书内容'
     // 支付成功通知地址
-    'notify_url'  => '',
+    'notify_url'       => '',
     // 网页支付回跳地址
-    'return_url'  => '',
+    'return_url'       => '',
 ];
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayPublicCert.crt b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayPublicCert.crt
new file mode 100644
index 00000000000..0d7d61207b7
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayPublicCert.crt
@@ -0,0 +1,38 @@
+-----BEGIN CERTIFICATE-----
+MIIDszCCApugAwIBAgIQICMFBicVvB1uC0Lc3VFbITANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
+BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjMwNTA2MDYwMTA3WhcNMjQwNTA1MDYwMTA3WjCB
+hDELMAkGA1UEBhMCQ04xHzAdBgNVBAoMFndtaWFrdTY3NDlAc2FuZGJveC5jb20xDzANBgNVBAsM
+BkFsaXBheTFDMEEGA1UEAww65pSv5LuY5a6dKOS4reWbvSnnvZHnu5zmioDmnK/mnInpmZDlhazl
+j7gtMjA4ODcyMTAwMjg0MzQxNDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALkO9F4+
+AB7CLI47hSthHsZFFQxnOiggc4R8pbeb24BkyRc6xJVekYtzuJ8cLSsy1spEX4zguTPc+b7eza5k
+nN1j2pdAfNkzbdEg1Tt4A0b5xbMAfaQtVhwU0aohhLF+i6TTgospMmBwJnN2++Eda6LccrTqS7ff
+x8I2bhkraLlEO4C6pxUcGCyorPLVvRWOTRC/RzxDURHEaGlBPMxxOpeIzYuYNg77OK+Sqp0zb5nk
+U3PO2cpSrOCT4UlrJDmqgSZgwHE0e+9MdBuveLSo1ubG5uGvz8Vjld3hBvVywOAnEuoMBxtSrEbv
+nkz7M0MJBDmQk/D8WSekm2lMGbFDuGUCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
+DQEBCwUAA4IBAQC29uyA9W6uQivhMqc3YyGXPvi4LIOThU1ijeOSpovHiRUGVfaO/qIY4eAQ2ivF
+iKIrUEqcJnWdNN8LZwWdWd6UmInyngq2i+Pf4h3a2MLkV3ZufZNZkJP5GZJxbcjkKlnKuCTKFUd5
+wJ0zo369E+mPdNGlrPLvNXw4ziUpUb4KXmEn1yOVAkQMsBP43K6QB2QVIODrtp4O+rEs80KHgUQh
+cmla+PWGyX2nuwHURxUtEeIeJblra+ntyy+bTYfCVVG8jh4BN5bPExDprRa100aZGsqyExO1xtxk
+4pu0Jag5XRvGyZpmqH27SfQX2oKcsobuDyGCwff/yvYKOZk53JZD
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDszCCApugAwIBAgIQIBkIGbgVxq210KxLJ+YA/TANBgkqhkiG9w0BAQsFADCBhDELMAkGA1UE
+BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxJTAjBgNVBAsMHENlcnRpZmljYXRpb24gQXV0
+aG9yaXR5IHRlc3QxNjA0BgNVBAMMLUFudCBGaW5hbmNpYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
+dHkgUjEgdGVzdDAeFw0xOTA4MTkxMTE2MDBaFw0yNDA4MDExMTE2MDBaMIGRMQswCQYDVQQGEwJD
+TjEbMBkGA1UECgwSQW50IEZpbmFuY2lhbCB0ZXN0MSUwIwYDVQQLDBxDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSB0ZXN0MT4wPAYDVQQDDDVBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y
+aXR5IENsYXNzIDIgUjEgdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO
+ZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC
+5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm
+VUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi
+t25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG
+wpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
+DQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT
+yWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf
+LTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p
+j1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy
+1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW
+-----END CERTIFICATE-----
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayRootCert.crt b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayRootCert.crt
new file mode 100644
index 00000000000..76417c538f5
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/alipayRootCert.crt
@@ -0,0 +1,88 @@
+-----BEGIN CERTIFICATE-----
+MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG
+EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQw
+MzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVO
+UkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE
+MPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRT
+V7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5Yti
+W/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZ
+MxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b
+53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xI
+pDoiVhsLwg==
+-----END CERTIFICATE-----
+
+-----BEGIN CERTIFICATE-----
+MIIF0zCCA7ugAwIBAgIIH8+hjWpIDREwDQYJKoZIhvcNAQELBQAwejELMAkGA1UE
+BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMyMTEzNDg0MFoXDTM4MDIyODEzNDg0
+MFowejELMAkGA1UEBhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNV
+BAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5j
+aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMIICIjANBgkqhkiG9w0BAQEF
+AAOCAg8AMIICCgKCAgEAtytTRcBNuur5h8xuxnlKJetT65cHGemGi8oD+beHFPTk
+rUTlFt9Xn7fAVGo6QSsPb9uGLpUFGEdGmbsQ2q9cV4P89qkH04VzIPwT7AywJdt2
+xAvMs+MgHFJzOYfL1QkdOOVO7NwKxH8IvlQgFabWomWk2Ei9WfUyxFjVO1LVh0Bp
+dRBeWLMkdudx0tl3+21t1apnReFNQ5nfX29xeSxIhesaMHDZFViO/DXDNW2BcTs6
+vSWKyJ4YIIIzStumD8K1xMsoaZBMDxg4itjWFaKRgNuPiIn4kjDY3kC66Sl/6yTl
+YUz8AybbEsICZzssdZh7jcNb1VRfk79lgAprm/Ktl+mgrU1gaMGP1OE25JCbqli1
+Pbw/BpPynyP9+XulE+2mxFwTYhKAwpDIDKuYsFUXuo8t261pCovI1CXFzAQM2w7H
+DtA2nOXSW6q0jGDJ5+WauH+K8ZSvA6x4sFo4u0KNCx0ROTBpLif6GTngqo3sj+98
+SZiMNLFMQoQkjkdN5Q5g9N6CFZPVZ6QpO0JcIc7S1le/g9z5iBKnifrKxy0TQjtG
+PsDwc8ubPnRm/F82RReCoyNyx63indpgFfhN7+KxUIQ9cOwwTvemmor0A+ZQamRe
+9LMuiEfEaWUDK+6O0Gl8lO571uI5onYdN1VIgOmwFbe+D8TcuzVjIZ/zvHrAGUcC
+AwEAAaNdMFswCwYDVR0PBAQDAgEGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFF90
+tATATwda6uWx2yKjh0GynOEBMB8GA1UdIwQYMBaAFF90tATATwda6uWx2yKjh0Gy
+nOEBMA0GCSqGSIb3DQEBCwUAA4ICAQCVYaOtqOLIpsrEikE5lb+UARNSFJg6tpkf
+tJ2U8QF/DejemEHx5IClQu6ajxjtu0Aie4/3UnIXop8nH/Q57l+Wyt9T7N2WPiNq
+JSlYKYbJpPF8LXbuKYG3BTFTdOVFIeRe2NUyYh/xs6bXGr4WKTXb3qBmzR02FSy3
+IODQw5Q6zpXj8prYqFHYsOvGCEc1CwJaSaYwRhTkFedJUxiyhyB5GQwoFfExCVHW
+05ZFCAVYFldCJvUzfzrWubN6wX0DD2dwultgmldOn/W/n8at52mpPNvIdbZb2F41
+T0YZeoWnCJrYXjq/32oc1cmifIHqySnyMnavi75DxPCdZsCOpSAT4j4lAQRGsfgI
+kkLPGQieMfNNkMCKh7qjwdXAVtdqhf0RVtFILH3OyEodlk1HYXqX5iE5wlaKzDop
+PKwf2Q3BErq1xChYGGVS+dEvyXc/2nIBlt7uLWKp4XFjqekKbaGaLJdjYP5b2s7N
+1dM0MXQ/f8XoXKBkJNzEiM3hfsU6DOREgMc1DIsFKxfuMwX3EkVQM1If8ghb6x5Y
+jXayv+NLbidOSzk4vl5QwngO/JYFMkoc6i9LNwEaEtR9PhnrdubxmrtM+RjfBm02
+77q3dSWFESFQ4QxYWew4pHE0DpWbWy/iMIKQ6UZ5RLvB8GEcgt8ON7BBJeMc+Dyi
+kT9qhqn+lw==
+-----END CERTIFICATE-----
+
+-----BEGIN CERTIFICATE-----
+MIICiDCCAgygAwIBAgIIQX76UsB/30owDAYIKoZIzj0EAwMFADB6MQswCQYDVQQG
+EwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UECwwXQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNpYWwgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkgRTEwHhcNMTkwNDI4MTYyMDQ0WhcNNDkwNDIwMTYyMDQ0
+WjB6MQswCQYDVQQGEwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UE
+CwwXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNp
+YWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRTEwdjAQBgcqhkjOPQIBBgUrgQQA
+IgNiAASCCRa94QI0vR5Up9Yr9HEupz6hSoyjySYqo7v837KnmjveUIUNiuC9pWAU
+WP3jwLX3HkzeiNdeg22a0IZPoSUCpasufiLAnfXh6NInLiWBrjLJXDSGaY7vaokt
+rpZvAdmjXTBbMAsGA1UdDwQEAwIBBjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRZ
+4ZTgDpksHL2qcpkFkxD2zVd16TAfBgNVHSMEGDAWgBRZ4ZTgDpksHL2qcpkFkxD2
+zVd16TAMBggqhkjOPQQDAwUAA2gAMGUCMQD4IoqT2hTUn0jt7oXLdMJ8q4vLp6sg
+wHfPiOr9gxreb+e6Oidwd2LDnC4OUqCWiF8CMAzwKs4SnDJYcMLf2vpkbuVE4dTH
+Rglz+HGcTLWsFs4KxLsq7MuU+vJTBUeDJeDjdA==
+-----END CERTIFICATE-----
+
+-----BEGIN CERTIFICATE-----
+MIIDxTCCAq2gAwIBAgIUEMdk6dVgOEIS2cCP0Q43P90Ps5YwDQYJKoZIhvcNAQEF
+BQAwajELMAkGA1UEBhMCQ04xEzARBgNVBAoMCmlUcnVzQ2hpbmExHDAaBgNVBAsM
+E0NoaW5hIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMMH2lUcnVzQ2hpbmEgQ2xhc3Mg
+MiBSb290IENBIC0gRzMwHhcNMTMwNDE4MDkzNjU2WhcNMzMwNDE4MDkzNjU2WjBq
+MQswCQYDVQQGEwJDTjETMBEGA1UECgwKaVRydXNDaGluYTEcMBoGA1UECwwTQ2hp
+bmEgVHJ1c3QgTmV0d29yazEoMCYGA1UEAwwfaVRydXNDaGluYSBDbGFzcyAyIFJv
+b3QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
+nJbMqqCw6Bz1kehnoPst9pkr0V9idOwU2oyS47/HjJXk9Rd5a9xfwkPO88trUpz5
+4GmmwspDXjVFu9L0eFaRuH3KMha1Ak01citbF7cQLJlS7XI+tpkTGHEY5pt3EsQg
+wykfZl/A1jrnSkspMS997r2Gim54cwz+mTMgDRhZsKK/lbOeBPpWtcFizjXYCqhw
+WktvQfZBYi6o4sHCshnOswi4yV1p+LuFcQ2ciYdWvULh1eZhLxHbGXyznYHi0dGN
+z+I9H8aXxqAQfHVhbdHNzi77hCxFjOy+hHrGsyzjrd2swVQ2iUWP8BfEQqGLqM1g
+KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA
+uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF
+MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp
+emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3
+U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I
+UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn
+DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU
+1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX
+Yf4Zr0fJsGuv
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/appPublicCert.crt b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/appPublicCert.crt
new file mode 100644
index 00000000000..586f34184a8
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay/appPublicCert.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDmTCCAoGgAwIBAgIQICMFBmpzKUKQGs/81YT4UDANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
+BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjMwNTA2MDYwMTA3WhcNMjQwNTEwMDYwMTA3WjBr
+MQswCQYDVQQGEwJDTjEfMB0GA1UECgwWd21pYWt1Njc0OUBzYW5kYm94LmNvbTEPMA0GA1UECwwG
+QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDAyODQzNDE0LTIwMjEwMDAxMjI2NjczMDYwggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCd0fbopV7cjL7wbFXEO4b1miViuoY2bwml2L0atB0z
+zVp3ik/K6XY1U770LYqvprqMrpDDWDLNzBjG2RQLvGgtlRI+mZIfuwfewPqvYHsx/kWytVJrb2Vy
+bX7dSTIWBmNhOTHjmV9suYAUc7M6XRZ8aQxbRKrc3/k4yvTvgTgSdi0At0TeNVAIN/xvOo3eP8rB
+7t/XQCCW/GKWLYGsUznriyKWpxuInxTXMOZN1m+YSQ/uJr9hWSa3nDeuHtkGhq5u1wz+tUZhcvaF
+A/Cv+mq40JO7sSHVFxZ+lydu7D6A6do3JeY0WZmR42V6BciJ9y6e3UYrprWlfT3RHx4U3cuNAgMB
+AAGjEjAQMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQsFAAOCAQEAiLA1wk7or0uqxPSD9z31
+BLJRnamf51Uz2YOSDPjUivu9VJrkjf1PsCleK9RSgOcXcpy9QWZSFIIyakFqCCWylgBdjmhSvzAv
+po86ycJXEBrd7klOM/6VFh68BqpmK1CJl0g29JOJ1fNvIKYJ/WS4ue988NSGrpsVhXbNGALhgiBL
+Gqs7KkZQSsIAySx2HNCSknFM5G5xG6IR6wUJ619khba6rMaKOJ3D7mxuv0Vjyu7DrFBsPLOSdjP1
+Jzi5WmutetJGVrbOKayVjL4xDcU7lgOWTrhTs7S54Z6GnxqRLwy8gD7RmDbXtnVyGP/mUcAgnFtE
+BPFZBe7qjqsCCkf+Zw==
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay2.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay2.php
new file mode 100644
index 00000000000..19635431223
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/alipay2.php
@@ -0,0 +1,58 @@
+ true,
+    // 签名类型 ( RSA|RSA2 )
+    'sign_type'        => 'RSA2',
+    // 应用ID
+    'appid'            => '2021000122667306',
+    // 应用私钥内容 ( 需1行填写,特别注意:这里的应用私钥通常由支付宝密钥管理工具生成 )
+    'private_key'      => 'MIIEowIBAAKCAQEAndH26KVe3Iy+8GxVxDuG9ZolYrqGNm8Jpdi9GrQdM81ad4pPyul2NVO+9C2Kr6a6jK6Qw1gyzcwYxtkUC7xoLZUSPpmSH7sH3sD6r2B7Mf5FsrVSa29lcm1+3UkyFgZjYTkx45lfbLmAFHOzOl0WfGkMW0Sq3N/5OMr074E4EnYtALdE3jVQCDf8bzqN3j/Kwe7f10Aglvxili2BrFM564silqcbiJ8U1zDmTdZvmEkP7ia/YVkmt5w3rh7ZBoaubtcM/rVGYXL2hQPwr/pquNCTu7Eh1RcWfpcnbuw+gOnaNyXmNFmZkeNlegXIifcunt1GK6a1pX090R8eFN3LjQIDAQABAoIBACrLY4OETCvL8n6pMbyLU7ZHfTm/UGN0So5xLh4OlxiT56MgmzBvjAE72zzFGKU2tcEuGM0Pnn8Vh+ZruLbR+QHbOV5GMExwX9r0Q0XJCL7uryGdb2L4iu6zaEJC9dTpGIulgbSwwyJtTqC9Gu2Jjm5f4dzhyt8n0KGozzAevwCqI9RaJSD96gGWLbMlHCyWKGy1OdBP4V/+agPyHAGZ9gqpfKY7y4L0My8gUxhWzQWOwihtFACjV66ULhutUYT2bro3j1k9UekKlX7IiWrssPmmmw2vfUbrKiNugF6zkfyStPt7jGJ0CdzAHWe3pyF72TyO5NU2NGcX8eKgYlY2crUCgYEAzOcg5Zot9X+Ao+fYH/Oq/3eGZd6krzByiXfcjuRco7mGODwmUnzt3PpPT1fPry9TxarTajt+A9LuxqWawfQ9eWAfrTGAbtDJB0LYo6CynDqUoRqBukROuNaLQiUqEreOQqt08o6VVblgVLv8475ij8s4z/6C2NSSjgUJHf0PL38CgYEAxS0bcXGI+WtempZ4Q3QMTUmp/+B3zuw9JzSV1gvbVi7MleI9V62V2IXHPSXL5mRhYOuQWR0MnVOhbo69fkEA8HpdSd1q2JjaeS+OiZ0ditcJISQJbqWtvmF2+XtQcbVwfID69GWGxyBEHHTW8AtAzIPc6T7x2izyzBw0lXDHSvMCgYEAi+Y61ckhG/9EC6TeMWKjG+21u5P6CQshCK7nzkAo6DhhZb/bwnI9zaSxxdCEom3D2rA5zMx1y5KXKNYlBcwGtPpmZk/oCsFOoECJvZ6YlIaCuERq0oyU2yrQxgat5T2iSe7a2El1uKPrG6+GiNCSZu8wCQMSv4zTy1ew0+LWHW0CgYAvX7ESRpcEZjmqprBqdH1oLGS9566hdr0SqF2/ucWPJVteP6dBY6F3Dl1aYbRlvIRxBuf9oS8gtbE5oO4CYZfaL2wujRZYyBDlwPlcMvWgIB4/aish/IiMD1rIgkpHp7JJF6w0ABiryyLSO3hQ4ENHX/85wzfUlawYQkaYCSq45QKBgCdqrv58KD8tDYn4JnaHJNE+5TgKK5cNhYLZLAsYz7x1KfPdkiC7y/hnenn3TWkm4xw8Tw1rJ1ZIJ24iZgTCTO7EEsB7jZegvg4z/4zVbSK2Y4VI1lJ7jlyqmwg0ArimXTNZFoy66h9c9t2smG40YEZCmmmTLEqVlWgyR1MU5iM5',
+    // 公钥模式,支付宝公钥内容 ( 需1行填写,特别注意:这里不是应用公钥而是支付宝公钥,通常是上传应用公钥换取支付宝公钥,在网页可以复制 )
+    'public_key'       => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuQ70Xj4AHsIsjjuFK2EexkUVDGc6KCBzhHylt5vbgGTJFzrElV6Ri3O4nxwtKzLWykRfjOC5M9z5vt7NrmSc3WPal0B82TNt0SDVO3gDRvnFswB9pC1WHBTRqiGEsX6LpNOCiykyYHAmc3b74R1rotxytOpLt9/HwjZuGStouUQ7gLqnFRwYLKis8tW9FY5NEL9HPENREcRoaUE8zHE6l4jNi5g2Dvs4r5KqnTNvmeRTc87ZylKs4JPhSWskOaqBJmDAcTR770x0G694tKjW5sbm4a/PxWOV3eEG9XLA4CcS6gwHG1KsRu+eTPszQwkEOZCT8PxZJ6SbaUwZsUO4ZQIDAQAB',
+    // 证书模式,应用公钥证书路径 ( 新版资金类接口转 app_cert_sn,如文件 appCertPublicKey.crt )
+    'app_cert_path'    => __DIR__ . '/alipay/appPublicCert.crt', // 'app_cert' => '证书内容',
+    // 证书模式,支付宝根证书路径 ( 新版资金类接口转 alipay_root_cert_sn,如文件 alipayRootCert.crt )
+    'alipay_root_path' => __DIR__ . '/alipay/alipayRootCert.crt', // 'root_cert' => '证书内容',
+    // 证书模式,支付宝公钥证书路径 ( 未填写 public_key 时启用此参数,如文件 alipayPublicCert.crt )
+    // 'alipay_cert_path' => __DIR__ . '/alipay/alipayPublicCert.crt', // 'public_key' => '证书内容'
+    // 支付成功通知地址
+    'notify_url'       => '',
+    // 网页支付回跳地址
+    'return_url'       => '',
+];
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/config.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/config.php
index e6f8075845a..677d67b0094 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/config.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/config.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 // 配置缓存处理函数
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/mini-login.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/mini-login.php
index c6f56bac087..b5e8e302268 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/mini-login.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/mini-login.php
@@ -1,5 +1,19 @@
  time(),
         'total_fee'        => '1',
         'openid'           => 'o38gpszoJoC9oJYz3UHHf6bEp0Lo',
-        'trade_type'       => 'JSAPI',
-        'notify_url'       => 'http://a.com/text.html',
+        'trade_type'       => 'JSAPI', // JSAPI--JSAPI支付(服务号或小程序支付)、NATIVE--Native 支付、APP--APP支付,MWEB--H5支付
+        'notify_url'       => 'https://a.com/text.html',
         'spbill_create_ip' => '127.0.0.1',
     ];
+
     // 生成预支付码
     $result = $wechat->createOrder($options);
+
+    echo '
';
+    if ($options['trade_type'] === 'NATIVE') {
+        echo '

二维码 NATIVE 支付,直接使用 code_url 生成二维码即可

'; + var_export($result); + return; + } + // 创建JSAPI参数签名 $options = $wechat->createParamsForJsApi($result['prepay_id']); - echo '
';
-    echo "\n--- 创建预支付码 ---\n";
+    echo "

--- 创建 JSAPI 预支付码 ---

"; var_export($result); +// array( +// 'return_code' => 'SUCCESS', +// 'return_msg' => 'OK', +// 'result_code' => 'SUCCESS', +// 'mch_id' => '1332187001', +// 'appid' => 'wx60a43dd8161666d4', +// 'nonce_str' => 'YIPDbGWT1jpLLM5R', +// 'sign' => '7EBBA1B5F196CF122C920D10FA768D96', +// 'prepay_id' => 'wx211858080224615a10c2fc9f6c824f0000', +// 'trade_type' => 'JSAPI', +// ) - echo "\n\n--- JSAPI 及 H5 参数 ---\n"; + echo "

--- 生成 JSAPI 及 H5 支付参数 ---

"; var_export($options); +// array( +// 'appId' => 'wx60a43dd8161666d4', +// 'timeStamp' => '1669028299', +// 'nonceStr' => '5s7h0dyp0nmzylbqytb462fpnb0tmrjg', +// 'package' => 'prepay_id=wx21185819502283c23cca162e9d787f0000', +// 'signType' => 'MD5', +// 'paySign' => 'BBE0F426B8E1EEC9E45AC4459E8AE9D6', +// 'timestamp' => '1669028299', +// ) -} catch (Exception $e) { +} catch (Exception $exception) { // 出错啦,处理下吧 - echo $e->getMessage() . PHP_EOL; + echo $exception->getMessage() . PHP_EOL; } \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-notify.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-notify.php index 7484aace977..32a84f5a03a 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-notify.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-notify.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-query.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-query.php index b7edf34a1b3..23e917865c2 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-query.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-order-query.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-redpack-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-redpack-create.php index c45dadeb428..f614f59da0f 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-redpack-create.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-redpack-create.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-create.php index 8e3df01ffc5..21e79d5043c 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-create.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-create.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { @@ -28,7 +30,7 @@ // 4. 组装参数,可以参考官方商户文档 $options = [ 'transaction_id' => '1008450740201411110005820873', - 'out_refund_no' => '商户退款单号', + 'out_refund_no' => '3241251235123', 'total_fee' => '1', 'refund_fee' => '1', ]; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-query.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-query.php index fa63acc9eb9..3af6db3aa65 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-query.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-refund-query.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfers-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfers-create.php index 659d888e2d8..4053445f2d2 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfers-create.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfers-create.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfersbank-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfersbank-create.php index ca3979edfe8..885ab249e55 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfersbank-create.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-transfersbank-create.php @@ -3,13 +3,15 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- try { diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config-cert.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config-cert.php new file mode 100644 index 00000000000..6b689af5f92 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config-cert.php @@ -0,0 +1,31 @@ +download(); + +} catch (\Exception $exception) { + // 出错啦,处理下吧 + echo $exception->getMessage() . PHP_EOL; +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config.php new file mode 100644 index 00000000000..1723fd4b5c9 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-config.php @@ -0,0 +1,44 @@ + '', + // 必填,微信商户编号ID + 'mch_id' => '', + // 必填,微信商户V3接口密钥 + 'mch_v3_key' => '', + // 可选,微信商户证书序列号,可从公钥中提取 + 'cert_serial' => '', + // 必填,微信商户证书公钥,支持证书内容或文件路径 + 'cert_public' => $certPublic, + // 必填,微信商户证书私钥,支持证书内容或文件路径 + 'cert_private' => $certPrivate, + // 可选,运行时的文件缓存路径 + 'cache_path' => '' +]; \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-app.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-app.php new file mode 100644 index 00000000000..aa932bacd3e --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-app.php @@ -0,0 +1,64 @@ +create('app', [ + 'appid' => $config['appid'], + 'mchid' => $config['mch_id'], + 'description' => '商品描述', + 'out_trade_no' => $order, + 'notify_url' => 'https://thinkadmin.top', + 'amount' => ['total' => 2, 'currency' => 'CNY'], + ]); + + echo '
';
+    echo "\n--- 创建支付参数 ---\n";
+    var_export($result);
+
+    // 创建退款
+    $out_refund_no = strval(time());
+    $result = $payment->createRefund([
+        'out_trade_no'  => $order,
+        'out_refund_no' => $out_refund_no,
+        'amount'        => [
+            'refund'   => 2,
+            'total'    => 2,
+            'currency' => 'CNY'
+        ]
+    ]);
+    echo "\n--- 创建退款订单 ---\n";
+    var_export($result);
+
+    $result = $payment->queryRefund($out_refund_no);
+
+    echo "\n--- 查询退款订单 ---\n";
+    var_export($result);
+
+} catch (\Exception $exception) {
+    // 出错啦,处理下吧
+    echo $exception->getMessage() . PHP_EOL;
+}
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-h5.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-h5.php
new file mode 100644
index 00000000000..784a2def4f0
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-h5.php
@@ -0,0 +1,50 @@
+create('h5', [
+        'appid'        => $config['appid'],
+        'mchid'        => $config['mch_id'],
+        'description'  => '商品描述',
+        'out_trade_no' => (string)time(),
+        'notify_url'   => 'https://thinkadmin.top',
+        'amount'       => ['total' => 2, 'currency' => 'CNY'],
+        'scene_info'   => [
+            'h5_info'         => [
+                'type' => 'Wap',
+            ],
+            'payer_client_ip' => '14.23.150.211',
+        ],
+    ]);
+
+    echo '
';
+    echo "\n--- 创建支付参数 ---\n";
+    var_export($result);
+
+} catch (\Exception $exception) {
+    // 出错啦,处理下吧
+    echo $exception->getMessage() . PHP_EOL;
+}
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-jsapi.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-jsapi.php
new file mode 100644
index 00000000000..3abe35730c6
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-jsapi.php
@@ -0,0 +1,89 @@
+create('jsapi', [
+        'appid'        => $config['appid'],
+        'mchid'        => $config['mch_id'],
+        'description'  => '商品描述',
+        'out_trade_no' => $order,
+        'notify_url'   => 'https://thinkadmin.top',
+        'payer'        => ['openid' => 'o38gps3vNdCqaggFfrBRCRikwlWY'],
+        'amount'       => ['total' => 2, 'currency' => 'CNY'],
+    ]);
+
+    echo '
';
+    echo "\n--- 创建支付参数 ---\n";
+    var_export($result);
+
+//    array(
+//        'appId'     => 'wx60a43dd8161666d4',
+//        'timeStamp' => '1669027650',
+//        'nonceStr'  => 'dfscg4lm02uqy448kjd1kjs2eo26joom',
+//        'package'   => 'prepay_id=wx211847302881094d83b1917194ca880000',
+//        'signType'  => 'RSA',
+//        'paySign'   => '1wvvi4vmcJmP3GXB0H52mxp8lOhyqE4BtLmyi3Flg8DVKCES4fsb6+0z/L9sYkbp/TNinsnK0k7mUpTe2Yo86P1DLg18fR7zsIn5u1+3tI58boHk3VsAJl4Uhlti9ME3T7kRq1bEb4DGxp16+ixRynOqndkIkYXxrREhsrZIQlsGMfNCV0K1707s7jBTgqIm1vlkpIjNEg8nbcuG88Vzly4dR1a9K6Fux+sm0gu2rMroRwIo2R/0rgHGDANmnAZj6YEfLZlRrGTbr9r0V1+HHQPvV4BJLvTG8KXVJmJSJzBWSgq31PwrLWdOwdtpNKk7wJbY7yoScYUysYqqzM4DTQ==',
+//    );
+
+    echo "\n\n--- 查询支付参数 ---\n";
+    $result = $payment->query($order);
+    var_export($result);
+
+//    array(
+//        'amount'           => array('payer_currency' => 'CNY', 'total' => 2),
+//        'appid'            => 'wx60a43dd8161666d4',
+//        'mchid'            => '1332187001',
+//        'out_trade_no'     => '1669027802',
+//        'promotion_detail' => array(),
+//        'scene_info'       => array('device_id' => ''),
+//        'trade_state'      => 'NOTPAY',
+//        'trade_state_desc' => '订单未支付',
+//    );
+
+    // 创建退款
+    $out_refund_no = strval(time());
+    $result = $payment->createRefund([
+        'out_trade_no'  => $order,
+        'out_refund_no' => $out_refund_no,
+        'amount'        => [
+            'refund'   => 2,
+            'total'    => 2,
+            'currency' => 'CNY'
+        ]
+    ]);
+    echo "\n--- 创建退款订单2 ---\n";
+    var_export($result);
+
+    $result = $payment->queryRefund($out_refund_no);
+
+    echo "\n--- 查询退款订单2 ---\n";
+    var_export($result);
+
+} catch (\Exception $exception) {
+    // 出错啦,处理下吧
+    echo $exception->getMessage() . PHP_EOL;
+}
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-native.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-native.php
new file mode 100644
index 00000000000..9a6d5ee3312
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-order-native.php
@@ -0,0 +1,82 @@
+create('native', [
+        'appid'        => $config['appid'],
+        'mchid'        => $config['mch_id'],
+        'description'  => '商品描述',
+        'out_trade_no' => $order,
+        'notify_url'   => 'https://thinkadmin.top',
+        'amount'       => ['total' => 2, 'currency' => 'CNY'],
+    ]);
+
+    echo '
';
+    echo "\n--- 创建支付参数 ---\n";
+    var_export($result);
+
+//  array('code_url' => 'weixin://wxpay/bizpayurl?pr=cdJXOVDzz');
+
+
+    echo "\n\n--- 查询支付参数 ---\n";
+    $result = $payment->query($order);
+    var_export($result);
+
+//    array(
+//        'amount'           => array('payer_currency' => 'CNY', 'total' => 2),
+//        'appid'            => 'wx60a43dd8161666d4',
+//        'mchid'            => '1332187001',
+//        'out_trade_no'     => '1669027871',
+//        'promotion_detail' => array(),
+//        'scene_info'       => array('device_id' => ''),
+//        'trade_state'      => 'NOTPAY',
+//        'trade_state_desc' => '订单未支付',
+//    );
+
+    // 创建退款
+    $out_refund_no = strval(time());
+    $result = $payment->createRefund([
+        'out_trade_no'  => $order,
+        'out_refund_no' => $out_refund_no,
+        'amount'        => [
+            'refund'   => 2,
+            'total'    => 2,
+            'currency' => 'CNY'
+        ]
+    ]);
+    echo "\n--- 创建退款订单2 ---\n";
+    var_export($result);
+
+    $result = $payment->queryRefund($out_refund_no);
+
+    echo "\n--- 查询退款订单2 ---\n";
+    var_export($result);
+
+} catch (\Exception $exception) {
+    // 出错啦,处理下吧
+    echo $exception->getMessage() . PHP_EOL;
+}
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-transfer.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-transfer.php
new file mode 100644
index 00000000000..bc018b06a7d
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/pay-v3-transfer.php
@@ -0,0 +1,48 @@
+batchs([
+        'out_batch_no'         => 'plfk2020042013',
+        'batch_name'           => '2019年1月深圳分部报销单',
+        'batch_remark'         => '2019年1月深圳分部报销单',
+        'total_amount'         => 100,
+        'transfer_detail_list' => [
+            [
+                'out_detail_no'   => 'x23zy545Bd5436',
+                'transfer_amount' => 100,
+                'transfer_remark' => '2020年4月报销',
+                'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
+                'user_name'       => '小小邹'
+            ]
+        ]
+    ]);
+
+    echo "\n--- 批量打款 ---\n";
+    var_export($result);
+
+} catch (\Exception $exception) {
+    // 出错啦,处理下吧
+    echo $exception->getMessage() . PHP_EOL;
+}
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-jssdk-sign.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-jssdk-sign.php
index 6a3b6985c56..89d5ea11a56 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-jssdk-sign.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-jssdk-sign.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 try {
@@ -26,7 +28,7 @@
     $wechat = \WeChat\Script::instance($config);
 
     // 4. 获取JSSDK网址签名配置
-    $result = $wechat->getJsSign('http://a.com/test.php');
+    $result = $wechat->getJsSign('https://a.com/test.php');
 
     var_export($result);
 
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-menu-get.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-menu-get.php
index 5447aad17e3..1622fba8555 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-menu-get.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-menu-get.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 try {
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-qrcode-create.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-qrcode-create.php
index 256e30ad955..9470892aee4 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-qrcode-create.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-qrcode-create.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 try {
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-user-get.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-user-get.php
index d42cb5632cf..299c25268be 100644
--- a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-user-get.php
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/wechat-user-get.php
@@ -3,13 +3,15 @@
 // +----------------------------------------------------------------------
 // | WeChatDeveloper
 // +----------------------------------------------------------------------
-// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
 // +----------------------------------------------------------------------
-// | 官方网站: http://think.ctolog.com
+// | 官方网站: https://thinkadmin.top
 // +----------------------------------------------------------------------
 // | 开源协议 ( https://mit-license.org )
+// | 免责声明 ( https://thinkadmin.top/disclaimer )
 // +----------------------------------------------------------------------
-// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
+// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
 // +----------------------------------------------------------------------
 
 try {
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-config.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-config.php
new file mode 100644
index 00000000000..799cdf42bc1
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-config.php
@@ -0,0 +1,20 @@
+ '', // 企业ID
+    'appsecret' => '', // 应用的凭证密钥
+];
\ No newline at end of file
diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-department.php b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-department.php
new file mode 100644
index 00000000000..a894d72028c
--- /dev/null
+++ b/upload/system/storage/vendor/zoujingli/wechat-developer/_test/work-department.php
@@ -0,0 +1,32 @@
+callGetApi($url);
+    echo '
';
+    print_r(BasicWeWork::instance($config)->config->get());
+    print_r($result);
+    echo '
'; +} catch (Exception $exception) { + echo $exception->getMessage() . PHP_EOL; +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/composer.json b/upload/system/storage/vendor/zoujingli/wechat-developer/composer.json index d8ee7c14c5f..ed28ef599b4 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/composer.json +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/composer.json @@ -1,18 +1,17 @@ { "type": "library", "name": "zoujingli/wechat-developer", - "homepage": "https://github.com/zoujingli/WeChatDeveloper", - "description": "WeChat platform and WeChat payment development tools", + "homepage": "https://thinkadmin.top", + "description": "WeChat and Alipay Platform Development", "license": "MIT", "authors": [ { "name": "Anyon", "email": "zoujingli@qq.com", - "homepage": "http://ctolog.com" + "homepage": "https://thinkadmin.top" } ], "keywords": [ - "WePay", "AliPay", "WeMini", "WeChat", @@ -21,8 +20,10 @@ ], "require": { "php": ">=5.4", + "ext-xml": "*", "ext-json": "*", "ext-curl": "*", + "ext-bcmath": "*", "ext-libxml": "*", "ext-openssl": "*", "ext-mbstring": "*", @@ -34,9 +35,10 @@ ], "psr-4": { "WePay\\": "WePay", - "WeMini\\": "WeMini", "WeChat\\": "WeChat", - "AliPay\\": "AliPay" + "WeMini\\": "WeMini", + "AliPay\\": "AliPay", + "WePayV3\\": "WePayV3" } } -} \ No newline at end of file +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/include.php b/upload/system/storage/vendor/zoujingli/wechat-developer/include.php index e88c70ececa..b14e03d7df4 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/include.php +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/include.php @@ -3,20 +3,22 @@ // +---------------------------------------------------------------------- // | WeChatDeveloper // +---------------------------------------------------------------------- -// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // +---------------------------------------------------------------------- -// | 官方网站: http://think.ctolog.com +// | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- // | 开源协议 ( https://mit-license.org ) +// | 免责声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- -// | github开源项目:https://github.com/zoujingli/WeChatDeveloper +// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper +// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper // +---------------------------------------------------------------------- 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; diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/MIT-LICENSE.txt b/upload/system/storage/vendor/zoujingli/wechat-developer/license similarity index 95% rename from upload/system/storage/vendor/zoujingli/wechat-developer/MIT-LICENSE.txt rename to upload/system/storage/vendor/zoujingli/wechat-developer/license index bceed538078..a3fafa8411a 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/MIT-LICENSE.txt +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/license @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2014-2018 Anyon +Copyright (c) 2014-2023 Anyon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/upload/system/storage/vendor/zoujingli/wechat-developer/readme.md b/upload/system/storage/vendor/zoujingli/wechat-developer/readme.md index 529d1f4b89e..a39cddf9260 100644 --- a/upload/system/storage/vendor/zoujingli/wechat-developer/readme.md +++ b/upload/system/storage/vendor/zoujingli/wechat-developer/readme.md @@ -1,19 +1,23 @@ -[![Latest Stable Version](https://poser.pugx.org/zoujingli/wechat-developer/v/stable)](https://packagist.org/packages/zoujingli/wechat-developer) -[![Latest Unstable Version](https://poser.pugx.org/zoujingli/wechat-developer/v/unstable)](https://packagist.org/packages/zoujingli/wechat-developer) -[![Total Downloads](https://poser.pugx.org/zoujingli/wechat-developer/downloads)](https://packagist.org/packages/zoujingli/wechat-developer) +# WeChatDeveloper for PHP + +[![Latest Stable Version](https://poser.pugx.org/zoujingli/wechat-developer/v/stable)](https://packagist.org/packages/zoujingli/wechat-developer) +[![Total Downloads](https://poser.pugx.org/zoujingli/wechat-developer/downloads)](https://packagist.org/packages/zoujingli/wechat-developer) +[![Monthly Downloads](https://poser.pugx.org/zoujingli/wechat-developer/d/monthly)](https://packagist.org/packages/zoujingli/wechat-developer) +[![Daily Downloads](https://poser.pugx.org/zoujingli/wechat-developer/d/daily)](https://packagist.org/packages/zoujingli/wechat-developer) +[![PHP Version Require](http://poser.pugx.org/zoujingli/wechat-developer/require/php)](https://packagist.org/packages/wechat-developer) [![License](https://poser.pugx.org/zoujingli/wechat-developer/license)](https://packagist.org/packages/zoujingli/wechat-developer) -WeChatDeveloper for PHP ----- * WeChatDeveloper 是基于 [wechat-php-sdk](https://github.com/zoujingli/wechat-php-sdk) 重构,优化并完善; * 运行最底要求 PHP 版本 5.4 , 建议在 PHP7 上运行以获取最佳性能; -* WeChatDeveloper 针对 access_token 失效增加了自动刷新机制; -* 微信的部分接口需要缓存数据在本地,因此对目录需要有写权限; +* 目前 WeChatDeveloper 针对 access_token 失效增加了自动刷新机制; +* 微信的部分接口需要缓存数据在本地,因此配置目录并需要对目录有写权限; * 我们鼓励大家使用 composer 来管理您的第三方库,方便后期更新操作; * WeChatDeveloper 已历经数个线上项目考验,欢迎 fork 或 star 此项目。 +* 微信商户已经支持 v2 和 v3 接口,未加入的接口可以使用通用方式调用。 功能描述 ---- + * 微信小程序,服务端接口支持 * 微信认证服务号,服务端接口支持 * 微信支付(账单、卡券、红包、退款、转账、App支付、JSAPI支付、Web支付、扫码支付等) @@ -23,68 +27,72 @@ WeChatDeveloper for PHP ---- PHP开发技术交流(QQ群 513350915) -[![PHP微信开发群 (SDK)](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a) +[![PHP微信开发群 (SDK)](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a) WeChatDeveloper 是基于官方接口封装,在做微信开发前,必需先阅读微信官方文档。 + * 微信官方文档:https://mp.weixin.qq.com/wiki * 商户支付文档:https://pay.weixin.qq.com/wiki/doc/api/index.html 针对 WeChatDeveloper 也有一准备了帮助资料可供参考。 + * ThinkAdmin:https://github.com/zoujingli/ThinkAdmin * WeChatDeveloper:https://www.kancloud.cn/zoujingli/wechat-developer - 代码仓库 ---- WeChatDeveloper 为开源项目,允许把它用于任何地方,不受任何约束,欢迎 fork 项目。 + * Gitee 托管地址:https://gitee.com/zoujingli/WeChatDeveloper * GitHub 托管地址:https://github.com/zoujingli/WeChatDeveloper -文件说明 +文件说明(后续会根据官方文档增加文件) ---- -|文件名|类名|描述|类型|加载 ①| -|---|---|---|---|---| -| App.php | AliPay\App | 支付宝App支付 | 支付宝支付 | \We::AliPayApp() | -| Bill.php | AliPay\Bill | 支付宝账单下载 | 支付宝支付 | \We::AliPayBill() | -| Pos.php | AliPay\Pos | 支付宝刷卡支付 | 支付宝支付 | \We::AliPayPos() | -| Scan.php | AliPay\Scan | 支付宝扫码支付 | 支付宝支付 | \We::AliPayScan() | -| Transfer.php | AliPay\Transfer | 支付宝转账 | 支付宝支付 | \We::AliPayTransfer() | -| Wap.php | AliPay\Wap | 支付宝Wap支付 | 支付宝支付 | \We::AliPayWap() | -| Web.php | AliPay\Web | 支付宝Web支付 | 支付宝支付 | \We::AliPayWeb() | -| Card.php | WeChat\Card | 微信卡券接口支持 | 认证服务号 | \We::WeChatCard() | -| Custom.php | WeChat\Custom | 微信客服消息接口支持 | 认证服务号 | \We::WeChatCustom() | -| Media.php | WeChat\Media | 微信媒体素材接口支持 | 认证服务号 | \We::WeChatMedia() | -| Oauth.php | WeChat\Oauth | 微信网页授权消息类接口 | 认证服务号 | \We::WeChatOauth() | -| Pay.php | WeChat\Pay | 微信支付类接口 | 认证服务号 | \We::WeChatPay() | -| Product.php | WeChat\Product | 微信商店类接口 | 认证服务号 | \We::WeChatProduct() | -| Qrcode.php | WeChat\Qrcode | 微信二维码接口支持 | 认证服务号 | \We::WeChatQrcode() | -| Receive.php | WeChat\Receive | 微信推送事件消息处理支持 | 认证服务号 | \We::WeChatReceive() | -| Scan.php | WeChat\Scan | 微信扫一扫接口支持 | 认证服务号 | \We::WeChatScan() | -| Script.php | WeChat\Script | 微信前端JSSDK支持 | 认证服务号 | \We::WeChatScript() | -| Shake.php | WeChat\Shake | 微信蓝牙设备揺一揺接口 | 认证服务号 | \We::WeChatShake() | -| Tags.php | WeChat\Tags | 微信粉丝标签接口支持 | 认证服务号 | \We::WeChatTags() | -| Template.php | WeChat\Template | 微信模板消息接口支持 | 认证服务号 | \We::WeChatTemplate() | -| User.php | WeChat\User | 微信粉丝管理接口支持 | 认证服务号 | \We::WeChatCard() | -| Wifi.php | WeChat\Wifi | 微信门店WIFI管理支持 | 认证服务号 | \We::WeChatWifi() | -| Bill.php | WePay\Bill | 微信商户账单及评论 | 微信支付 | \We::WePayBill() | -| Coupon.php | WePay\Coupon | 微信商户代金券 | 微信支付 | \We::WePayCoupon() | -| Order.php | WePay\Order | 微信商户订单 | 微信支付 | \We::WePayOrder() | -| Redpack.php | WePay\Redpack | 微信红包支持 | 微信支付 | \We::WePayRedpack() | -| Refund.php | WePay\Refund | 微信商户退款 | 微信支付 | \We::WePayRefund() | -| Transfers.php | WePay\Transfers | 微信商户打款到零钱 | 微信支付 | \We::WePayTransfers() | -| TransfersBank.php | WePay\TransfersBank | 微信商户打款到银行卡 | 微信支付 | \We::WePayTransfersBank() | -| Crypt.php | WeMini\Crypt | 微信小程序数据加密处理 | 微信小程序 | \We::WeMiniCrypt() | -| Plugs.php | WeMini\Plugs | 微信小程序插件管理 | 微信小程序 | \We::WeMiniPlugs() | -| Poi.php | WeMini\Poi | 微信小程序地址管理 | 微信小程序 | \We::WeMiniPoi() | -| Qrcode.php | WeMini\Qrcode | 微信小程序二维码管理 | 微信小程序 | \We::WeMiniCrypt() | -| Template.php | WeMini\Template | 微信小程序模板消息支持 | 微信小程序 | \We::WeMiniTemplate() | -| Total.php | WeMini\Total | 微信小程序数据接口 | 微信小程序 | \We::WeMiniTotal() | - +| 文件名 | 类名 | 描述 | 类型 | 加载 ① | +|-------------------|---------------------|--------------|-------|---------------------------| +| App.php | AliPay\App | 支付宝App支付 | 支付宝支付 | \We::AliPayApp() | +| Bill.php | AliPay\Bill | 支付宝账单下载 | 支付宝支付 | \We::AliPayBill() | +| Pos.php | AliPay\Pos | 支付宝刷卡支付 | 支付宝支付 | \We::AliPayPos() | +| Scan.php | AliPay\Scan | 支付宝扫码支付 | 支付宝支付 | \We::AliPayScan() | +| Transfer.php | AliPay\Transfer | 支付宝转账 | 支付宝支付 | \We::AliPayTransfer() | +| Wap.php | AliPay\Wap | 支付宝Wap支付 | 支付宝支付 | \We::AliPayWap() | +| Web.php | AliPay\Web | 支付宝Web支付 | 支付宝支付 | \We::AliPayWeb() | +| Card.php | WeChat\Card | 微信卡券接口支持 | 认证服务号 | \We::WeChatCard() | +| Custom.php | WeChat\Custom | 微信客服消息接口支持 | 认证服务号 | \We::WeChatCustom() | +| Media.php | WeChat\Media | 微信媒体素材接口支持 | 认证服务号 | \We::WeChatMedia() | +| Oauth.php | WeChat\Oauth | 微信网页授权消息类接口 | 认证服务号 | \We::WeChatOauth() | +| Pay.php | WeChat\Pay | 微信支付类接口 | 认证服务号 | \We::WeChatPay() | +| Product.php | WeChat\Product | 微信商店类接口 | 认证服务号 | \We::WeChatProduct() | +| Qrcode.php | WeChat\Qrcode | 微信二维码接口支持 | 认证服务号 | \We::WeChatQrcode() | +| Receive.php | WeChat\Receive | 微信推送事件消息处理支持 | 认证服务号 | \We::WeChatReceive() | +| Scan.php | WeChat\Scan | 微信扫一扫接口支持 | 认证服务号 | \We::WeChatScan() | +| Script.php | WeChat\Script | 微信前端JSSDK支持 | 认证服务号 | \We::WeChatScript() | +| Shake.php | WeChat\Shake | 微信蓝牙设备揺一揺接口 | 认证服务号 | \We::WeChatShake() | +| Tags.php | WeChat\Tags | 微信粉丝标签接口支持 | 认证服务号 | \We::WeChatTags() | +| Template.php | WeChat\Template | 微信模板消息接口支持 | 认证服务号 | \We::WeChatTemplate() | +| User.php | WeChat\User | 微信粉丝管理接口支持 | 认证服务号 | \We::WeChatCard() | +| Wifi.php | WeChat\Wifi | 微信门店WIFI管理支持 | 认证服务号 | \We::WeChatWifi() | +| Draft.php | WeChat\Draft | 微信草稿箱 | 认证服务号 | \We::WeChatDraft() | +| Freepublish.php | WeChat\Freepublish | 微信发布能力 | 认证服务号 | \We::WeChatFreepublish() | +| Bill.php | WePay\Bill | 微信商户账单及评论 | 微信支付 | \We::WePayBill() | +| Coupon.php | WePay\Coupon | 微信商户代金券 | 微信支付 | \We::WePayCoupon() | +| Order.php | WePay\Order | 微信商户订单 | 微信支付 | \We::WePayOrder() | +| Redpack.php | WePay\Redpack | 微信红包支持 | 微信支付 | \We::WePayRedpack() | +| Refund.php | WePay\Refund | 微信商户退款 | 微信支付 | \We::WePayRefund() | +| Transfers.php | WePay\Transfers | 微信商户打款到零钱 | 微信支付 | \We::WePayTransfers() | +| TransfersBank.php | WePay\TransfersBank | 微信商户打款到银行卡 | 微信支付 | \We::WePayTransfersBank() | +| Crypt.php | WeMini\Crypt | 微信小程序数据加密处理 | 微信小程序 | \We::WeMiniCrypt() | +| Plugs.php | WeMini\Plugs | 微信小程序插件管理 | 微信小程序 | \We::WeMiniPlugs() | +| Poi.php | WeMini\Poi | 微信小程序地址管理 | 微信小程序 | \We::WeMiniPoi() | +| Qrcode.php | WeMini\Qrcode | 微信小程序二维码管理 | 微信小程序 | \We::WeMiniCrypt() | +| Template.php | WeMini\Template | 微信小程序模板消息支持 | 微信小程序 | \We::WeMiniTemplate() | +| Total.php | WeMini\Total | 微信小程序数据接口 | 微信小程序 | \We::WeMiniTotal() | 安装使用 ---- 1.1 通过 Composer 来管理安装 + ```shell # 首次安装 线上版本(稳定) composer require zoujingli/wechat-developer @@ -97,12 +105,14 @@ composer update zoujingli/wechat-developer ``` 1.2 如果不使用 Composer, 可以下载 WeChatDeveloper 并解压到项目中 + ```php # 在项目中加载初始化文件 include "您的目录/WeChatDeveloper/include.php"; ``` 2.1 接口实例所需参数 + ```php $config = [ 'token' => 'test', @@ -121,6 +131,7 @@ $config = [ ``` 3.1 实例指定接口 + ```php try { @@ -144,6 +155,7 @@ try { 微信支付 --- + ```php // 创建接口实例 $wechat = new \WeChat\Pay($config); @@ -176,28 +188,41 @@ try { } ``` + * 更多功能请阅读测试代码或SDK封装源码 支付宝支付 ---- + * 支付参数配置(可用沙箱模式) + ```php $config = [ // 沙箱模式 - 'debug' => true, + 'debug' => true, + // 签名类型 ( RSA|RSA2 ) + 'sign_type' => 'RSA2', // 应用ID - 'appid' => '2016090900468879', - // 支付宝公钥(1行填写) - 'public_key' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtU71NY53UDGY7JNvLYAhsNa+taTF6KthIHJmGgdio9bkqeJGhHk6ttkTKkLqFgwIfgAkHpdKiOv1uZw6gVGZ7TCu5LfHTqKrCd6Uz+N7hxhY+4IwicLgprcV1flXQLmbkJYzFMZqkXGkSgOsR2yXh4LyQZczgk9N456uuzGtRy7MoB4zQy34PLUkkxR6W1B2ftNbLRGXv6tc7p/cmDcrY6K1bSxnGmfRxFSb8lRfhe0V0UM6pKq2SGGSeovrKHN0OLp+Nn5wcULVnFgATXGCENshRlp96piPEBFwneXs19n+sX1jx60FTR7/rME3sW3AHug0fhZ9mSqW4x401WjdnwIDAQAB', - // 支付宝私钥(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=', + 'appid' => '2021000122667306', + // 应用私钥内容 ( 需1行填写,特别注意:这里的应用私钥通常由支付宝密钥管理工具生成 ) + 'private_key' => 'MIIEowIBAAKCAQEAn...', + // 公钥模式,支付宝公钥内容 ( 需1行填写,特别注意:这里不是应用公钥而是支付宝公钥,通常是上传应用公钥换取支付宝公钥,在网页可以复制 ) + 'public_key' => '', + // 证书模式,应用公钥证书路径 ( 新版资金类接口转 app_cert_sn,如文件 appCertPublicKey.crt ) + 'app_cert_path' => __DIR__ . '/alipay/appPublicCert.crt', // 'app_cert' => '证书内容', + // 证书模式,支付宝根证书路径 ( 新版资金类接口转 alipay_root_cert_sn,如文件 alipayRootCert.crt ) + 'alipay_root_path' => __DIR__ . '/alipay/alipayRootCert.crt', // 'root_cert' => '证书内容', + // 证书模式,支付宝公钥证书路径 ( 未填写 public_key 时启用此参数,如文件 alipayPublicCert.crt ) + 'alipay_cert_path' => __DIR__ . '/alipay/alipayPublicCert.crt', // 'public_key' => '证书内容' // 支付成功通知地址 - 'notify_url' => '', // 可以应用的时候配置哦 + 'notify_url' => '', // 网页支付回跳地址 - 'return_url' => '', // 可以应用的时候配置哦 + 'return_url' => '', ]; ``` + * 支付宝发起PC网站支付 + ```php // 参考公共参数 https://docs.open.alipay.com/203/107090/ $config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php'; @@ -225,7 +250,9 @@ try { } ``` + * 支付宝发起手机网站支付 + ```php // 参考公共参数 https://docs.open.alipay.com/203/107090/ $config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php'; @@ -253,15 +280,17 @@ try { } ``` + * 更多功能请阅读测试代码或SDK封装源码 -开源协议 ----- -* WeChatDeveloper 基于`MIT`协议发布,任何人可以用在任何地方,不受约束 -* WeChatDeveloper 部分代码来自互联网,若有异议,可以联系作者进行删除 +## 版权说明 -赞助支持 ----- -![赞助](http://static.thinkadmin.top/pay.png) +**WeChatDeveloper** 遵循 **MIT** 开源协议发布,并免费提供使用。 + +本项目包含的第三方源码和二进制文件的版权信息将另行标注,请在对应文件查看。 + +版权所有 Copyright © 2014-2023 by ThinkAdmin (https://thinkadmin.top) All rights reserved。 +## 赞助打赏,请作者喝杯茶 ~ +![赞助](https://doc.thinkadmin.top/static/img/pay.png) From 6be54b1c9e3ee1ba25405b72b3e1d50a3563756f Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Mon, 4 Mar 2024 12:55:38 +0000 Subject: [PATCH 2/2] Get rid of obsolete files --- upload/admin/config.php_ | 36 ------------------------------------ upload/config.php_ | 30 ------------------------------ 2 files changed, 66 deletions(-) delete mode 100644 upload/admin/config.php_ delete mode 100644 upload/config.php_ diff --git a/upload/admin/config.php_ b/upload/admin/config.php_ deleted file mode 100644 index 0d4e6fc12e7..00000000000 --- a/upload/admin/config.php_ +++ /dev/null @@ -1,36 +0,0 @@ -