From 89db63031397bedae5df8809ff2d77959d2cec69 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 22 Jun 2024 19:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- composer.lock | 21 +-- vendor/composer/installed.json | 21 +-- vendor/composer/installed.php | 6 +- vendor/yansongda/pay/CHANGELOG.md | 27 +++ vendor/yansongda/pay/README.md | 78 ++++++++- vendor/yansongda/pay/composer.json | 3 +- .../pay/src/Event/CallbackReceived.php | 0 .../yansongda/pay/src/Event/MethodCalled.php | 0 vendor/yansongda/pay/src/Event/PayEnd.php | 0 vendor/yansongda/pay/src/Event/PayStart.php | 0 .../yansongda/pay/src/Exception/Exception.php | 4 + vendor/yansongda/pay/src/Functions.php | 66 +++++++- vendor/yansongda/pay/src/Pay.php | 4 + .../Alipay/V2/AddPayloadSignaturePlugin.php | 4 +- .../src/Plugin/Alipay/V2/AddRadarPlugin.php | 4 +- .../src/Plugin/Alipay/V2/CallbackPlugin.php | 4 +- .../src/Plugin/Alipay/V2/ResponsePlugin.php | 16 +- .../pay/src/Plugin/Alipay/V2/StartPlugin.php | 4 +- .../Alipay/V2/VerifySignaturePlugin.php | 4 +- .../src/Plugin/Jsb/AddPayloadSignPlugin.php | 65 ++++++++ .../pay/src/Plugin/Jsb/AddRadarPlugin.php | 68 ++++++++ .../pay/src/Plugin/Jsb/CallbackPlugin.php | 70 ++++++++ .../pay/src/Plugin/Jsb/Pay/Scan/PayPlugin.php | 49 ++++++ .../src/Plugin/Jsb/Pay/Scan/QueryPlugin.php | 30 ++++ .../src/Plugin/Jsb/Pay/Scan/RefundPlugin.php | 30 ++++ .../pay/src/Plugin/Jsb/ResponsePlugin.php | 52 ++++++ .../pay/src/Plugin/Jsb/StartPlugin.php | 49 ++++++ .../src/Plugin/Jsb/VerifySignaturePlugin.php | 76 +++++++++ .../pay/src/Plugin/Unipay/AddRadarPlugin.php | 4 +- .../Unipay/Open/AddPayloadSignaturePlugin.php | 4 +- .../src/Plugin/Unipay/Open/CallbackPlugin.php | 4 +- .../Plugin/Unipay/Open/Pay/H5/PayPlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/CancelPlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/PosPlugin.php | 4 +- .../Open/Pay/QrCode/PosPreAuthPlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/QueryPlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/RefundPlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/ScanFeePlugin.php | 4 +- .../Unipay/Open/Pay/QrCode/ScanPlugin.php | 4 +- .../Open/Pay/QrCode/ScanPreAuthPlugin.php | 4 +- .../Open/Pay/QrCode/ScanPreOrderPlugin.php | 4 +- .../Unipay/Open/Pay/Web/CancelPlugin.php | 4 +- .../Plugin/Unipay/Open/Pay/Web/PayPlugin.php | 4 +- .../Unipay/Open/Pay/Web/QueryPlugin.php | 4 +- .../Unipay/Open/Pay/Web/RefundPlugin.php | 4 +- .../src/Plugin/Unipay/Open/StartPlugin.php | 4 +- .../Unipay/Open/VerifySignaturePlugin.php | 4 +- .../Unipay/Qra/AddPayloadSignaturePlugin.php | 4 +- .../src/Plugin/Unipay/Qra/CallbackPlugin.php | 4 +- .../Plugin/Unipay/Qra/Pos/CancelPlugin.php | 4 +- .../src/Plugin/Unipay/Qra/Pos/PayPlugin.php | 4 +- .../Unipay/Qra/Pos/QueryOpenIdPlugin.php | 4 +- .../src/Plugin/Unipay/Qra/Pos/QueryPlugin.php | 4 +- .../Unipay/Qra/Pos/QueryRefundPlugin.php | 4 +- .../Plugin/Unipay/Qra/Pos/RefundPlugin.php | 4 +- .../Plugin/Unipay/Qra/Scan/ClosePlugin.php | 4 +- .../src/Plugin/Unipay/Qra/Scan/PayPlugin.php | 4 +- .../Plugin/Unipay/Qra/Scan/QueryPlugin.php | 4 +- .../Unipay/Qra/Scan/QueryRefundPlugin.php | 4 +- .../Plugin/Unipay/Qra/Scan/RefundPlugin.php | 4 +- .../Unipay/Qra/VerifySignaturePlugin.php | 4 +- .../pay/src/Plugin/Wechat/AddRadarPlugin.php | 4 +- .../pay/src/Plugin/Wechat/ResponsePlugin.php | 8 +- .../pay/src/Plugin/Wechat/StartPlugin.php | 2 + .../Wechat/V2/AddPayloadSignaturePlugin.php | 4 +- .../Wechat/V2/Papay/Direct/ApplyPlugin.php | 4 +- .../V2/Papay/Direct/ContractOrderPlugin.php | 4 +- .../Papay/Direct/MiniOnlyContractPlugin.php | 4 +- .../Plugin/Wechat/V2/Pay/App/InvokePlugin.php | 4 +- .../Wechat/V2/Pay/Mini/InvokePlugin.php | 4 +- .../Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php | 4 +- .../Plugin/Wechat/V2/Pay/Pos/PayPlugin.php | 4 +- .../Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php | 4 +- .../Wechat/V2/Pay/Redpack/SendPlugin.php | 4 +- .../Wechat/V2/VerifySignaturePlugin.php | 4 +- .../Wechat/V3/AddPayloadSignaturePlugin.php | 4 +- .../src/Plugin/Wechat/V3/CallbackPlugin.php | 4 +- .../V3/Extend/Complaints/CompletePlugin.php | 4 +- .../Extend/Complaints/QueryDetailPlugin.php | 4 +- .../V3/Extend/Complaints/ResponsePlugin.php | 4 +- .../ProfitSharing/AddReceiverPlugin.php | 6 +- .../V3/Extend/ProfitSharing/CreatePlugin.php | 6 +- .../ProfitSharing/DeleteReceiverPlugin.php | 4 +- .../QueryMerchantConfigsPlugin.php | 4 +- .../V3/Extend/ProfitSharing/QueryPlugin.php | 4 +- .../ProfitSharing/QueryReturnPlugin.php | 4 +- .../V3/Extend/ProfitSharing/ReturnPlugin.php | 6 +- .../Extend/ProfitSharing/UnfreezePlugin.php | 6 +- .../Marketing/Coupon/Callback/QueryPlugin.php | 4 +- .../Marketing/Coupon/Callback/SetPlugin.php | 4 +- .../Marketing/Coupon/Coupons/DetailPlugin.php | 4 +- .../Coupon/Coupons/QueryUserPlugin.php | 4 +- .../Marketing/Coupon/Coupons/SendPlugin.php | 4 +- .../Marketing/Coupon/Stock/CreatePlugin.php | 4 +- .../V3/Marketing/Coupon/Stock/PausePlugin.php | 4 +- .../Coupon/Stock/QueryDetailPlugin.php | 4 +- .../Coupon/Stock/QueryItemsPlugin.php | 4 +- .../Coupon/Stock/QueryMerchantsPlugin.php | 4 +- .../V3/Marketing/Coupon/Stock/QueryPlugin.php | 4 +- .../Marketing/Coupon/Stock/RestartPlugin.php | 4 +- .../V3/Marketing/Coupon/Stock/StartPlugin.php | 4 +- .../ECommerceBalance/QueryDayEndPlugin.php | 4 +- .../ECommerceBalance/QueryPlugin.php | 4 +- .../Marketing/ECommerceRefund/ApplyPlugin.php | 4 +- .../ECommerceRefund/QueryByWxPlugin.php | 4 +- .../Marketing/ECommerceRefund/QueryPlugin.php | 4 +- .../QueryReturnAdvancePlugin.php | 4 +- .../ECommerceRefund/ReturnAdvancePlugin.php | 4 +- .../Fapiao/Blockchain/CreatePlugin.php | 4 +- .../Fapiao/CreateCardTemplatePlugin.php | 4 +- .../V3/Marketing/Fapiao/GetTitleUrlPlugin.php | 4 +- .../Transfer/Batch/QueryByWxPlugin.php | 4 +- .../Marketing/Transfer/Batch/QueryPlugin.php | 4 +- .../V3/Marketing/Transfer/CreatePlugin.php | 4 +- .../Transfer/Detail/QueryByWxPlugin.php | 4 +- .../Marketing/Transfer/Detail/QueryPlugin.php | 4 +- .../Transfer/DownloadReceiptPlugin.php | 4 +- .../Transfer/Receipt/CreatePlugin.php | 4 +- .../Transfer/Receipt/QueryPlugin.php | 4 +- .../Transfer/ReceiptDetail/CreatePlugin.php | 4 +- .../Transfer/ReceiptDetail/QueryPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/App/ClosePlugin.php | 22 +-- .../Plugin/Wechat/V3/Pay/App/InvokePlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/App/PayPlugin.php | 4 +- .../Wechat/V3/Pay/App/QueryByWxPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/App/QueryPlugin.php | 4 +- .../Wechat/V3/Pay/App/QueryRefundPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/App/RefundPlugin.php | 4 +- .../Wechat/V3/Pay/Combine/AppInvokePlugin.php | 4 +- .../Wechat/V3/Pay/Combine/AppPayPlugin.php | 4 +- .../Wechat/V3/Pay/Combine/ClosePlugin.php | 19 ++- .../Wechat/V3/Pay/Combine/H5PayPlugin.php | 4 +- .../V3/Pay/Combine/JsapiInvokePlugin.php | 4 +- .../Wechat/V3/Pay/Combine/JsapiPayPlugin.php | 4 +- .../V3/Pay/Combine/MiniInvokePlugin.php | 4 +- .../Wechat/V3/Pay/Combine/MiniPayPlugin.php | 4 +- .../Wechat/V3/Pay/Combine/NativePayPlugin.php | 4 +- .../V3/Pay/Combine/QueryRefundPlugin.php | 4 +- .../Wechat/V3/Pay/Combine/RefundPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/H5/ClosePlugin.php | 22 +-- .../src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php | 4 +- .../Wechat/V3/Pay/H5/QueryByWxPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/H5/QueryPlugin.php | 4 +- .../Wechat/V3/Pay/H5/QueryRefundPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/H5/RefundPlugin.php | 4 +- .../Wechat/V3/Pay/Jsapi/ClosePlugin.php | 22 +-- .../Wechat/V3/Pay/Jsapi/InvokePlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php | 4 +- .../Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php | 4 +- .../Wechat/V3/Pay/Jsapi/QueryPlugin.php | 4 +- .../Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php | 4 +- .../Wechat/V3/Pay/Jsapi/RefundPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php | 22 +-- .../Wechat/V3/Pay/Mini/InvokePlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Mini/PayPlugin.php | 4 +- .../Wechat/V3/Pay/Mini/QueryByWxPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php | 4 +- .../Wechat/V3/Pay/Mini/QueryRefundPlugin.php | 4 +- .../Wechat/V3/Pay/Mini/RefundPlugin.php | 4 +- .../Wechat/V3/Pay/Native/ClosePlugin.php | 22 +-- .../Plugin/Wechat/V3/Pay/Native/PayPlugin.php | 4 +- .../Wechat/V3/Pay/Native/QueryByWxPlugin.php | 4 +- .../Wechat/V3/Pay/Native/QueryPlugin.php | 4 +- .../V3/Pay/Native/QueryRefundPlugin.php | 4 +- .../Wechat/V3/Pay/Native/RefundPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php | 4 +- .../Plugin/Wechat/V3/Pay/Pos/PayPlugin.php | 4 +- .../Wechat/V3/Pay/Refund/QueryPlugin.php | 4 +- .../V3/Pay/Refund/RefundAbnormalPlugin.php | 4 +- .../Wechat/V3/Pay/Refund/RefundPlugin.php | 4 +- vendor/yansongda/pay/src/Provider/Alipay.php | 2 +- vendor/yansongda/pay/src/Provider/Jsb.php | 155 ++++++++++++++++++ vendor/yansongda/pay/src/Provider/Unipay.php | 2 +- vendor/yansongda/pay/src/Provider/Wechat.php | 4 +- .../pay/src/Service/JsbServiceProvider.php | 24 +++ .../pay/src/Shortcut/Jsb/QueryShortcut.php | 30 ++++ .../pay/src/Shortcut/Jsb/RefundShortcut.php | 30 ++++ .../pay/src/Shortcut/Jsb/ScanShortcut.php | 30 ++++ .../pay/src/Shortcut/Wechat/AppShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/CloseShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/H5Shortcut.php | 2 +- .../pay/src/Shortcut/Wechat/MiniShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/MpShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/PapayShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/PosShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/QueryShortcut.php | 2 +- .../src/Shortcut/Wechat/RedpackShortcut.php | 2 +- .../src/Shortcut/Wechat/RefundShortcut.php | 2 +- .../pay/src/Shortcut/Wechat/ScanShortcut.php | 2 +- .../src/Shortcut/Wechat/TransferShortcut.php | 2 +- .../Traits/SupportServiceProviderTrait.php | 4 +- 192 files changed, 1341 insertions(+), 404 deletions(-) mode change 100644 => 100755 vendor/yansongda/pay/src/Event/CallbackReceived.php mode change 100644 => 100755 vendor/yansongda/pay/src/Event/MethodCalled.php mode change 100644 => 100755 vendor/yansongda/pay/src/Event/PayEnd.php mode change 100644 => 100755 vendor/yansongda/pay/src/Event/PayStart.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/AddPayloadSignPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/AddRadarPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/CallbackPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/PayPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/QueryPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/RefundPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/ResponsePlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/StartPlugin.php create mode 100644 vendor/yansongda/pay/src/Plugin/Jsb/VerifySignaturePlugin.php create mode 100644 vendor/yansongda/pay/src/Provider/Jsb.php create mode 100644 vendor/yansongda/pay/src/Service/JsbServiceProvider.php create mode 100644 vendor/yansongda/pay/src/Shortcut/Jsb/QueryShortcut.php create mode 100644 vendor/yansongda/pay/src/Shortcut/Jsb/RefundShortcut.php create mode 100644 vendor/yansongda/pay/src/Shortcut/Jsb/ScanShortcut.php diff --git a/composer.json b/composer.json index d51fe4f0..36e160e2 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "next/var-dumper": "^0.1.0", "w7corp/easywechat": "^6.8", "hyperf/pimple": "~2.2.0", - "yansongda/pay": "^3.7", + "yansongda/pay": "v3.7.7", "webman/redis-queue": "^1.3", "webman/push": "^1.0", "ext-bcmath": "*", diff --git a/composer.lock b/composer.lock index 701f13bd..f2861932 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": "86e88af6d3f2d3a637cb64522dc7ad21", + "content-hash": "24cc56580d39efa5995e2bddb25f89c5", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -7786,23 +7786,17 @@ }, { "name": "yansongda/pay", - "version": "v3.7.4", + "version": "v3.7.7", "source": { "type": "git", "url": "https://github.com/yansongda/pay.git", - "reference": "a57a52f057aa4ca49afa14bd61b888885e1eed28" + "reference": "db85283ee5c8e462dc01392d49f1f576604cad7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yansongda/pay/zipball/a57a52f057aa4ca49afa14bd61b888885e1eed28", - "reference": "a57a52f057aa4ca49afa14bd61b888885e1eed28", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/yansongda/pay/zipball/db85283ee5c8e462dc01392d49f1f576604cad7d", + "reference": "db85283ee5c8e462dc01392d49f1f576604cad7d", + "shasum": "" }, "require": { "ext-bcmath": "*", @@ -7821,6 +7815,7 @@ "friendsofphp/php-cs-fixer": "^3.44", "guzzlehttp/guzzle": "^7.0", "hyperf/pimple": "^2.2", + "jetbrains/phpstorm-attributes": "^1.1", "mockery/mockery": "^1.4", "monolog/monolog": "^2.2", "phpstan/phpstan": "^1.0.0", @@ -7860,7 +7855,7 @@ "issues": "https://github.com/yansongda/pay/issues", "source": "https://github.com/yansongda/pay" }, - "time": "2024-05-16T13:31:29+00:00" + "time": "2024-06-22T02:21:34+00:00" }, { "name": "yansongda/supports", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 35ef5f3c..fc89ba02 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -7723,24 +7723,18 @@ }, { "name": "yansongda/pay", - "version": "v3.7.4", - "version_normalized": "3.7.4.0", + "version": "v3.7.7", + "version_normalized": "3.7.7.0", "source": { "type": "git", "url": "https://github.com/yansongda/pay.git", - "reference": "a57a52f057aa4ca49afa14bd61b888885e1eed28" + "reference": "db85283ee5c8e462dc01392d49f1f576604cad7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yansongda/pay/zipball/a57a52f057aa4ca49afa14bd61b888885e1eed28", - "reference": "a57a52f057aa4ca49afa14bd61b888885e1eed28", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/yansongda/pay/zipball/db85283ee5c8e462dc01392d49f1f576604cad7d", + "reference": "db85283ee5c8e462dc01392d49f1f576604cad7d", + "shasum": "" }, "require": { "ext-bcmath": "*", @@ -7759,6 +7753,7 @@ "friendsofphp/php-cs-fixer": "^3.44", "guzzlehttp/guzzle": "^7.0", "hyperf/pimple": "^2.2", + "jetbrains/phpstorm-attributes": "^1.1", "mockery/mockery": "^1.4", "monolog/monolog": "^2.2", "phpstan/phpstan": "^1.0.0", @@ -7768,7 +7763,7 @@ "symfony/psr-http-message-bridge": "^2.1", "symfony/var-dumper": "^5.1" }, - "time": "2024-05-16T13:31:29+00:00", + "time": "2024-06-22T02:21:34+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 85a7ae43..7ceb4141 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1074,9 +1074,9 @@ 'dev_requirement' => false, ), 'yansongda/pay' => array( - 'pretty_version' => 'v3.7.4', - 'version' => '3.7.4.0', - 'reference' => 'a57a52f057aa4ca49afa14bd61b888885e1eed28', + 'pretty_version' => 'v3.7.7', + 'version' => '3.7.7.0', + 'reference' => 'db85283ee5c8e462dc01392d49f1f576604cad7d', 'type' => 'library', 'install_path' => __DIR__ . '/../yansongda/pay', 'aliases' => array(), diff --git a/vendor/yansongda/pay/CHANGELOG.md b/vendor/yansongda/pay/CHANGELOG.md index 3d3fcfcb..50d2bdfe 100644 --- a/vendor/yansongda/pay/CHANGELOG.md +++ b/vendor/yansongda/pay/CHANGELOG.md @@ -1,3 +1,30 @@ +## 3.7.7 + +### added + +- feat: 新增江苏银行e融支付(#1002) + +## v3.7.6 + +### fixed + +- fix: 微信关闭订单报解包错误的问题(#1000, #1001) + +## v3.7.5 + +### fixed + +- fix: 支付宝响应空签名时签名验证逻辑错误的问题(#998) + +### optimized + +- optimize: 优化微信 `ResponsePlugin` 插件去除不必要的返回参数(#996) + +### deprecated + +- deprecate: 微信 `StartPlugin` 改为使用 `yansongda/artful` 中的插件(#993) +- deprecate: `get_wechat_config`, `get_alipay_config`, `get_unipay_config` 方法已废弃,使用 `get_provider_config` 方法代替(#994) + ## v3.7.4 ### optimized diff --git a/vendor/yansongda/pay/README.md b/vendor/yansongda/pay/README.md index 3b6d1b5f..026c6266 100644 --- a/vendor/yansongda/pay/README.md +++ b/vendor/yansongda/pay/README.md @@ -84,6 +84,11 @@ yansongda/pay 100% 兼容 支付宝/微信/银联 所有功能(包括服务商 - 刷卡支付 - 扫码支付 - ... +- +### 江苏银行(e融支付) + +- 聚合扫码支付(微信,支付宝,银联,e融) +- ... ## 安装 ```shell @@ -279,9 +284,80 @@ class WechatController } ``` +### 江苏银行(e融支付) +```php + [ + 'default' => [ + // 服务代码 + 'svr_code' => '', + // 必填-合作商ID + 'partner_id' => '', + // 必填-公私钥对编号 + 'public_key_code' => '00', + // 必填-商户私钥(加密签名) + 'mch_secret_cert_path' => '', + // 必填-商户公钥证书路径(提供江苏银行进行验证签名用) + 'mch_public_cert_path' => '', + // 必填-江苏银行的公钥(用于解密江苏银行返回的数据) + 'jsb_public_cert_path' => '', + //支付通知地址 + 'notify_url' => '', + // 选填-默认为正常模式。可选为: MODE_NORMAL:正式环境, MODE_SANDBOX:测试环境 + 'mode' => Pay::MODE_NORMAL, + ] + ], + 'logger' => [ // optional + 'enable' => false, + 'file' => './logs/epay.log', + 'level' => 'info', // 建议生产环境等级调整为 info,开发环境为 debug + 'type' => 'single', // optional, 可选 daily. + 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 + ], + 'http' => [ // optional + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + ], + ]; + + public function index() + { + $order = [ + 'outTradeNo' => time().'', + 'proInfo' => 'subject-测试', + 'totalFee'=> 1, + ]; + + $pay = Pay::jsb($this->config)->scan($order); + } + + public function notifyCallback() + { + $pay = Pay::jsb($this->config); + + try{ + $data = $pay->callback(); // 是的,验签就这么简单! + } catch (\Exception $e) { + // $e->getMessage(); + } + + return $pay->success(); + } +} +``` + ## 代码贡献 -由于测试及使用环境的限制,本项目中只开发了「支付宝」和「微信支付」的相关支付网关。 +由于测试及使用环境的限制,本项目中只开发了「支付宝」、「微信支付」、「银联」、「江苏银行」的相关支付网关。 如果您有其它支付网关的需求,或者发现本项目中需要改进的代码,**_欢迎 Fork 并提交 PR!_** diff --git a/vendor/yansongda/pay/composer.json b/vendor/yansongda/pay/composer.json index 0f102711..50d0bae2 100644 --- a/vendor/yansongda/pay/composer.json +++ b/vendor/yansongda/pay/composer.json @@ -36,7 +36,8 @@ "symfony/event-dispatcher": "^5.2.0", "symfony/psr-http-message-bridge": "^2.1", "hyperf/pimple": "^2.2", - "guzzlehttp/guzzle": "^7.0" + "guzzlehttp/guzzle": "^7.0", + "jetbrains/phpstorm-attributes": "^1.1" }, "conflict": { "hyperf/framework": "<3.0" diff --git a/vendor/yansongda/pay/src/Event/CallbackReceived.php b/vendor/yansongda/pay/src/Event/CallbackReceived.php old mode 100644 new mode 100755 diff --git a/vendor/yansongda/pay/src/Event/MethodCalled.php b/vendor/yansongda/pay/src/Event/MethodCalled.php old mode 100644 new mode 100755 diff --git a/vendor/yansongda/pay/src/Event/PayEnd.php b/vendor/yansongda/pay/src/Event/PayEnd.php old mode 100644 new mode 100755 diff --git a/vendor/yansongda/pay/src/Event/PayStart.php b/vendor/yansongda/pay/src/Event/PayStart.php old mode 100644 new mode 100755 diff --git a/vendor/yansongda/pay/src/Exception/Exception.php b/vendor/yansongda/pay/src/Exception/Exception.php index 1085168f..e1808903 100644 --- a/vendor/yansongda/pay/src/Exception/Exception.php +++ b/vendor/yansongda/pay/src/Exception/Exception.php @@ -44,6 +44,8 @@ class Exception extends \Exception public const RESPONSE_MISSING_NECESSARY_PARAMS = 9305; + public const RESPONSE_BUSINESS_CODE_WRONG = 9306; + /* * 关于配置. */ @@ -53,6 +55,8 @@ class Exception extends \Exception public const CONFIG_UNIPAY_INVALID = 9403; + public const CONFIG_JSB_INVALID = 9404; + /** * 关于签名. */ diff --git a/vendor/yansongda/pay/src/Functions.php b/vendor/yansongda/pay/src/Functions.php index 0a301841..51801a88 100644 --- a/vendor/yansongda/pay/src/Functions.php +++ b/vendor/yansongda/pay/src/Functions.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Yansongda\Pay; +use JetBrains\PhpStorm\Deprecated; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Yansongda\Artful\Contract\ConfigInterface; @@ -13,15 +14,16 @@ use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Plugin\AddPayloadBodyPlugin; use Yansongda\Artful\Plugin\ParserPlugin; +use Yansongda\Artful\Plugin\StartPlugin; use Yansongda\Pay\Exception\DecryptException; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidSignException; use Yansongda\Pay\Plugin\Wechat\AddRadarPlugin; use Yansongda\Pay\Plugin\Wechat\ResponsePlugin; -use Yansongda\Pay\Plugin\Wechat\StartPlugin; use Yansongda\Pay\Plugin\Wechat\V3\AddPayloadSignaturePlugin; use Yansongda\Pay\Plugin\Wechat\V3\WechatPublicCertsPlugin; use Yansongda\Pay\Provider\Alipay; +use Yansongda\Pay\Provider\Jsb; use Yansongda\Pay\Provider\Unipay; use Yansongda\Pay\Provider\Wechat; use Yansongda\Supports\Collection; @@ -63,6 +65,19 @@ function get_radar_url(array $config, ?Collection $payload): ?string * @throws ContainerException * @throws ServiceNotFoundException */ +function get_provider_config(string $provider, array $params = []): array +{ + /** @var ConfigInterface $config */ + $config = Pay::get(ConfigInterface::class); + + return $config->get($provider, [])[get_tenant($params)] ?? []; +} + +/** + * @throws ContainerException + * @throws ServiceNotFoundException + */ +#[Deprecated(reason: '自 v3.7.5 开始废弃', replacement: 'get_provider_config')] function get_alipay_config(array $params = []): array { $alipay = Pay::get(ConfigInterface::class)->get('alipay'); @@ -113,6 +128,7 @@ function verify_alipay_sign(array $config, string $contents, string $sign): void * @throws ContainerException * @throws ServiceNotFoundException */ +#[Deprecated(reason: '自 v3.7.5 开始废弃', replacement: 'get_provider_config')] function get_wechat_config(array $params = []): array { $wechat = Pay::get(ConfigInterface::class)->get('wechat'); @@ -231,7 +247,7 @@ function verify_wechat_sign(ResponseInterface|ServerRequestInterface $message, a $body = (string) $message->getBody(); $content = $timestamp."\n".$random."\n".$body."\n"; - $public = get_wechat_config($params)['wechat_public_cert_path'][$wechatSerial] ?? null; + $public = get_provider_config('wechat', $params)['wechat_public_cert_path'][$wechatSerial] ?? null; if (empty($sign)) { throw new InvalidSignException(Exception::SIGN_EMPTY, '签名异常: 微信签名为空', ['headers' => $message->getHeaders(), 'body' => $body]); @@ -308,7 +324,7 @@ function reload_wechat_public_certs(array $params, ?string $serialNo = null): st $params )->get('data', []); - $wechatConfig = get_wechat_config($params); + $wechatConfig = get_provider_config('wechat', $params); foreach ($data as $item) { $certs[$item['serial_no']] = decrypt_wechat_resource($item['encrypt_certificate'], $wechatConfig)['ciphertext'] ?? ''; @@ -337,7 +353,7 @@ function get_wechat_public_certs(array $params = [], ?string $path = null): void { reload_wechat_public_certs($params); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (empty($path)) { var_dump($config['wechat_public_cert_path']); @@ -418,12 +434,12 @@ function get_wechat_serial_no(array $params): string return $params['_serial_no']; } - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (empty($config['wechat_public_cert_path'])) { reload_wechat_public_certs($params); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); } mt_srand(); @@ -466,6 +482,7 @@ function get_wechat_miniprogram_user_sign(string $sessionKey, string $payload): * @throws ContainerException * @throws ServiceNotFoundException */ +#[Deprecated(reason: '自 v3.7.5 开始废弃', replacement: 'get_provider_config')] function get_unipay_config(array $params = []): array { $unipay = Pay::get(ConfigInterface::class)->get('unipay'); @@ -575,3 +592,40 @@ function verify_unipay_sign_qra(array $config, array $destination): void throw new InvalidSignException(Exception::SIGN_ERROR, '签名异常: 验证银联签名失败', $destination); } } + +function get_jsb_url(array $config, ?Collection $payload): string +{ + $url = get_radar_url($config, $payload) ?? ''; + if (str_starts_with($url, 'http')) { + return $url; + } + + return Jsb::URL[$config['mode'] ?? Pay::MODE_NORMAL]; +} + +/** + * @throws InvalidConfigException + * @throws InvalidSignException + */ +function verify_jsb_sign(array $config, string $content, string $sign): void +{ + if (empty($sign)) { + throw new InvalidSignException(Exception::SIGN_EMPTY, '签名异常: 江苏银行签名为空', func_get_args()); + } + + $publicCert = $config['jsb_public_cert_path'] ?? null; + + if (empty($publicCert)) { + throw new InvalidConfigException(Exception::CONFIG_JSB_INVALID, '配置异常: 缺少配置参数 -- [jsb_public_cert_path]'); + } + + $result = 1 === openssl_verify( + $content, + base64_decode($sign), + get_public_cert($publicCert) + ); + + if (!$result) { + throw new InvalidSignException(Exception::SIGN_ERROR, '签名异常: 验证江苏银行签名失败', func_get_args()); + } +} diff --git a/vendor/yansongda/pay/src/Pay.php b/vendor/yansongda/pay/src/Pay.php index a6d1dd8e..b0d40b13 100644 --- a/vendor/yansongda/pay/src/Pay.php +++ b/vendor/yansongda/pay/src/Pay.php @@ -10,9 +10,11 @@ use Yansongda\Artful\Artful; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Pay\Provider\Alipay; +use Yansongda\Pay\Provider\Jsb; use Yansongda\Pay\Provider\Unipay; use Yansongda\Pay\Provider\Wechat; use Yansongda\Pay\Service\AlipayServiceProvider; +use Yansongda\Pay\Service\JsbServiceProvider; use Yansongda\Pay\Service\UnipayServiceProvider; use Yansongda\Pay\Service\WechatServiceProvider; @@ -20,6 +22,7 @@ use Yansongda\Pay\Service\WechatServiceProvider; * @method static Alipay alipay(array $config = [], $container = null) * @method static Wechat wechat(array $config = [], $container = null) * @method static Unipay unipay(array $config = [], $container = null) + * @method static Jsb jsb(array $config = [], $container = null) */ class Pay { @@ -42,6 +45,7 @@ class Pay AlipayServiceProvider::class, WechatServiceProvider::class, UnipayServiceProvider::class, + JsbServiceProvider::class, ]; /** diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php index a89a2a94..dd3614f0 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php @@ -13,8 +13,8 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_alipay_config; use function Yansongda\Pay\get_private_cert; +use function Yansongda\Pay\get_provider_config; class AddPayloadSignaturePlugin implements PluginInterface { @@ -57,7 +57,7 @@ class AddPayloadSignaturePlugin implements PluginInterface */ protected function getPrivateKey(array $params): string { - $privateKey = get_alipay_config($params)['app_secret_cert'] ?? null; + $privateKey = get_provider_config('alipay', $params)['app_secret_cert'] ?? null; if (is_null($privateKey)) { throw new InvalidConfigException(Exception::CONFIG_ALIPAY_INVALID, '配置异常: 缺少支付宝配置 -- [app_secret_cert]'); diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddRadarPlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddRadarPlugin.php index 09d08ca9..732dd495 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddRadarPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/AddRadarPlugin.php @@ -12,8 +12,8 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_alipay_config; use function Yansongda\Pay\get_alipay_url; +use function Yansongda\Pay\get_provider_config; class AddRadarPlugin implements PluginInterface { @@ -26,7 +26,7 @@ class AddRadarPlugin implements PluginInterface Logger::debug('[Alipay][AddRadarPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_alipay_config($params); + $config = get_provider_config('alipay', $params); $payload = $rocket->getPayload(); $rocket->setRadar(new Request( diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/CallbackPlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/CallbackPlugin.php index 13ca8359..d0bbc7c4 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/CallbackPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/CallbackPlugin.php @@ -16,7 +16,7 @@ use Yansongda\Pay\Exception\InvalidSignException; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_alipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_alipay_sign; class CallbackPlugin implements PluginInterface @@ -32,7 +32,7 @@ class CallbackPlugin implements PluginInterface Logger::debug('[Alipay][CallbackPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_alipay_config($params); + $config = get_provider_config('alipay', $params); $value = filter_params($params, fn ($k, $v) => '' !== $v && 'sign' != $k && 'sign_type' != $k); diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/ResponsePlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/ResponsePlugin.php index 5ceafa7e..36f2870e 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/ResponsePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/ResponsePlugin.php @@ -6,14 +6,19 @@ namespace Yansongda\Pay\Plugin\Alipay\V2; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Exception\InvalidResponseException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; +use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\should_do_http_request; class ResponsePlugin implements PluginInterface { + /** + * @throws InvalidResponseException + */ public function assembly(Rocket $rocket, Closure $next): Rocket { /* @var Rocket $rocket */ @@ -26,9 +31,16 @@ class ResponsePlugin implements PluginInterface $resultKey = str_replace('.', '_', $payload->get('method')).'_response'; if (should_do_http_request($rocket->getDirection()) && $destination instanceof Collection) { + $sign = $destination->get('sign', ''); + $response = $destination->get($resultKey, $destination->all()); + + if (empty($sign) && '10000' !== ($response['code'] ?? 'null')) { + throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, '支付宝网关响应异常: '.($response['sub_msg'] ?? $response['msg'] ?? '未知错误,请查看支付宝原始响应'), $rocket->getDestination()); + } + $rocket->setDestination(new Collection(array_merge( - ['_sign' => $destination->get('sign', '')], - $destination->get($resultKey, $destination->all()) + ['_sign' => $sign], + $response ))); } diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php index f74b37d7..187a762b 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_alipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_public_cert; use function Yansongda\Pay\get_tenant; @@ -45,7 +45,7 @@ class StartPlugin implements PluginInterface protected function getPayload(array $params): array { $tenant = get_tenant($params); - $config = get_alipay_config($params); + $config = get_provider_config('alipay', $params); return [ 'app_id' => $config['app_id'] ?? '', diff --git a/vendor/yansongda/pay/src/Plugin/Alipay/V2/VerifySignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Alipay/V2/VerifySignaturePlugin.php index 738b8e6d..5e667e50 100644 --- a/vendor/yansongda/pay/src/Plugin/Alipay/V2/VerifySignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Alipay/V2/VerifySignaturePlugin.php @@ -17,7 +17,7 @@ use Yansongda\Pay\Exception\InvalidSignException; use Yansongda\Supports\Collection; use function Yansongda\Artful\should_do_http_request; -use function Yansongda\Pay\get_alipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_alipay_sign; class VerifySignaturePlugin implements PluginInterface @@ -46,7 +46,7 @@ class VerifySignaturePlugin implements PluginInterface throw new InvalidParamsException(Exception::RESPONSE_EMPTY, '参数异常: 支付宝验证签名时待验签参数不正确', $destination); } - $config = get_alipay_config($rocket->getParams()); + $config = get_provider_config('alipay', $rocket->getParams()); verify_alipay_sign($config, json_encode($result, JSON_UNESCAPED_UNICODE), $destination->get('_sign', '')); diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/AddPayloadSignPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/AddPayloadSignPlugin.php new file mode 100644 index 00000000..a3c02955 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/AddPayloadSignPlugin.php @@ -0,0 +1,65 @@ + $rocket]); + + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + $payload = $rocket->getPayload(); + + if (empty($payload) || $payload->isEmpty()) { + throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少支付必要参数。可能插件用错顺序,应该先使用 `业务插件`'); + } + + $privateCertPath = $config['mch_secret_cert_path'] ?? ''; + + if (empty($privateCertPath)) { + throw new InvalidConfigException(Exception::CONFIG_JSB_INVALID, '配置异常: 缺少配置参数 -- [mch_secret_cert_path]'); + } + + $rocket->mergePayload([ + 'signType' => 'RSA', + 'sign' => $this->getSignature(get_private_cert($privateCertPath), $payload), + ]); + + Logger::info('[Jsb][AddPayloadSignPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } + + protected function getSignature(string $pkey, Collection $payload): string + { + $content = $payload->sortKeys()->toString(); + + openssl_sign($content, $signature, $pkey); + + return base64_encode($signature); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/AddRadarPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/AddRadarPlugin.php new file mode 100644 index 00000000..870382a1 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/AddRadarPlugin.php @@ -0,0 +1,68 @@ + $rocket]); + + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + $payload = $rocket->getPayload(); + + $rocket->setRadar(new Request( + strtoupper($params['_method'] ?? 'POST'), + get_jsb_url($config, $payload), + $this->getHeaders(), + $this->getBody($payload), + )); + + Logger::info('[Jsb][AddRadarPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } + + protected function getHeaders(): array + { + return [ + 'Content-Type' => 'text/html', + 'User-Agent' => 'yansongda/pay-v3', + ]; + } + + protected function getBody(Collection $payload): string + { + $sign = $payload->get('sign'); + $signType = $payload->get('signType'); + + $payload->forget('sign'); + $payload->forget('signType'); + + $payload = $payload->sortKeys(); + + $payload->set('sign', $sign); + $payload->set('signType', $signType); + + return $payload->toString(); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/CallbackPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/CallbackPlugin.php new file mode 100644 index 00000000..bb9940dd --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/CallbackPlugin.php @@ -0,0 +1,70 @@ + $rocket]); + + $this->formatRequestAndParams($rocket); + + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + + $payload = $rocket->getPayload(); + $signature = $payload->get('sign'); + + $payload->forget('sign'); + $payload->forget('signType'); + + verify_jsb_sign($config, $payload->sortKeys()->toString(), $signature); + + $rocket->setDirection(NoHttpRequestDirection::class) + ->setDestination($rocket->getPayload()); + + Logger::info('[Jsb][CallbackPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } + + /** + * @throws InvalidParamsException + */ + protected function formatRequestAndParams(Rocket $rocket): void + { + $request = $rocket->getParams()['request'] ?? null; + + if (!$request instanceof Collection) { + throw new InvalidParamsException(Exception::PARAMS_CALLBACK_REQUEST_INVALID); + } + + $rocket->setPayload($request)->setParams($rocket->getParams()['params'] ?? []); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/PayPlugin.php new file mode 100644 index 00000000..dc9392d1 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/PayPlugin.php @@ -0,0 +1,49 @@ + $rocket]); + + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + $backUrl = $rocket->getPayload()['notify_url'] ?? $config['notify_url'] ?? null; + + if (!$backUrl) { + throw new InvalidConfigException(Exception::CONFIG_JSB_INVALID, '配置异常: 缺少配置参数 -- [notify_url]'); + } + + $rocket->mergePayload([ + 'service' => 'atPay', + 'backUrl' => $backUrl, + ]); + + Logger::info('[Jsb][Pay][Scan][PayPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/QueryPlugin.php new file mode 100644 index 00000000..47b4e896 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/QueryPlugin.php @@ -0,0 +1,30 @@ + $rocket]); + + $rocket->mergePayload([ + 'deviceNo' => '1234567890', + 'service' => 'payCheck', + ]); + + Logger::info('[Jsb][Pay][Scan][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/RefundPlugin.php new file mode 100644 index 00000000..e7708103 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/Pay/Scan/RefundPlugin.php @@ -0,0 +1,30 @@ + $rocket]); + + $rocket->mergePayload([ + 'deviceNo' => '1234567890', + 'service' => 'payRefund', + ]); + + Logger::info('[Jsb][Pay][Scan][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/ResponsePlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/ResponsePlugin.php new file mode 100644 index 00000000..023ba953 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/ResponsePlugin.php @@ -0,0 +1,52 @@ + $rocket]); + + $this->validateResponse($rocket); + + Logger::info('[Jsb][ResponsePlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $rocket; + } + + /** + * @throws InvalidResponseException + */ + protected function validateResponse(Rocket $rocket): void + { + $destination = $rocket->getDestination(); + $destinationOrigin = $rocket->getDestinationOrigin(); + + if ($destinationOrigin instanceof ResponseInterface + && ($destinationOrigin->getStatusCode() < 200 || $destinationOrigin->getStatusCode() >= 300)) { + throw new InvalidResponseException(Exception::RESPONSE_CODE_WRONG, '江苏银行返回状态码异常,请检查参数是否错误', $rocket->getDestination()); + } + + if ($destination instanceof Collection && '000000' !== $destination->get('respCode')) { + throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, sprintf('江苏银行返回错误: respCode:%s respMsg:%s', $destination->get('respCode'), $destination->get('respMsg')), $rocket->getDestination()); + } + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/StartPlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/StartPlugin.php new file mode 100644 index 00000000..22a1b124 --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/StartPlugin.php @@ -0,0 +1,49 @@ + $rocket]); + + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + + $rocket->setPacker(QueryPacker::class) + ->mergePayload(array_merge($params, [ + 'createData' => date('Ymd'), + 'createTime' => date('His'), + 'bizDate' => date('Ymd'), + 'msgId' => Str::uuidV4(), + 'svrCode' => $config['svr_code'] ?? '', + 'partnerId' => $config['partner_id'] ?? '', + 'channelNo' => 'm', + 'publicKeyCode' => $config['public_key_code'] ?? '', + 'version' => 'v1.0.0', + 'charset' => 'utf-8', + ])); + + Logger::info('[Jsb][StartPlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $next($rocket); + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Jsb/VerifySignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Jsb/VerifySignaturePlugin.php new file mode 100644 index 00000000..635cbf1d --- /dev/null +++ b/vendor/yansongda/pay/src/Plugin/Jsb/VerifySignaturePlugin.php @@ -0,0 +1,76 @@ + $rocket]); + + if (should_do_http_request($rocket->getDirection())) { + $params = $rocket->getParams(); + $config = get_provider_config('jsb', $params); + + $body = (string) $rocket->getDestinationOrigin()->getBody(); + $signatureData = $this->getSignatureData($body); + + verify_jsb_sign($config, $signatureData['data'] ?? '', $signatureData['sign'] ?? ''); + } + + Logger::info('[Jsb][VerifySignaturePlugin] 插件装载完毕', ['rocket' => $rocket]); + + return $rocket; + } + + private function getSignatureData(string $body): array + { + if (Str::contains($body, '&-&')) { + $beginIndex = strpos($body, '&signType='); + $endIndex = strpos($body, '&-&'); + $data = substr($body, 0, $beginIndex).substr($body, $endIndex); + + $signIndex = strpos($body, '&sign='); + $signature = substr($body, $signIndex + strlen('&sign='), $endIndex - ($signIndex + strlen('&sign='))); + } else { + $result = Arr::wrapQuery($body, true); + $result = Collection::wrap($result); + $signature = $result->get('sign'); + $result->forget('sign'); + $result->forget('signType'); + $data = $result->sortKeys()->toString(); + } + + return [ + 'sign' => $signature, + 'data' => $data, + ]; + } +} diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/AddRadarPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/AddRadarPlugin.php index 01a590b9..4b5b5693 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/AddRadarPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/AddRadarPlugin.php @@ -14,8 +14,8 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use function Yansongda\Artful\get_radar_method; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_unipay_body; -use function Yansongda\Pay\get_unipay_config; use function Yansongda\Pay\get_unipay_url; class AddRadarPlugin implements PluginInterface @@ -30,7 +30,7 @@ class AddRadarPlugin implements PluginInterface Logger::debug('[Unipay][AddRadarPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setRadar(new Request( diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php index a0b0b6bb..62a95854 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; class AddPayloadSignaturePlugin implements PluginInterface { @@ -29,7 +29,7 @@ class AddPayloadSignaturePlugin implements PluginInterface Logger::debug('[Unipay][AddPayloadSignaturePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); if (empty($payload) || $payload->isEmpty()) { diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/CallbackPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/CallbackPlugin.php index 740cb89d..2fc127b6 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/CallbackPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/CallbackPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\InvalidSignException; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_unipay_sign; class CallbackPlugin implements PluginInterface @@ -31,7 +31,7 @@ class CallbackPlugin implements PluginInterface Logger::debug('[Unipay][CallbackPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPayload($params); diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php index d4c8c5e4..991670b3 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?apiservId=453&acpAPIId=334&bussType=0 @@ -28,7 +28,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Unipay][Pay][H5][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setDirection(ResponseDirection::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php index eab69d1d..6c828298 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?apiservId=468&acpAPIId=800&bussType=0 @@ -28,7 +28,7 @@ class CancelPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][CancelPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php index ef9dc7c3..7d361bfe 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=798&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class PosPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][PosPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php index 71856ade..b3f3f0fb 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=797&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class PosPreAuthPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][PosPreAuthPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php index 089dba97..2594d39d 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=792&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php index 0d1491e2..ff445db2 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=799&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Unipay][QrCode][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php index 7381d93b..a7de9cc7 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=796&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class ScanFeePlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][ScanFeePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php index 18a00f9a..5a0e241b 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=793&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class ScanPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][ScanPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php index 92ca3d13..ee494365 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=794&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class ScanPreAuthPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][ScanPreAuthPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php index acb18ac5..0c44b8b1 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=795&apiservId=468&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class ScanPreOrderPlugin implements PluginInterface Logger::debug('[Unipay][Pay][QrCode][ScanPreOrderPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php index 9d811d1d..4379948a 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=755&apiservId=448&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class CancelPlugin implements PluginInterface Logger::debug('[Unipay][Pay][Web][CancelPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php index 632586f6..df20095c 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=754&apiservId=448&version=V2.2&bussType=0 @@ -29,7 +29,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Unipay][Pay][Web][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php index a78fb4b6..e57e3727 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=757&apiservId=448&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Unipay][Pay][Web][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php index 11a89b08..ab7b0b5f 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Packer\QueryPacker; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=756&apiservId=448&version=V2.2&bussType=0 @@ -28,7 +28,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Unipay][Pay][Web][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(QueryPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/StartPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/StartPlugin.php index c92ff681..ed3252ce 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/StartPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/StartPlugin.php @@ -15,8 +15,8 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_tenant; -use function Yansongda\Pay\get_unipay_config; class StartPlugin implements PluginInterface { @@ -30,7 +30,7 @@ class StartPlugin implements PluginInterface Logger::debug('[Unipay][StartPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $tenant = get_tenant($params); $rocket->mergePayload(array_merge($params, [ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Open/VerifySignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Open/VerifySignaturePlugin.php index c20c1f0e..aca6db47 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Open/VerifySignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Open/VerifySignaturePlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\InvalidSignException; use Yansongda\Supports\Collection; use function Yansongda\Artful\should_do_http_request; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_unipay_sign; class VerifySignaturePlugin implements PluginInterface @@ -44,7 +44,7 @@ class VerifySignaturePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); verify_unipay_sign( $config, diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php index 56afd94b..7c205e7e 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php @@ -15,7 +15,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_unipay_sign_qra; class AddPayloadSignaturePlugin implements PluginInterface @@ -31,7 +31,7 @@ class AddPayloadSignaturePlugin implements PluginInterface Logger::debug('[Unipay][Qra][AddPayloadSignaturePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); if (empty($payload) || $payload->isEmpty()) { diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/CallbackPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/CallbackPlugin.php index eb61bf06..3cc00ff6 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/CallbackPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/CallbackPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\InvalidSignException; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_unipay_sign_qra; class CallbackPlugin implements PluginInterface @@ -31,7 +31,7 @@ class CallbackPlugin implements PluginInterface Logger::debug('[Unipay][Qra][CallbackPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $destination = filter_params($params); if (isset($params['status']) && 0 == $params['status']) { diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php index e354c05d..ecfe1b96 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=294 @@ -31,7 +31,7 @@ class CancelPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][CancelPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/PayPlugin.php index c88752d8..5ae7815f 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/PayPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=292 @@ -31,7 +31,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php index 4405143b..d6dffd29 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=300 @@ -31,7 +31,7 @@ class QueryOpenIdPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][QueryOpenIdPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php index 76f79eff..c8aebabf 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=293 @@ -31,7 +31,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php index ce25dc22..7d9280a1 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=296 @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php index cfbb08ab..58096b9c 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=2&index_2=1&chapter_1=274&chapter_2=295 @@ -31,7 +31,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Pos][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php index 6e6277cf..c6e486ff 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=1&index_2=1&chapter_1=235&chapter_2=255 @@ -31,7 +31,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Unipay][Qra][Scan][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/PayPlugin.php index 8e22f92e..ea253de5 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/PayPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=1&index_2=1&chapter_1=235&chapter_2=253 @@ -31,7 +31,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Scan][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $payload = $rocket->getPayload(); $rocket->setPacker(XmlPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php index 9a1515a9..bff614dc 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=1&index_2=1&chapter_1=235&chapter_2=254 @@ -31,7 +31,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Scan][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php index 4981b489..9458bbe5 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=1&index_2=1&chapter_1=235&chapter_2=257 @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Scan][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php index 242c61c3..d0c57b87 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://up.95516.com/open/openapi/doc?index_1=1&index_2=1&chapter_1=235&chapter_2=256 @@ -31,7 +31,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Unipay][Qra][Scan][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_unipay_config($params); + $config = get_provider_config('unipay', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php index 135cb80a..5f866227 100644 --- a/vendor/yansongda/pay/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\InvalidSignException; use function Yansongda\Artful\should_do_http_request; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_unipay_sign_qra; class VerifySignaturePlugin implements PluginInterface @@ -32,7 +32,7 @@ class VerifySignaturePlugin implements PluginInterface Logger::debug('[Unipay][Qra][VerifySignaturePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_unipay_config($rocket->getParams()); + $config = get_provider_config('unipay', $rocket->getParams()); if (!should_do_http_request($rocket->getDirection())) { return $rocket; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/AddRadarPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/AddRadarPlugin.php index 3df82b63..9b085ef4 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/AddRadarPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/AddRadarPlugin.php @@ -14,8 +14,8 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Supports\Collection; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_body; -use function Yansongda\Pay\get_wechat_config; use function Yansongda\Pay\get_wechat_method; use function Yansongda\Pay\get_wechat_url; @@ -32,7 +32,7 @@ class AddRadarPlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->setRadar(new Request( get_wechat_method($payload), diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/ResponsePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/ResponsePlugin.php index 90ac4dea..f284dc1b 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/ResponsePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/ResponsePlugin.php @@ -5,14 +5,12 @@ declare(strict_types=1); namespace Yansongda\Pay\Plugin\Wechat; use Closure; -use Psr\Http\Message\MessageInterface; use Psr\Http\Message\ResponseInterface; use Yansongda\Artful\Contract\PluginInterface; use Yansongda\Artful\Exception\InvalidResponseException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use Yansongda\Supports\Collection; class ResponsePlugin implements PluginInterface { @@ -26,7 +24,7 @@ class ResponsePlugin implements PluginInterface Logger::debug('[Wechat][ResponsePlugin] 插件开始装载', ['rocket' => $rocket]); - $rocket->setDestination($this->validateResponse($rocket)); + $this->validateResponse($rocket); Logger::info('[Wechat][ResponsePlugin] 插件装载完毕', ['rocket' => $rocket]); @@ -36,7 +34,7 @@ class ResponsePlugin implements PluginInterface /** * @throws InvalidResponseException */ - protected function validateResponse(Rocket $rocket): null|Collection|MessageInterface + protected function validateResponse(Rocket $rocket): void { $response = $rocket->getDestinationOrigin(); @@ -44,7 +42,5 @@ class ResponsePlugin implements PluginInterface && ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300)) { throw new InvalidResponseException(Exception::RESPONSE_CODE_WRONG, '微信返回状态码异常,请检查参数是否错误', $rocket->getDestination()); } - - return $rocket->getDestination(); } } diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/StartPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/StartPlugin.php index 98dc068f..101deee5 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/StartPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/StartPlugin.php @@ -5,10 +5,12 @@ declare(strict_types=1); namespace Yansongda\Pay\Plugin\Wechat; use Closure; +use JetBrains\PhpStorm\Deprecated; use Yansongda\Artful\Contract\PluginInterface; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; +#[Deprecated(reason: '自 v3.7.5 版本已废弃', replacement: '`yansongda/artful` 包中的 `Yansongda\Artful\Plugin\StartPlugin`')] class StartPlugin implements PluginInterface { public function assembly(Rocket $rocket, Closure $next): Rocket diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php index c8521c3d..9bc0d315 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign_v2; class AddPayloadSignaturePlugin implements PluginInterface @@ -27,7 +27,7 @@ class AddPayloadSignaturePlugin implements PluginInterface { Logger::debug('[Wechat][V2][AddPayloadSignaturePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $rocket->mergePayload([ 'sign' => get_wechat_sign_v2($config, filter_params($rocket->getPayload())->all()), diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php index 9fd1ec2e..36bc9891 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class ApplyPlugin implements PluginInterface Logger::debug('[Wechat][V2][Papay][Direct][ApplyPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setPacker(XmlPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php index adffba5c..fb7c1d50 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class ContractOrderPlugin implements PluginInterface Logger::debug('[Wechat][V2][Papay][Direct][ContractOrderPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setPacker(XmlPacker::class) diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php index acdf7cf0..7f30d7ad 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -29,7 +29,7 @@ class MiniOnlyContractPlugin implements PluginInterface Logger::debug('[Wechat][V2][Papay][Direct][OnlyContractPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDirection(NoHttpRequestDirection::class) diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php index 72cb573b..b30e2cf1 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign_v2; /** @@ -51,7 +51,7 @@ class InvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php index e144dc6a..992fc72e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign_v2; /** @@ -51,7 +51,7 @@ class InvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php index 00b957bf..831cf4b3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class CancelPlugin implements PluginInterface Logger::debug('[Wechat][V2][Pay][Pos][CancelPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php index f3bbd7e7..e3961f04 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Wechat][V2][Pay][Pos][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php index 49b1c841..02625780 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Packer\XmlPacker; use Yansongda\Artful\Rocket; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V2][Pay][Pos][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->setPacker(XmlPacker::class) ->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php index 6d2cf334..453c6c24 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php @@ -16,7 +16,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -34,7 +34,7 @@ class SendPlugin implements PluginInterface Logger::debug('[Wechat][V2][Pay][Redpack][SendPlugin] 插件开始装载', ['rocket' => $rocket]); $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { $data = $this->service($payload, $config, $params); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V2/VerifySignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V2/VerifySignaturePlugin.php index 7875e8c0..9c7031ef 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V2/VerifySignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V2/VerifySignaturePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\InvalidSignException; use function Yansongda\Artful\should_do_http_request; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_wechat_sign_v2; class VerifySignaturePlugin implements PluginInterface @@ -32,7 +32,7 @@ class VerifySignaturePlugin implements PluginInterface Logger::debug('[Wechat][V2][VerifySignaturePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (!should_do_http_request($rocket->getDirection())) { return $rocket; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php index 1b426af3..fa84bfb1 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php @@ -17,9 +17,9 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use Yansongda\Supports\Str; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_public_cert; use function Yansongda\Pay\get_wechat_body; -use function Yansongda\Pay\get_wechat_config; use function Yansongda\Pay\get_wechat_method; use function Yansongda\Pay\get_wechat_sign; use function Yansongda\Pay\get_wechat_url; @@ -37,7 +37,7 @@ class AddPayloadSignaturePlugin implements PluginInterface { Logger::debug('[Wechat][V3][AddPayloadSignaturePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $timestamp = time(); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/CallbackPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/CallbackPlugin.php index 79e4eb7d..107924c7 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/CallbackPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/CallbackPlugin.php @@ -20,7 +20,7 @@ use Yansongda\Pay\Exception\InvalidSignException; use Yansongda\Supports\Collection; use function Yansongda\Pay\decrypt_wechat_resource; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\verify_wechat_sign; class CallbackPlugin implements PluginInterface @@ -48,7 +48,7 @@ class CallbackPlugin implements PluginInterface $rocket->setDirection(NoHttpRequestDirection::class)->setPayload(new Collection($body)); - $body['resource'] = decrypt_wechat_resource($body['resource'] ?? [], get_wechat_config($params)); + $body['resource'] = decrypt_wechat_resource($body['resource'] ?? [], get_provider_config('wechat', $params)); $rocket->setDestination(new Collection($body)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php index 53b4e1b3..9e6aeb62 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/consumer-complaint/complaints/complete-complaint-v2.html @@ -30,7 +30,7 @@ class CompletePlugin implements PluginInterface { Logger::debug('[Wechat][Extend][Complaints][CompletePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $complaintId = $payload?->get('complaint_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php index 955a3e78..57647162 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php @@ -16,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Pay\decrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/consumer-complaint/complaints/query-complaint-v2.html @@ -56,7 +56,7 @@ class QueryDetailPlugin implements PluginInterface $destination = $rocket->getDestination(); if ($destination instanceof Collection && !empty($payerPhone = $destination->get('payer_phone'))) { - $decryptPayerPhone = decrypt_wechat_contents($payerPhone, get_wechat_config($rocket->getParams())); + $decryptPayerPhone = decrypt_wechat_contents($payerPhone, get_provider_config('wechat', $rocket->getParams())); if (empty($decryptPayerPhone)) { throw new InvalidConfigException(Exception::DECRYPT_WECHAT_ENCRYPTED_CONTENTS_INVALID, '参数异常: 查询投诉单详情,参数 `payer_phone` 解密失败'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php index 854f0ef3..6ed6050e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/consumer-complaint/complaints/response-complaint-v2.html @@ -30,7 +30,7 @@ class ResponsePlugin implements PluginInterface { Logger::debug('[Wechat][Extend][Complaints][ResponsePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $complaintId = $payload?->get('complaint_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php index 6627888b..26c909e4 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php @@ -18,7 +18,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_public_key; use function Yansongda\Pay\get_wechat_serial_no; use function Yansongda\Pay\get_wechat_type_key; @@ -41,11 +41,11 @@ class AddReceiverPlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][AddReceiverPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { - throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账参数'); + throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少添加分账接收方参数'); } if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php index 8e33e031..b1f45ddd 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php @@ -18,7 +18,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_public_key; use function Yansongda\Pay\get_wechat_serial_no; use function Yansongda\Pay\get_wechat_type_key; @@ -41,11 +41,11 @@ class CreatePlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][CreatePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { - throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账参数'); + throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少请求分账参数'); } if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php index c4f65fc8..07dac6ed 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -34,7 +34,7 @@ class DeleteReceiverPlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][DeleteReceiverPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php index 96deebc1..3620fa50 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/profit-sharing/merchants/query-merchant-ratio.html @@ -31,7 +31,7 @@ class QueryMerchantConfigsPlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][QueryMerchantConfigsPlugin] 插件开始装载', ['rocket' => $rocket]); $payload = $rocket->getPayload(); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $subMchId = $payload?->get('sub_mch_id') ?? $config['sub_mch_id'] ?? 'null'; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php index 03268780..02ba6e06 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/profit-sharing/orders/query-order.html @@ -30,7 +30,7 @@ class QueryPlugin implements PluginInterface { Logger::debug('[Wechat][Extend][ProfitSharing][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $outOrderNo = $payload?->get('out_order_no') ?? null; $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php index 84cc5e2d..5509b2d5 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/profit-sharing/return-orders/query-return-order.html @@ -30,7 +30,7 @@ class QueryReturnPlugin implements PluginInterface { Logger::debug('[Wechat][Extend][ProfitSharing][QueryReturnPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $outOrderNo = $payload?->get('out_order_no') ?? null; $outReturnNo = $payload?->get('out_return_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php index 974b47a9..dd8c6161 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/profit-sharing/return-orders/create-return-order.html @@ -33,11 +33,11 @@ class ReturnPlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][ReturnPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { - throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账参数'); + throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账退回参数'); } if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php index 04befc0d..3c85140b 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/profit-sharing/orders/unfreeze-order.html @@ -33,11 +33,11 @@ class UnfreezePlugin implements PluginInterface Logger::debug('[Wechat][Extend][ProfitSharing][UnfreezePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { - throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账参数'); + throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 缺少分账解冻剩余资金参数'); } if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php index b0b7ee3d..d64a3024 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php @@ -11,7 +11,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/call-back-url/query-callback.html @@ -28,7 +28,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][Marketing][Coupon][Callback][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $mchId = $rocket->getPayload()?->get('mchid') ?? $config['mch_id'] ?? 'null'; $rocket->setPayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php index dedb15ce..e066ecbe 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php @@ -11,7 +11,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/call-back-url/set-callback.html @@ -28,7 +28,7 @@ class SetPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Callback][SetPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->mergePayload(array_merge( diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php index 49d7c3f6..84a2577a 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class DetailPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Coupons][DetailPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $openId = $payload?->get('openid') ?? null; $couponId = $payload?->get('coupon_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php index 6429e4be..dc94d70f 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -34,7 +34,7 @@ class QueryUserPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Coupons][QueryUserPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $openId = $payload?->get('openid') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php index ca991e00..178690e2 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -33,7 +33,7 @@ class SendPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Coupons][SendPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $openId = $payload?->get('openid') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php index 3ae3dd1e..3d34944e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php @@ -11,7 +11,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/create-coupon-stock.html @@ -28,7 +28,7 @@ class CreatePlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][CreatePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $belongMerchant = $rocket->getPayload()?->get('belong_merchant') ?? $config['mch_id']; $rocket->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php index ceb775be..780b1a11 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/pause-stock.html @@ -31,7 +31,7 @@ class PausePlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][PausePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; $stockCreatorMchId = $payload?->get('stock_creator_mchid') ?? $config['mch_id'] ?? ''; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php index f8d56081..4b311d47 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/query-stock.html @@ -31,7 +31,7 @@ class QueryDetailPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][QueryDetailPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; $mchId = $payload?->get('stock_creator_mchid') ?? $config['mch_id'] ?? 'null'; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php index 138e0637..ef68a986 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/list-available-singleitems.html @@ -33,7 +33,7 @@ class QueryItemsPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][QueryItemsPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php index 1566fde0..0777a46d 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/list-available-merchants.html @@ -33,7 +33,7 @@ class QueryMerchantsPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][QueryMerchantsPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php index 2f1a2d41..503c2381 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/list-stocks.html @@ -33,7 +33,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php index 13771a9e..c1393dc5 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/restart-stock.html @@ -31,7 +31,7 @@ class RestartPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][RestartPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; $stockCreatorMchId = $payload?->get('stock_creator_mchid') ?? $config['mch_id'] ?? ''; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php index 9df16474..8fae020a 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/cash-coupons/stock/start-stock.html @@ -31,7 +31,7 @@ class StartPlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Coupon][Stock][StartPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $stockId = $payload?->get('stock_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php index 2d848536..c1a5c829 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php @@ -16,7 +16,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-balance/accounts/query-day-end-balance.html @@ -32,7 +32,7 @@ class QueryDayEndPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][ECommerceBalance][QueryDayEndPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $accountType = $payload?->get('account_type') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php index b11355b5..942064a3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-balance/accounts/query-balance.html @@ -30,7 +30,7 @@ class QueryPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][ECommerceBalance][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $accountType = $rocket->getPayload()?->get('account_type') ?? null; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php index 87daaf9b..c7aa7d36 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -33,7 +33,7 @@ class ApplyPlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $subMchId = $payload?->get('sub_mchid') ?? $config['sub_mch_id'] ?? ''; $spAppId = $payload?->get('sp_appid') ?? $config[get_wechat_type_key($params)] ?? ''; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php index 6e4bda6a..6caf7105 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-refund/refunds/query-refund.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $refundId = $payload?->get('refund_id') ?? null; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php index 351c70b8..00f910fe 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-refund/refunds/query-refund-by-out-refund-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $outRefundNo = $payload?->get('out_refund_no') ?? null; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php index 6f88523f..f4a22a36 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-refund/refunds/query-return-advance.html @@ -32,7 +32,7 @@ class QueryReturnAdvancePlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $refundId = $payload?->get('refund_id') ?? null; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php index d6d494b6..9a256f54 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/partner/apis/ecommerce-refund/refunds/create-return-advance.html @@ -32,7 +32,7 @@ class ReturnAdvancePlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $refundId = $payload?->get('refund_id') ?? null; if (Pay::MODE_NORMAL === ($config['mode'] ?? Pay::MODE_NORMAL)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php index bfc35816..f8d6e425 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php @@ -16,7 +16,7 @@ use Yansongda\Pay\Exception\DecryptException; use Yansongda\Supports\Collection; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_public_key; use function Yansongda\Pay\get_wechat_serial_no; @@ -38,7 +38,7 @@ class CreatePlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->mergePayload(array_merge([ '_method' => 'POST', diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php index c1a4802b..d7436f16 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php @@ -11,7 +11,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/products/fapiao/apilist.html @@ -27,7 +27,7 @@ class CreateCardTemplatePlugin implements PluginInterface Logger::debug('[Wechat][V3][Marketing][Fapiao][CreateCardTemplatePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->mergePayload([ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php index d5352a41..ed6ccbf5 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -55,7 +55,7 @@ class GetTitleUrlPlugin implements PluginInterface */ protected function getQuery(Collection $payload, array $params): Collection { - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); return filter_params($payload)->merge([ 'appid' => $payload->get('appid', $config[get_wechat_type_key($params)] ?? ''), diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php index bc99dab5..7d6ae2d6 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch/get-transfer-batch-by-no.html @@ -31,7 +31,7 @@ class QueryByWxPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][Batch][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $batchId = $payload?->get('batch_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php index 33e2844c..36ac73a5 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch/get-transfer-batch-by-out-no.html @@ -31,7 +31,7 @@ class QueryPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][Batch][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $outBatchNo = $payload?->get('out_batch_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php index 655df145..c3141e73 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php @@ -18,7 +18,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_public_key; use function Yansongda\Pay\get_wechat_serial_no; use function Yansongda\Pay\get_wechat_type_key; @@ -41,7 +41,7 @@ class CreatePlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 发起商家转账,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php index e384654f..e022ccf9 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-detail/get-transfer-detail-by-no.html @@ -30,7 +30,7 @@ class QueryByWxPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][Detail][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $batchId = $payload?->get('batch_id') ?? null; $detailId = $payload?->get('detail_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php index aa35507f..970a0c02 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-detail/get-transfer-detail-by-out-no.html @@ -30,7 +30,7 @@ class QueryPlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][Detail][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); $payload = $rocket->getPayload(); $outBatchNo = $payload?->get('out_batch_no') ?? null; $outDetailNo = $payload?->get('out_detail_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php index 5d33e13c..c1a1972b 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/download-receipt.html @@ -32,7 +32,7 @@ class DownloadReceiptPlugin implements PluginInterface Logger::debug('[Wechat][Marketing][Transfer][DownloadReceiptPlugin] 插件开始装载', ['rocket' => $rocket]); $downloadUrl = $rocket->getPayload()?->get('download_url') ?? null; - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 下载电子回单,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php index af3a248b..b8e98eb3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/electronic-signature/create-electronic-signature.html @@ -30,7 +30,7 @@ class CreatePlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][Receipt][CreatePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 转账账单电子回单申请受理接口,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php index 457f8e0c..37d4f743 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/electronic-signature/get-electronic-signature-by-out-no.html @@ -31,7 +31,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][Marketing][Transfer][Receipt][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $outBatchNo = $rocket->getPayload()?->get('out_batch_no') ?? null; - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 查询转账账单电子回单接口,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php index 9fb5a2a2..c2c01b1e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/electronic-receipt-api/create-electronic-receipt.html @@ -30,7 +30,7 @@ class CreatePlugin implements PluginInterface { Logger::debug('[Wechat][Marketing][Transfer][ReceiptDetail][CreatePlugin] 插件开始装载', ['rocket' => $rocket]); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 受理转账明细电子回单,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php index aa752ae0..df46b69f 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use function Yansongda\Artful\filter_params; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/electronic-receipt-api/query-electronic-receipt.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][Marketing][Transfer][ReceiptDetail][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $payload = $rocket->getPayload(); - $config = get_wechat_config($rocket->getParams()); + $config = get_provider_config('wechat', $rocket->getParams()); if (Pay::MODE_SERVICE === ($config['mode'] ?? Pay::MODE_NORMAL)) { throw new InvalidParamsException(Exception::PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE, '参数异常: 查询转账明细电子回单受理结果API,只支持普通商户模式,当前配置为服务商模式'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php index 7b89ec5a..e6209e8d 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\App; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -15,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/close-order.html @@ -33,7 +34,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][App][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; @@ -45,14 +46,15 @@ class ClosePlugin implements PluginInterface $data = $this->service($payload, $config); } - $rocket->setPayload(array_merge( - [ - '_method' => 'POST', - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', - ], - $data ?? $this->normal($config) - )); + $rocket->setDirection(OriginResponseDirection::class) + ->setPayload(array_merge( + [ + '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', + '_method' => 'POST', + ], + $data ?? $this->normal($config) + )); Logger::info('[Wechat][V3][Pay][App][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php index 37b48c01..def54a1f 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; /** @@ -52,7 +52,7 @@ class InvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php index 00fc7ef3..2b8008d1 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/direct-jsons/app-prepay.html @@ -34,7 +34,7 @@ class PayPlugin implements PluginInterface $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (is_null($payload)) { throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: APP下单,参数为空'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php index 9ed125bf..b0a7bd70 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/query-by-wx-trade-no.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][App][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php index 11ba37ff..eb2ded40 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/query-by-out-trade-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][App][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php index b7bbaab8..9c09f158 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][App][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php index 4ef97108..c66896e6 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/in-app-payment/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][App][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php index 752101d7..e7649874 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; /** @@ -52,7 +52,7 @@ class AppInvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php index 3ac6007f..5044c4c6 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/combine-payment/orders/app-prepay.html @@ -31,7 +31,7 @@ class AppPayPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][AppPayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php index d30c0504..8af52630 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\Combine; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -13,7 +14,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +33,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $combineOutTradeNo = $payload?->get('combine_out_trade_no') ?? null; @@ -40,12 +41,14 @@ class ClosePlugin implements PluginInterface throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 合单关单,参数缺少 `combine_out_trade_no`'); } - $rocket->mergePayload([ - '_method' => 'POST', - '_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', - '_service_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', - 'combine_appid' => $payload->get('combine_appid', $config[get_wechat_type_key($params)] ?? ''), - ])->exceptPayload('combine_out_trade_no'); + $rocket->setDirection(OriginResponseDirection::class) + ->mergePayload([ + '_method' => 'POST', + '_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', + '_service_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', + 'combine_appid' => $payload->get('combine_appid', $config[get_wechat_type_key($params)] ?? ''), + ]) + ->exceptPayload('combine_out_trade_no'); Logger::info('[Wechat][Pay][Combine][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php index 328387fe..76efcd5d 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class H5PayPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][H5PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php index 8d98517a..7d976290 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; use function Yansongda\Pay\get_wechat_type_key; @@ -53,7 +53,7 @@ class JsapiInvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $params, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php index 06976ef3..f4323bd8 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class JsapiPayPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][JsapiPayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php index b68473df..2bb1a534 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; /** @@ -52,7 +52,7 @@ class MiniInvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php index 98f49879..3ec706b9 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/combine-payment/orders/mini-program-prepay.html @@ -31,7 +31,7 @@ class MiniPayPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][MiniPayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php index cdcfffd5..c435b674 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class NativePayPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][NativePayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php index eededc77..9f1c637b 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/combine-payment/refunds/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php index c2a43339..08efaa8c 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/combine-payment/refunds/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Combine][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php index be3f5286..4b946bb1 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\H5; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -15,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/h5-payment/close-order.html @@ -33,7 +34,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][H5][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; @@ -45,14 +46,15 @@ class ClosePlugin implements PluginInterface $data = $this->service($payload, $config); } - $rocket->setPayload(array_merge( - [ - '_method' => 'POST', - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', - ], - $data ?? $this->normal($config) - )); + $rocket->setDirection(OriginResponseDirection::class) + ->setPayload(array_merge( + [ + '_method' => 'POST', + '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', + ], + $data ?? $this->normal($config) + )); Logger::info('[Wechat][V3][Pay][H5][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php index 60de9c31..6fde0cbd 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -35,7 +35,7 @@ class PayPlugin implements PluginInterface $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (is_null($payload)) { throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: H5 下单,参数为空'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php index 2fd7668e..aa811523 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/h5-payment/query-by-wx-trade-no.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][H5][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php index b87713e6..9786a4bd 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/h5-payment/query-by-out-trade-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][H5][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php index 613c81f6..c282160f 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/h5-payment/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][H5][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php index 1be65d3a..9dbd42ff 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/h5-payment/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][H5][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php index e600e6dd..4aad2b00 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -15,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/jsapi-payment/close-order.html @@ -33,7 +34,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][Pay][Jsapi][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; @@ -45,14 +46,15 @@ class ClosePlugin implements PluginInterface $data = $this->service($payload, $config); } - $rocket->setPayload(array_merge( - [ - '_method' => 'POST', - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', - ], - $data ?? $this->normal($config) - )); + $rocket->setDirection(OriginResponseDirection::class) + ->setPayload(array_merge( + [ + '_method' => 'POST', + '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', + ], + $data ?? $this->normal($config) + )); Logger::info('[Wechat][Pay][Jsapi][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php index 64f56c22..82a721b7 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; use function Yansongda\Pay\get_wechat_type_key; @@ -53,7 +53,7 @@ class InvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $params, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php index 9ba20bed..7642cf32 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -35,7 +35,7 @@ class PayPlugin implements PluginInterface $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (is_null($payload)) { throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: Jsapi 下单,参数为空'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php index 01c18cee..bbd08cdb 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/jsapi-payment/query-by-wx-trade-no.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Jsapi][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php index 871c7fa2..c52825a3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/jsapi-payment/query-by-out-trade-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Jsapi][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php index 9e8a244c..f050eb35 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/jsapi-payment/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Jsapi][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php index 5a02639e..b419cd61 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/jsapi-payment/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Jsapi][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php index 64c1f595..cfaf85c3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\Mini; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -15,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/close-order.html @@ -33,7 +34,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][Pay][Mini][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; @@ -45,14 +46,15 @@ class ClosePlugin implements PluginInterface $data = $this->service($payload, $config); } - $rocket->setPayload(array_merge( - [ - '_method' => 'POST', - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', - ], - $data ?? $this->normal($config) - )); + $rocket->setDirection(OriginResponseDirection::class) + ->setPayload(array_merge( + [ + '_method' => 'POST', + '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', + ], + $data ?? $this->normal($config) + )); Logger::info('[Wechat][Pay][Mini][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php index deb95283..0016fbad 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php @@ -19,7 +19,7 @@ use Yansongda\Supports\Collection; use Yansongda\Supports\Config; use Yansongda\Supports\Str; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_sign; /** @@ -52,7 +52,7 @@ class InvokePlugin implements PluginInterface } $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $rocket->setDestination($this->getInvokeConfig($payload, $config, $prepayId)); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php index c7605226..5549c0d3 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/mini-prepay.html @@ -34,7 +34,7 @@ class PayPlugin implements PluginInterface $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (is_null($payload)) { throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: Mini 下单,参数为空'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php index 6c67e387..90d6da1f 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-wx-trade-no.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Mini][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php index cf2ed91e..22450b18 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-trade-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Mini][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php index faa35372..9302ea0a 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Mini][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php index 107710dc..306f978a 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][Pay][Mini][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php index 7cd21430..62c65eb8 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php @@ -6,6 +6,7 @@ namespace Yansongda\Pay\Plugin\Wechat\V3\Pay\Native; use Closure; use Yansongda\Artful\Contract\PluginInterface; +use Yansongda\Artful\Direction\OriginResponseDirection; use Yansongda\Artful\Exception\ContainerException; use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; @@ -15,7 +16,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/native-payment/close-order.html @@ -33,7 +34,7 @@ class ClosePlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Native][ClosePlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; @@ -45,14 +46,15 @@ class ClosePlugin implements PluginInterface $data = $this->service($payload, $config); } - $rocket->setPayload(array_merge( - [ - '_method' => 'POST', - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', - ], - $data ?? $this->normal($config) - )); + $rocket->setDirection(OriginResponseDirection::class) + ->setPayload(array_merge( + [ + '_method' => 'POST', + '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', + ], + $data ?? $this->normal($config) + )); Logger::info('[Wechat][Pay][Native][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php index 5b27098b..151b2813 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -35,7 +35,7 @@ class PayPlugin implements PluginInterface $payload = $rocket->getPayload(); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); if (is_null($payload)) { throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: Native 下单,参数为空'); diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php index fb2592b2..e5b67ad8 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/native-payment/query-by-wx-trade-no.html @@ -32,7 +32,7 @@ class QueryByWxPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Native][QueryByWxPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $transactionId = $payload?->get('transaction_id') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php index da61c1a9..50a14d71 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/native-payment/query-by-out-trade-no.html @@ -32,7 +32,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Native][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php index 8ddfcb1b..ff323c3e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/native-payment/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryRefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Native][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php index 8fc6b8c7..4a22300d 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/native-payment/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Native][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php index 56687aff..94cd3cad 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php @@ -14,7 +14,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -32,7 +32,7 @@ class CancelPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Pos][CancelPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outTradeNo = $payload?->get('out_trade_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php index c7613a61..c77ca0f0 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_type_key; /** @@ -30,7 +30,7 @@ class PayPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Pos][PayPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $rocket->mergePayload(array_merge( [ diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php index 46bf6eac..52a4122e 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php @@ -13,7 +13,7 @@ use Yansongda\Artful\Logger; use Yansongda\Artful\Rocket; use Yansongda\Pay\Exception\Exception; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/refund/refunds/query-by-out-refund-no.html @@ -31,7 +31,7 @@ class QueryPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Refund][QueryPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); $outRefundNo = $payload?->get('out_refund_no') ?? null; diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php index f365d278..b028ae8d 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php @@ -18,7 +18,7 @@ use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_wechat_public_key; use function Yansongda\Pay\get_wechat_serial_no; @@ -41,7 +41,7 @@ class RefundAbnormalPlugin implements PluginInterface $params = $rocket->getParams(); $payload = $rocket->getPayload(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $refundId = $payload?->get('refund_id') ?? null; if (empty($refundId)) { diff --git a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php index 98a96728..51bf5b46 100644 --- a/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php +++ b/vendor/yansongda/pay/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; /** * @see https://pay.weixin.qq.com/docs/merchant/apis/refund/refunds/create.html @@ -33,7 +33,7 @@ class RefundPlugin implements PluginInterface Logger::debug('[Wechat][V3][Pay][Refund][RefundPlugin] 插件开始装载', ['rocket' => $rocket]); $params = $rocket->getParams(); - $config = get_wechat_config($params); + $config = get_provider_config('wechat', $params); $payload = $rocket->getPayload(); if (is_null($payload)) { diff --git a/vendor/yansongda/pay/src/Provider/Alipay.php b/vendor/yansongda/pay/src/Provider/Alipay.php index b6a0e560..1c583c16 100644 --- a/vendor/yansongda/pay/src/Provider/Alipay.php +++ b/vendor/yansongda/pay/src/Provider/Alipay.php @@ -54,7 +54,7 @@ class Alipay implements ProviderInterface */ public function __call(string $shortcut, array $params): null|Collection|MessageInterface|Rocket { - $plugin = '\\Yansongda\\Pay\\Shortcut\\Alipay\\'.Str::studly($shortcut).'Shortcut'; + $plugin = '\Yansongda\Pay\Shortcut\Alipay\\'.Str::studly($shortcut).'Shortcut'; return Artful::shortcut($plugin, ...$params); } diff --git a/vendor/yansongda/pay/src/Provider/Jsb.php b/vendor/yansongda/pay/src/Provider/Jsb.php new file mode 100644 index 00000000..11908465 --- /dev/null +++ b/vendor/yansongda/pay/src/Provider/Jsb.php @@ -0,0 +1,155 @@ + 'https://mybank.jsbchina.cn:577/eis/merchant/merchantServices.htm', + Pay::MODE_SANDBOX => 'https://epaytest.jsbchina.cn:9999/eis/merchant/merchantServices.htm', + ]; + + /** + * @param mixed $name + * @param mixed $params + * + * @throws ContainerException + * @throws InvalidParamsException + * @throws ServiceNotFoundException + */ + public function __call($name, $params): null|Collection|MessageInterface|Rocket + { + $plugin = '\Yansongda\Pay\Shortcut\Jsb\\'.Str::studly($name).'Shortcut'; + + return Artful::shortcut($plugin, ...$params); + } + + /** + * @throws ContainerException + * @throws InvalidParamsException + */ + public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket + { + return Artful::artful($plugins, $params); + } + + public function mergeCommonPlugins(array $plugins): array + { + return array_merge( + [StartPlugin::class], + $plugins, + [AddPayloadSignPlugin::class, AddRadarPlugin::class, VerifySignaturePlugin::class, ResponsePlugin::class, ParserPlugin::class], + ); + } + + /** + * @throws InvalidParamsException + */ + public function cancel(array $order): Collection|Rocket + { + throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support cancel api'); + } + + /** + * @throws InvalidParamsException + */ + public function close(array $order): Collection|Rocket + { + throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support close api'); + } + + /** + * @throws ContainerException + * @throws InvalidParamsException + * @throws ServiceNotFoundException + */ + public function refund(array $order): Collection|Rocket + { + Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null)); + + return $this->__call('refund', [$order]); + } + + /** + * @throws ContainerException + * @throws InvalidParamsException + */ + public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket + { + $request = $this->getCallbackParams($contents); + + Event::dispatch(new CallbackReceived('jsb', $request->all(), $params, null)); + + return $this->pay( + [CallbackPlugin::class], + ['request' => $request, 'params' => $params] + ); + } + + public function success(): ResponseInterface + { + return new Response( + 200, + ['Content-Type' => 'text/html'], + 'success', + ); + } + + /** + * @throws ContainerException + * @throws InvalidParamsException + * @throws ServiceNotFoundException + */ + public function query(array $order): Collection|Rocket + { + Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null)); + + return $this->__call('query', [$order]); + } + + protected function getCallbackParams($contents = null): Collection + { + if (is_array($contents)) { + return Collection::wrap($contents); + } + + if ($contents instanceof ServerRequestInterface) { + return Collection::wrap($contents->getParsedBody()); + } + + $request = ServerRequest::fromGlobals(); + + return Collection::wrap($request->getParsedBody()); + } +} diff --git a/vendor/yansongda/pay/src/Provider/Unipay.php b/vendor/yansongda/pay/src/Provider/Unipay.php index 2bbc5911..08d7cce2 100644 --- a/vendor/yansongda/pay/src/Provider/Unipay.php +++ b/vendor/yansongda/pay/src/Provider/Unipay.php @@ -51,7 +51,7 @@ class Unipay implements ProviderInterface */ public function __call(string $shortcut, array $params): null|Collection|MessageInterface|Rocket { - $plugin = '\\Yansongda\\Pay\\Shortcut\\Unipay\\'.Str::studly($shortcut).'Shortcut'; + $plugin = '\Yansongda\Pay\Shortcut\Unipay\\'.Str::studly($shortcut).'Shortcut'; return Artful::shortcut($plugin, ...$params); } diff --git a/vendor/yansongda/pay/src/Provider/Wechat.php b/vendor/yansongda/pay/src/Provider/Wechat.php index 6e96b99c..f8975ecd 100644 --- a/vendor/yansongda/pay/src/Provider/Wechat.php +++ b/vendor/yansongda/pay/src/Provider/Wechat.php @@ -16,6 +16,7 @@ use Yansongda\Artful\Exception\InvalidParamsException; use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Plugin\AddPayloadBodyPlugin; use Yansongda\Artful\Plugin\ParserPlugin; +use Yansongda\Artful\Plugin\StartPlugin; use Yansongda\Artful\Rocket; use Yansongda\Pay\Contract\ProviderInterface; use Yansongda\Pay\Event\CallbackReceived; @@ -24,7 +25,6 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Pay; use Yansongda\Pay\Plugin\Wechat\AddRadarPlugin; use Yansongda\Pay\Plugin\Wechat\ResponsePlugin; -use Yansongda\Pay\Plugin\Wechat\StartPlugin; use Yansongda\Pay\Plugin\Wechat\V3\AddPayloadSignaturePlugin; use Yansongda\Pay\Plugin\Wechat\V3\CallbackPlugin; use Yansongda\Pay\Plugin\Wechat\V3\VerifySignaturePlugin; @@ -58,7 +58,7 @@ class Wechat implements ProviderInterface */ public function __call(string $shortcut, array $params): null|Collection|MessageInterface { - $plugin = '\\Yansongda\\Pay\\Shortcut\\Wechat\\'.Str::studly($shortcut).'Shortcut'; + $plugin = '\Yansongda\Pay\Shortcut\Wechat\\'.Str::studly($shortcut).'Shortcut'; return Artful::shortcut($plugin, ...$params); } diff --git a/vendor/yansongda/pay/src/Service/JsbServiceProvider.php b/vendor/yansongda/pay/src/Service/JsbServiceProvider.php new file mode 100644 index 00000000..67997424 --- /dev/null +++ b/vendor/yansongda/pay/src/Service/JsbServiceProvider.php @@ -0,0 +1,24 @@ +getParams(); - $config = get_alipay_config($params); + $config = get_provider_config('alipay', $params); $serviceProviderId = $config['service_provider_id'] ?? null; if (Pay::MODE_SERVICE !== ($config['mode'] ?? Pay::MODE_NORMAL)