mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 10:47:57 +08:00
deprecate: get_xxx_config
方法已废弃,使用 get_provider_config
方法代替 (#994)
This commit is contained in:
parent
0420b70e50
commit
66942f1db7
@ -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([
|
||||
|
@ -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
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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]');
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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', ''));
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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, [
|
||||
|
@ -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,
|
||||
|
@ -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()) {
|
||||
|
@ -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']) {
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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)
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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;
|
||||
|
@ -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),
|
||||
|
@ -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()),
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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([
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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` 解密失败');
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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([
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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([
|
||||
|
@ -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'] ?? '';
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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'] ?? '';
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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)] ?? '';
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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',
|
||||
|
@ -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([
|
||||
|
@ -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)] ?? ''),
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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, '参数异常: 发起商家转账,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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, '参数异常: 下载电子回单,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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, '参数异常: 转账账单电子回单申请受理接口,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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, '参数异常: 查询转账账单电子回单接口,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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, '参数异常: 受理转账明细电子回单,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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,只支持普通商户模式,当前配置为服务商模式');
|
||||
|
@ -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;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user