diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 5c6b65d..c638d19 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -4,6 +4,7 @@ $finder = PhpCsFixer\Finder::create() ->in('src'); return (new PhpCsFixer\Config()) + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setUsingCache(false) ->setRiskyAllowed(true) ->setRules([ diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b288c..2f287eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### deprecated - deprecate: 微信 `StartPlugin` 改为使用 `yansongda/artful` 中的插件(#993) +- deprecate: `get_wechat_config`, `get_alipay_config`, `get_unipay_config` 方法已废弃,使用 `get_provider_config` 方法代替(#994) ## v3.7.4 diff --git a/src/Functions.php b/src/Functions.php index ee804c7..5f7c302 100644 --- a/src/Functions.php +++ b/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; @@ -63,6 +64,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 +127,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 +246,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 +323,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 +352,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 +433,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 +481,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'); diff --git a/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php b/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php index a89a2a9..dd3614f 100644 --- a/src/Plugin/Alipay/V2/AddPayloadSignaturePlugin.php +++ b/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/src/Plugin/Alipay/V2/AddRadarPlugin.php b/src/Plugin/Alipay/V2/AddRadarPlugin.php index 09d08ca..732dd49 100644 --- a/src/Plugin/Alipay/V2/AddRadarPlugin.php +++ b/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/src/Plugin/Alipay/V2/CallbackPlugin.php b/src/Plugin/Alipay/V2/CallbackPlugin.php index 13ca835..d0bbc7c 100644 --- a/src/Plugin/Alipay/V2/CallbackPlugin.php +++ b/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/src/Plugin/Alipay/V2/StartPlugin.php b/src/Plugin/Alipay/V2/StartPlugin.php index f74b37d..187a762 100644 --- a/src/Plugin/Alipay/V2/StartPlugin.php +++ b/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/src/Plugin/Alipay/V2/VerifySignaturePlugin.php b/src/Plugin/Alipay/V2/VerifySignaturePlugin.php index 738b8e6..5e667e5 100644 --- a/src/Plugin/Alipay/V2/VerifySignaturePlugin.php +++ b/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/src/Plugin/Unipay/AddRadarPlugin.php b/src/Plugin/Unipay/AddRadarPlugin.php index 01a590b..4b5b569 100644 --- a/src/Plugin/Unipay/AddRadarPlugin.php +++ b/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/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php b/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php index a0b0b6b..62a9585 100644 --- a/src/Plugin/Unipay/Open/AddPayloadSignaturePlugin.php +++ b/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/src/Plugin/Unipay/Open/CallbackPlugin.php b/src/Plugin/Unipay/Open/CallbackPlugin.php index 740cb89..2fc127b 100644 --- a/src/Plugin/Unipay/Open/CallbackPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php b/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php index d4c8c5e..991670b 100644 --- a/src/Plugin/Unipay/Open/Pay/H5/PayPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php index eab69d1..6c82829 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/CancelPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php index ef9dc7c..7d361bf 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/PosPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php index 71856ad..b3f3f0f 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/PosPreAuthPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php index 089dba9..2594d39 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/QueryPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php index 0d1491e..ff445db 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/RefundPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php index 7381d93..a7de9cc 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/ScanFeePlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php index 18a00f9..5a0e241 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/ScanPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php index 92ca3d1..ee49436 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreAuthPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php b/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php index acb18ac..0c44b8b 100644 --- a/src/Plugin/Unipay/Open/Pay/QrCode/ScanPreOrderPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php b/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php index 9d811d1..4379948 100644 --- a/src/Plugin/Unipay/Open/Pay/Web/CancelPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php b/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php index 632586f..df20095 100644 --- a/src/Plugin/Unipay/Open/Pay/Web/PayPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php b/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php index a78fb4b..e57e372 100644 --- a/src/Plugin/Unipay/Open/Pay/Web/QueryPlugin.php +++ b/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/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php b/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php index 11a89b0..ab7b0b5 100644 --- a/src/Plugin/Unipay/Open/Pay/Web/RefundPlugin.php +++ b/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/src/Plugin/Unipay/Open/StartPlugin.php b/src/Plugin/Unipay/Open/StartPlugin.php index c92ff68..ed3252c 100644 --- a/src/Plugin/Unipay/Open/StartPlugin.php +++ b/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/src/Plugin/Unipay/Open/VerifySignaturePlugin.php b/src/Plugin/Unipay/Open/VerifySignaturePlugin.php index c20c1f0..aca6db4 100644 --- a/src/Plugin/Unipay/Open/VerifySignaturePlugin.php +++ b/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/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php b/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php index 56afd94..7c205e7 100644 --- a/src/Plugin/Unipay/Qra/AddPayloadSignaturePlugin.php +++ b/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/src/Plugin/Unipay/Qra/CallbackPlugin.php b/src/Plugin/Unipay/Qra/CallbackPlugin.php index eb61bf0..3cc00ff 100644 --- a/src/Plugin/Unipay/Qra/CallbackPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php b/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php index e354c05..ecfe1b9 100644 --- a/src/Plugin/Unipay/Qra/Pos/CancelPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/PayPlugin.php b/src/Plugin/Unipay/Qra/Pos/PayPlugin.php index c88752d..5ae7815 100644 --- a/src/Plugin/Unipay/Qra/Pos/PayPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php b/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php index 4405143..d6dffd2 100644 --- a/src/Plugin/Unipay/Qra/Pos/QueryOpenIdPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php b/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php index 76f79ef..c8aebab 100644 --- a/src/Plugin/Unipay/Qra/Pos/QueryPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php b/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php index ce25dc2..7d9280a 100644 --- a/src/Plugin/Unipay/Qra/Pos/QueryRefundPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php b/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php index cfbb08a..58096b9 100644 --- a/src/Plugin/Unipay/Qra/Pos/RefundPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php b/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php index 6e6277c..c6e486f 100644 --- a/src/Plugin/Unipay/Qra/Scan/ClosePlugin.php +++ b/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/src/Plugin/Unipay/Qra/Scan/PayPlugin.php b/src/Plugin/Unipay/Qra/Scan/PayPlugin.php index 8e22f92..ea253de 100644 --- a/src/Plugin/Unipay/Qra/Scan/PayPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php b/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php index 9a1515a..bff614d 100644 --- a/src/Plugin/Unipay/Qra/Scan/QueryPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php b/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php index 4981b48..9458bbe 100644 --- a/src/Plugin/Unipay/Qra/Scan/QueryRefundPlugin.php +++ b/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/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php b/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php index 242c61c..d0c57b8 100644 --- a/src/Plugin/Unipay/Qra/Scan/RefundPlugin.php +++ b/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/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php b/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php index 135cb80..5f86622 100644 --- a/src/Plugin/Unipay/Qra/VerifySignaturePlugin.php +++ b/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/src/Plugin/Wechat/AddRadarPlugin.php b/src/Plugin/Wechat/AddRadarPlugin.php index 3df82b6..9b085ef 100644 --- a/src/Plugin/Wechat/AddRadarPlugin.php +++ b/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/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php b/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php index c8521c3..9bc0d31 100644 --- a/src/Plugin/Wechat/V2/AddPayloadSignaturePlugin.php +++ b/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/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php b/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php index 9fd1ec2..36bc989 100644 --- a/src/Plugin/Wechat/V2/Papay/Direct/ApplyPlugin.php +++ b/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/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php b/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php index adffba5..fb7c1d5 100644 --- a/src/Plugin/Wechat/V2/Papay/Direct/ContractOrderPlugin.php +++ b/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/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php b/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php index acdf7cf..7f30d7a 100644 --- a/src/Plugin/Wechat/V2/Papay/Direct/MiniOnlyContractPlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php b/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php index 72cb573..b30e2cf 100644 --- a/src/Plugin/Wechat/V2/Pay/App/InvokePlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php b/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php index e144dc6..992fc72 100644 --- a/src/Plugin/Wechat/V2/Pay/Mini/InvokePlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php b/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php index 00b957b..831cf4b 100644 --- a/src/Plugin/Wechat/V2/Pay/Pos/CancelPlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php b/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php index f3bbd7e..e3961f0 100644 --- a/src/Plugin/Wechat/V2/Pay/Pos/PayPlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php b/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php index 49b1c84..0262578 100644 --- a/src/Plugin/Wechat/V2/Pay/Pos/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php b/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php index 6d2cf33..453c6c2 100644 --- a/src/Plugin/Wechat/V2/Pay/Redpack/SendPlugin.php +++ b/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/src/Plugin/Wechat/V2/VerifySignaturePlugin.php b/src/Plugin/Wechat/V2/VerifySignaturePlugin.php index 7875e8c..9c7031e 100644 --- a/src/Plugin/Wechat/V2/VerifySignaturePlugin.php +++ b/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/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php b/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php index 1b426af..fa84bfb 100644 --- a/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php +++ b/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/src/Plugin/Wechat/V3/CallbackPlugin.php b/src/Plugin/Wechat/V3/CallbackPlugin.php index 79e4eb7..107924c 100644 --- a/src/Plugin/Wechat/V3/CallbackPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php b/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php index 53b4e1b..9e6aeb6 100644 --- a/src/Plugin/Wechat/V3/Extend/Complaints/CompletePlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php b/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php index 955a3e7..5764716 100644 --- a/src/Plugin/Wechat/V3/Extend/Complaints/QueryDetailPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php b/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php index 854f0ef..6ed6050 100644 --- a/src/Plugin/Wechat/V3/Extend/Complaints/ResponsePlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php index 6627888..26c909e 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php index 8e33e03..b1f45dd 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php index c4f65fc..07dac6e 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/DeleteReceiverPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php index 96deebc..3620fa5 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryMerchantConfigsPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php index 0326878..02ba6e0 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php index 84cc5e2..5509b2d 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/QueryReturnPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php index 974b47a..dd8c616 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPlugin.php +++ b/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/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php b/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php index 04befc0..3c85140 100644 --- a/src/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php index b0b7ee3..d64a302 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php index dedb15c..e066ecb 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Callback/SetPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php index 49d7c3f..84a2577 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/DetailPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php index 6429e4b..dc94d70 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/QueryUserPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php index ca991e0..178690e 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Coupons/SendPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php index 3ae3dd1..3d34944 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php index ceb775b..780b1a1 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/PausePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php index f8d5608..4b311d4 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryDetailPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php index 138e063..ef68a98 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryItemsPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php index 1566fde..0777a46 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryMerchantsPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php index 2f1a2d4..503c238 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php index 13771a9..c1393dc 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/RestartPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php b/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php index 9df1647..8fae020 100644 --- a/src/Plugin/Wechat/V3/Marketing/Coupon/Stock/StartPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php index 2d84853..c1a5c82 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryDayEndPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php index b11355b..942064a 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceBalance/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php index 87daaf9..c7aa7d3 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ApplyPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php index 6e4bda6..6caf710 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php index 351c70b..00f910f 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php index 6f88523..f4a22a3 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/QueryReturnAdvancePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php b/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php index d6d494b..9a256f5 100644 --- a/src/Plugin/Wechat/V3/Marketing/ECommerceRefund/ReturnAdvancePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php index bfc3581..f8d6e42 100644 --- a/src/Plugin/Wechat/V3/Marketing/Fapiao/Blockchain/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php index c1a4802..d7436f1 100644 --- a/src/Plugin/Wechat/V3/Marketing/Fapiao/CreateCardTemplatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php b/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php index d5352a4..ed6ccbf 100644 --- a/src/Plugin/Wechat/V3/Marketing/Fapiao/GetTitleUrlPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php index bc99dab..7d6ae2d 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php index 33e2844..36ac73a 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Batch/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php index 655df14..c3141e7 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php index e384654..e022ccf 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php index aa35507..970a0c0 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Detail/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php index 5d33e13..c1a1972 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/DownloadReceiptPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php index af3a248..b8e98eb 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php index 457f8e0..37d4f74 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/Receipt/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php index 9fb5a2a..c2c01b1 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/CreatePlugin.php +++ b/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/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php b/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php index aa752ae..df46b69 100644 --- a/src/Plugin/Wechat/V3/Marketing/Transfer/ReceiptDetail/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php index 7b89ec5..6d82d81 100644 --- a/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/App/ClosePlugin.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/close-order.html @@ -33,7 +33,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; diff --git a/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php b/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php index 37b48c0..def54a1 100644 --- a/src/Plugin/Wechat/V3/Pay/App/InvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php index 00fc7ef..2b8008d 100644 --- a/src/Plugin/Wechat/V3/Pay/App/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php index 9ed125b..b0a7bd7 100644 --- a/src/Plugin/Wechat/V3/Pay/App/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php index 11ba37f..eb2ded4 100644 --- a/src/Plugin/Wechat/V3/Pay/App/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php index b7bbaab..9c09f15 100644 --- a/src/Plugin/Wechat/V3/Pay/App/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php index 4ef9710..c66896e 100644 --- a/src/Plugin/Wechat/V3/Pay/App/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php index 752101d..e764987 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php index 3ac6007..5044c4c 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/AppPayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php index d30c050..bb38a36 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/Combine/ClosePlugin.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 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; diff --git a/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php index 328387f..76efcd5 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/H5PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php index 8d98517..7d97629 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/JsapiInvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php index 06976ef..f4323bd 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/JsapiPayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php index b68473d..2bb1a53 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php index 98f4987..3ec706b 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/MiniPayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php index cdcfffd..c435b67 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/NativePayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php index eededc7..9f1c637 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php index c2a4333..08efaa8 100644 --- a/src/Plugin/Wechat/V3/Pay/Combine/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php index be3f528..523683a 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/H5/ClosePlugin.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/close-order.html @@ -33,7 +33,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; diff --git a/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php index 60de9c3..6fde0cb 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php index 2fd7668..aa81152 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php index b87713e..9786a4b 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php index 613c81f..c282160 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php index 1be65d3..9dbd42f 100644 --- a/src/Plugin/Wechat/V3/Pay/H5/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php index e600e6d..69a7ea7 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/Jsapi/ClosePlugin.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/close-order.html @@ -33,7 +33,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; diff --git a/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php index 64f56c2..82a721b 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/InvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php index 9ba20be..7642cf3 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php index 01c18ce..bbd08cd 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php index 871c7fa..c52825a 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php index 9e8a244..f050eb3 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php index 5a02639..b419cd6 100644 --- a/src/Plugin/Wechat/V3/Pay/Jsapi/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php index 64c1f59..5b50383 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/Mini/ClosePlugin.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/close-order.html @@ -33,7 +33,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; diff --git a/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php index deb9528..0016fba 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/InvokePlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php index c760522..5549c0d 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php index 6c67e38..90d6da1 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php index cf2ed91..22450b1 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php index faa3537..9302ea0 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php index 107710d..306f978 100644 --- a/src/Plugin/Wechat/V3/Pay/Mini/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php b/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php index 7cd2143..e6bc5b7 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.php +++ b/src/Plugin/Wechat/V3/Pay/Native/ClosePlugin.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/close-order.html @@ -33,7 +33,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; diff --git a/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php index 5b27098..151b281 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php b/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php index fb2592b..e5b67ad 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/QueryByWxPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php index da61c1a..50a14d7 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php index 8ddfcb1..ff323c3 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/QueryRefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php index 8fc6b8c..4a22300 100644 --- a/src/Plugin/Wechat/V3/Pay/Native/RefundPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php b/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php index 56687af..94cd3ca 100644 --- a/src/Plugin/Wechat/V3/Pay/Pos/CancelPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php b/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php index c7613a6..c77ca0f 100644 --- a/src/Plugin/Wechat/V3/Pay/Pos/PayPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php b/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php index 46bf6ea..52a4122 100644 --- a/src/Plugin/Wechat/V3/Pay/Refund/QueryPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php b/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php index f365d27..b028ae8 100644 --- a/src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php +++ b/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/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php b/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php index 98a9672..51bf5b4 100644 --- a/src/Plugin/Wechat/V3/Pay/Refund/RefundPlugin.php +++ b/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/src/Traits/SupportServiceProviderTrait.php b/src/Traits/SupportServiceProviderTrait.php index 0ba57fe..14ae8ae 100644 --- a/src/Traits/SupportServiceProviderTrait.php +++ b/src/Traits/SupportServiceProviderTrait.php @@ -9,7 +9,7 @@ use Yansongda\Artful\Exception\ServiceNotFoundException; use Yansongda\Artful\Rocket; use Yansongda\Pay\Pay; -use function Yansongda\Pay\get_alipay_config; +use function Yansongda\Pay\get_provider_config; trait SupportServiceProviderTrait { @@ -20,7 +20,7 @@ trait SupportServiceProviderTrait protected function loadAlipayServiceProvider(Rocket $rocket): void { $params = $rocket->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) diff --git a/tests/FunctionTest.php b/tests/FunctionTest.php index 5ef8b35..2ecc806 100644 --- a/tests/FunctionTest.php +++ b/tests/FunctionTest.php @@ -21,17 +21,15 @@ use function Yansongda\Pay\decrypt_wechat_contents; use function Yansongda\Pay\decrypt_wechat_resource; use function Yansongda\Pay\decrypt_wechat_resource_aes_256_gcm; use function Yansongda\Pay\encrypt_wechat_contents; -use function Yansongda\Pay\get_alipay_config; use function Yansongda\Pay\get_private_cert; +use function Yansongda\Pay\get_provider_config; use function Yansongda\Pay\get_public_cert; use function Yansongda\Pay\get_radar_url; use function Yansongda\Pay\get_tenant; use function Yansongda\Pay\get_unipay_body; -use function Yansongda\Pay\get_unipay_config; use function Yansongda\Pay\get_unipay_sign_qra; use function Yansongda\Pay\get_unipay_url; 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_miniprogram_pay_sign; use function Yansongda\Pay\get_wechat_miniprogram_user_sign; @@ -83,7 +81,7 @@ class FunctionTest extends TestCase public function testGetAlipayConfig() { - self::assertArrayHasKey('app_id', get_alipay_config()); + self::assertArrayHasKey('app_id', get_provider_config('alipay')); Pay::clear(); @@ -94,14 +92,14 @@ class FunctionTest extends TestCase ] ]; Pay::config($config2); - self::assertEquals(['name' => 'yansongda'], get_alipay_config()); + self::assertEquals(['name' => 'yansongda'], get_provider_config('alipay')); - self::assertEquals(['age' => 28], get_alipay_config(['_config' => 'c1'])); + self::assertEquals(['age' => 28], get_provider_config('alipay', ['_config' => 'c1'])); } public function testVerifyAlipaySign() { - verify_alipay_sign(get_alipay_config(), json_encode([ + verify_alipay_sign(get_provider_config('alipay'), json_encode([ "code" => "10000", "msg" => "Success", "order_id" => "20231220110070000002150000657610", @@ -125,19 +123,19 @@ class FunctionTest extends TestCase self::expectException(InvalidConfigException::class); self::expectExceptionCode(Exception::CONFIG_ALIPAY_INVALID); - verify_alipay_sign(get_alipay_config(), '', 'aaa'); + verify_alipay_sign(get_provider_config('alipay'), '', 'aaa'); } public function testVerifyAlipaySignEmpty() { self::expectException(InvalidSignException::class); self::expectExceptionCode(Exception::SIGN_EMPTY); - verify_alipay_sign(get_alipay_config(), '', ''); + verify_alipay_sign(get_provider_config('alipay'), '', ''); } public function testGetWechatConfig() { - self::assertArrayHasKey('mp_app_id', get_wechat_config([])); + self::assertArrayHasKey('mp_app_id', get_provider_config('wechat', [])); $config2 = [ 'wechat' => [ @@ -146,9 +144,9 @@ class FunctionTest extends TestCase ] ]; Pay::config(array_merge($config2, ['_force' => true])); - self::assertEquals(['name' => 'yansongda'], get_wechat_config([])); + self::assertEquals(['name' => 'yansongda'], get_provider_config('wechat', [])); - self::assertEquals(['age' => 28], get_wechat_config(['_config' => 'c1'])); + self::assertEquals(['age' => 28], get_provider_config('wechat', ['_config' => 'c1'])); } public function testGetWechatMethod() @@ -195,7 +193,7 @@ class FunctionTest extends TestCase self::assertEquals( 'KzIgMgiop3nQJNdBVR2Xah/JUwVBLDFFajyXPiSN8b8YAYEA4FuWfaCgFJ52+WFed+PhOYWx/ZPih4RaEuuSdYB8eZwYUx7RZGMQZk0bKCctAjjPuf4pJN+f/WsXKjPIy3diqF5x7gyxwSCaKWP4/KjsHNqgQpiC8q1uC5xmElzuhzSwj88LIoLtkAuSmtUVvdAt0Nz41ECHZgHWSGR32TfBo902r8afdaVKkFde8IoqcEJJcp6sMxdDO5l9R5KEWxrJ1SjsXVrb0IPH8Nj7e6hfhq7pucxojPpzsC+ZWAYvufZkAQx3kTiFmY87T+QhkP9FesOfWvkIRL4E6MP6ug==', - get_wechat_sign(get_wechat_config([]), $contents) + get_wechat_sign(get_provider_config('wechat', []), $contents) ); // test config error @@ -216,7 +214,7 @@ class FunctionTest extends TestCase public function testGetWechatSignV2() { $params = ['name' => 'yansongda', 'age' => 29, 'foo' => '']; - self::assertEquals('3213848AED2C380749FD1D559555881D', get_wechat_sign_v2(get_wechat_config($params), $params)); + self::assertEquals('3213848AED2C380749FD1D559555881D', get_wechat_sign_v2(get_provider_config('wechat', $params), $params)); // test config error $config1 = [ @@ -230,7 +228,7 @@ class FunctionTest extends TestCase self::expectException(InvalidConfigException::class); self::expectExceptionCode(Exception::CONFIG_WECHAT_INVALID); - get_wechat_sign_v2(get_wechat_config(), []); + get_wechat_sign_v2(get_provider_config('wechat'), []); } public function testVerifyWechatSign() @@ -270,13 +268,13 @@ class FunctionTest extends TestCase public function testVerifyWechatSignV2() { $destination = ['name' => 'yansongda', 'age' => 29, 'foo' => '', 'sign' => '3213848AED2C380749FD1D559555881D']; - verify_wechat_sign_v2(get_wechat_config(), $destination); + verify_wechat_sign_v2(get_provider_config('wechat'), $destination); self::assertTrue(true); $destination = ['name' => 'yansongda', 'age' => 29, 'foo' => '']; self::expectException(InvalidSignException::class); self::expectExceptionCode(Exception::SIGN_EMPTY); - verify_wechat_sign_v2(get_wechat_config(), $destination); + verify_wechat_sign_v2(get_provider_config('wechat'), $destination); } public function testVerifyWechatSignV2EmptySecret() @@ -296,14 +294,14 @@ class FunctionTest extends TestCase self::expectException(InvalidSignException::class); self::expectExceptionCode(Exception::SIGN_ERROR); - verify_wechat_sign_v2(get_wechat_config(), $destination); + verify_wechat_sign_v2(get_provider_config('wechat'), $destination); } public function testEncryptWechatContents() { $serialNo = '45F59D4DABF31918AFCEC556D5D2C6E376675D57'; $contents = 'yansongda'; - $result = encrypt_wechat_contents($contents, get_wechat_config([])['wechat_public_cert_path'][$serialNo]); + $result = encrypt_wechat_contents($contents, get_provider_config('wechat')['wechat_public_cert_path'][$serialNo]); self::assertIsString($result); } @@ -311,7 +309,7 @@ class FunctionTest extends TestCase { $encrypted = 'WIesmK+dSJycwdhTTkNmv0Lk2wb9o7NGODovccjhyotNnRkEeh+sxRK1gNSRNMJJgkQ30m4HwcuweSO24mehFeXVNTVAKFVef/3FlHnYDZfE1c3mCLToEef7e8J/Z8TwFH1ecn3t+Jk9ZaBpQKNHdQ0Q8jcL7AnL48h0D9BcZxDekPqX6hNnKfISoKSv4TXFcgvBLFeAe4Q3KM0Snq0N5IvI86D9xZqVg6mY+Gfz0782ymQFxflau6Qxx3mJ+0etHMocNuCdgctVH390XYYMc0u+V2FCJ5cU5h/M/AxzP9ayrEO4l0ftaxL6lP0HjifNrkPcAAb+q9I67UepKO9iGw=='; - $config = get_wechat_config(); + $config = get_provider_config('wechat'); self::assertEquals('yansongda', decrypt_wechat_contents($encrypted, $config)); self::assertNull(decrypt_wechat_contents('invalid', $config)); @@ -400,7 +398,7 @@ class FunctionTest extends TestCase 'nonce' => '4196a5b75276', ]; - $result = decrypt_wechat_resource($resource, get_wechat_config()); + $result = decrypt_wechat_resource($resource, get_provider_config('wechat')); self::assertTrue(false !== strpos($result['ciphertext'], '-----BEGIN CERTIFICATE-----')); } @@ -475,18 +473,18 @@ class FunctionTest extends TestCase public function testGetWechatPublicKey() { $serialNo = '45F59D4DABF31918AFCEC556D5D2C6E376675D57'; - $result = get_wechat_public_key(get_wechat_config(), $serialNo); + $result = get_wechat_public_key(get_provider_config('wechat'), $serialNo); self::assertIsString($result); $serialNo = 'non-exist'; self::expectException(InvalidParamsException::class); self::expectExceptionCode(Exception::PARAMS_WECHAT_SERIAL_NOT_FOUND); - get_wechat_public_key(get_wechat_config(), $serialNo); + get_wechat_public_key(get_provider_config('wechat'), $serialNo); } public function testGetWechatMiniprogramPaySign() { - self::assertEquals('6bb3e49bb4744fc6817331333ffa435e0d1409c3c900a87637c98265445cbe96', get_wechat_miniprogram_pay_sign(get_wechat_config(), 'yansongda.cn', '{"name":"yansongda"}')); + self::assertEquals('6bb3e49bb4744fc6817331333ffa435e0d1409c3c900a87637c98265445cbe96', get_wechat_miniprogram_pay_sign(get_provider_config('wechat'), 'yansongda.cn', '{"name":"yansongda"}')); self::expectException(InvalidConfigException::class); self::expectExceptionCode(Exception::CONFIG_WECHAT_INVALID); @@ -500,7 +498,7 @@ class FunctionTest extends TestCase public function testGetUnipayConfig() { - self::assertArrayHasKey('mch_id', get_unipay_config([])); + self::assertArrayHasKey('mch_id', get_provider_config('unipay')); Pay::clear(); @@ -511,9 +509,9 @@ class FunctionTest extends TestCase ] ]; Pay::config($config2); - self::assertEquals(['name' => 'yansongda'], get_unipay_config([])); + self::assertEquals(['name' => 'yansongda'], get_provider_config('unipay')); - self::assertEquals(['age' => 28], get_unipay_config(['_config' => 'c1'])); + self::assertEquals(['age' => 28], get_provider_config('unipay', ['_config' => 'c1'])); } public function testVerifyUnipaySign() @@ -546,7 +544,7 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r -----END CERTIFICATE-----&traceNo=067402&traceTime=0908132206&txnAmt=1&txnSubType=01&txnTime=20220908132206&txnType=01&version=5.1.0"; $sign = 'JeA4S2+6TbGo9yjXDUvV5A2E3oJbunoCcZ66exN6xR3OH/5PNDK1VSV1Mq7XhVdxzkTeREUveiOYHalqoagRkh71nsHVvruwGbk6azygXSaawuO5tF67UIqNd4Mbufwh1KhbVpEkKbOETUvRhFcdon0fulE97I83eMSk52INHt8E1xk8NdbhyUadSlp+Uv30AKx70PpQbTGmVS3PJfd+Whj0b7LnvZKeC+BS1kUOtIKlcZO+gBoTigvCIJqj51kBrcBCs+x+VaeGm7EYBBhGSERpfQhQ4n+eJBwLdBeZ0/dNbo3iELjvVMx0n9KoW4klvUJhaH5LALA8pV02SbZv4Q=='; - verify_unipay_sign(get_unipay_config(), $contents, $sign); + verify_unipay_sign(get_provider_config('unipay'), $contents, $sign); self::assertTrue(true); @@ -588,7 +586,7 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r public function testGetUnipaySignQra() { - $config = get_unipay_config(['_config' => 'qra']); + $config = get_provider_config('unipay', ['_config' => 'qra']); $payload = [ 'out_trade_no' => 'pos-qra-20240106163401', @@ -633,7 +631,7 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r "version" => "2.0", ]; - verify_unipay_sign_qra(get_unipay_config(['_config' => 'qra']), $payload); + verify_unipay_sign_qra(get_provider_config('unipay', ['_config' => 'qra']), $payload); self::assertTrue(true); self::expectException(InvalidConfigException::class); @@ -662,7 +660,7 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r self::expectException(InvalidSignException::class); self::expectExceptionCode(Exception::SIGN_ERROR); - verify_unipay_sign_qra(get_unipay_config(['_config' => 'qra']), $payload); + verify_unipay_sign_qra(get_provider_config('unipay', ['_config' => 'qra']), $payload); } public function testVerifyUnipaySignQraEmpty() @@ -685,6 +683,6 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r self::expectException(InvalidSignException::class); self::expectExceptionCode(Exception::SIGN_EMPTY); - verify_unipay_sign_qra(get_unipay_config(['_config' => 'qra']), $payload); + verify_unipay_sign_qra(get_provider_config('unipay', ['_config' => 'qra']), $payload); } } diff --git a/tests/Plugin/Unipay/Open/StartPluginTest.php b/tests/Plugin/Unipay/Open/StartPluginTest.php index 161cf45..1fce7da 100644 --- a/tests/Plugin/Unipay/Open/StartPluginTest.php +++ b/tests/Plugin/Unipay/Open/StartPluginTest.php @@ -7,7 +7,7 @@ use Yansongda\Pay\Pay; use Yansongda\Pay\Plugin\Unipay\Open\StartPlugin; use Yansongda\Artful\Rocket; use Yansongda\Pay\Tests\TestCase; -use function Yansongda\Pay\get_unipay_config; +use function Yansongda\Pay\get_provider_config; class StartPluginTest extends TestCase { @@ -35,7 +35,7 @@ class StartPluginTest extends TestCase $rocket = (new Rocket())->setParams($params); $result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); - $config = get_unipay_config([]); + $config = get_provider_config('unipay'); self::assertEquals($payload, $result->getPayload()->all()); self::assertArrayHasKey('cert', $config['certs']); diff --git a/tests/Plugin/Wechat/V3/AddPayloadSignaturePluginTest.php b/tests/Plugin/Wechat/V3/AddPayloadSignaturePluginTest.php index 9e84df6..3e7aab4 100644 --- a/tests/Plugin/Wechat/V3/AddPayloadSignaturePluginTest.php +++ b/tests/Plugin/Wechat/V3/AddPayloadSignaturePluginTest.php @@ -11,7 +11,7 @@ use Yansongda\Pay\Pay; use Yansongda\Pay\Plugin\Wechat\V3\AddPayloadSignaturePlugin; use Yansongda\Pay\Tests\TestCase; use Yansongda\Supports\Collection; -use function Yansongda\Pay\get_wechat_config; +use function Yansongda\Pay\get_provider_config; class AddPayloadSignaturePluginTest extends TestCase { @@ -54,7 +54,7 @@ class AddPayloadSignaturePluginTest extends TestCase $class = new ReflectionClass($this->plugin); $method = $class->getMethod('getSignatureContent'); - $result = $method->invokeArgs($this->plugin, [get_wechat_config($params), $payload, $timestamp, $random]); + $result = $method->invokeArgs($this->plugin, [get_provider_config('wechat', $params), $payload, $timestamp, $random]); self::assertEquals($contents, $result); } @@ -81,7 +81,7 @@ class AddPayloadSignaturePluginTest extends TestCase $class = new ReflectionClass($this->plugin); $method = $class->getMethod('getSignature'); - $result = $method->invokeArgs($this->plugin, [get_wechat_config($params), $timestamp, $random, $contents]); + $result = $method->invokeArgs($this->plugin, [get_provider_config('wechat', $params), $timestamp, $random, $contents]); self::assertEquals( 'WECHATPAY2-SHA256-RSA2048 mchid="1600314069",nonce_str="QqtzdVzxavZeXag9G5mtfzbfzFMf89p6",timestamp="1626493236",serial_no="25F8AA5452D55497C24BA57DC81B1E5915DC2E77",signature="KzIgMgiop3nQJNdBVR2Xah/JUwVBLDFFajyXPiSN8b8YAYEA4FuWfaCgFJ52+WFed+PhOYWx/ZPih4RaEuuSdYB8eZwYUx7RZGMQZk0bKCctAjjPuf4pJN+f/WsXKjPIy3diqF5x7gyxwSCaKWP4/KjsHNqgQpiC8q1uC5xmElzuhzSwj88LIoLtkAuSmtUVvdAt0Nz41ECHZgHWSGR32TfBo902r8afdaVKkFde8IoqcEJJcp6sMxdDO5l9R5KEWxrJ1SjsXVrb0IPH8Nj7e6hfhq7pucxojPpzsC+ZWAYvufZkAQx3kTiFmY87T+QhkP9FesOfWvkIRL4E6MP6ug=="', @@ -116,7 +116,7 @@ class AddPayloadSignaturePluginTest extends TestCase $class = new ReflectionClass($this->plugin); $method = $class->getMethod('getSignature'); - $method->invokeArgs($this->plugin, [get_wechat_config($params), $timestamp, $random, $contents]); + $method->invokeArgs($this->plugin, [get_provider_config('wechat', $params), $timestamp, $random, $contents]); } public function testGetSignatureWrongMchPublicCert() @@ -146,6 +146,6 @@ class AddPayloadSignaturePluginTest extends TestCase $class = new ReflectionClass($this->plugin); $method = $class->getMethod('getSignature'); - $method->invokeArgs($this->plugin, [get_wechat_config($params), $timestamp, $random, $contents]); + $method->invokeArgs($this->plugin, [get_provider_config('wechat', $params), $timestamp, $random, $contents]); } } diff --git a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPluginTest.php b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPluginTest.php index e41d6d2..0df32ae 100644 --- a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPluginTest.php +++ b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/AddReceiverPluginTest.php @@ -26,7 +26,7 @@ class AddReceiverPluginTest extends TestCase self::expectException(InvalidParamsException::class); self::expectExceptionCode(Exception::PARAMS_NECESSARY_PARAMS_MISSING); - self::expectExceptionMessage('参数异常: 缺少分账参数'); + self::expectExceptionMessage('参数异常: 缺少添加分账接收方参数'); $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); } diff --git a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePluginTest.php b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePluginTest.php index ecd3c76..d26239f 100644 --- a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePluginTest.php +++ b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePluginTest.php @@ -26,7 +26,7 @@ class CreatePluginTest extends TestCase self::expectException(InvalidParamsException::class); self::expectExceptionCode(Exception::PARAMS_NECESSARY_PARAMS_MISSING); - self::expectExceptionMessage('参数异常: 缺少分账参数'); + self::expectExceptionMessage('参数异常: 缺少请求分账参数'); $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); } diff --git a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPluginTest.php b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPluginTest.php index 5d32a17..cfdf67d 100644 --- a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPluginTest.php +++ b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/ReturnPluginTest.php @@ -26,7 +26,7 @@ class ReturnPluginTest extends TestCase self::expectException(InvalidParamsException::class); self::expectExceptionCode(Exception::PARAMS_NECESSARY_PARAMS_MISSING); - self::expectExceptionMessage('参数异常: 缺少分账参数'); + self::expectExceptionMessage('参数异常: 缺少分账退回参数'); $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); } diff --git a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePluginTest.php b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePluginTest.php index 531428a..34dfcc7 100644 --- a/tests/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePluginTest.php +++ b/tests/Plugin/Wechat/V3/Extend/ProfitSharing/UnfreezePluginTest.php @@ -26,7 +26,7 @@ class UnfreezePluginTest extends TestCase self::expectException(InvalidParamsException::class); self::expectExceptionCode(Exception::PARAMS_NECESSARY_PARAMS_MISSING); - self::expectExceptionMessage('参数异常: 缺少分账参数'); + self::expectExceptionMessage('参数异常: 缺少分账解冻剩余资金参数'); $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); }