Store the customized Shopro mall so it can be kept on the remote.
Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\InvalidConfigException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Exception\Exception;
|
||||
|
||||
use function Yansongda\Pay\get_private_cert;
|
||||
use function Yansongda\Pay\get_provider_config;
|
||||
|
||||
class AddPayloadSignaturePlugin implements PluginInterface
|
||||
{
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][AddPayloadSignaturePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload(['sign' => $this->getSign($rocket)]);
|
||||
|
||||
Logger::info('[Alipay][AddPayloadSignaturePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
protected function getSign(Rocket $rocket): string
|
||||
{
|
||||
$privateKey = $this->getPrivateKey($rocket->getParams());
|
||||
|
||||
$content = $rocket->getPayload()->sortKeys()->toString();
|
||||
|
||||
openssl_sign($content, $sign, $privateKey, OPENSSL_ALGO_SHA256);
|
||||
|
||||
return base64_encode($sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
protected function getPrivateKey(array $params): string
|
||||
{
|
||||
$privateKey = get_provider_config('alipay', $params)['app_secret_cert'] ?? null;
|
||||
|
||||
if (is_null($privateKey)) {
|
||||
throw new InvalidConfigException(Exception::CONFIG_ALIPAY_INVALID, '配置异常: 缺少支付宝配置 -- [app_secret_cert]');
|
||||
}
|
||||
|
||||
return get_private_cert($privateKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2;
|
||||
|
||||
use Closure;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
use function Yansongda\Artful\get_radar_method;
|
||||
use function Yansongda\Pay\get_alipay_url;
|
||||
use function Yansongda\Pay\get_provider_config;
|
||||
|
||||
class AddRadarPlugin implements PluginInterface
|
||||
{
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][AddRadarPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$params = $rocket->getParams();
|
||||
$config = get_provider_config('alipay', $params);
|
||||
$payload = $rocket->getPayload();
|
||||
|
||||
$rocket->setRadar(new Request(
|
||||
// 这里因为支付宝的 payload 里不包含 _method,所以需要取 params 中的
|
||||
get_radar_method(new Collection($params)) ?? 'POST',
|
||||
get_alipay_url($config, $payload),
|
||||
$this->getHeaders(),
|
||||
// 不能用 packer,支付宝接收的是 x-www-form-urlencoded 返回的又是 json,packer 用的是返回.
|
||||
$payload?->query() ?? '',
|
||||
));
|
||||
|
||||
Logger::info('[Alipay][AddRadarPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
|
||||
protected function getHeaders(): array
|
||||
{
|
||||
return [
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
'User-Agent' => 'yansongda/pay-v3',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\NoHttpRequestDirection;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\InvalidConfigException;
|
||||
use Yansongda\Artful\Exception\InvalidParamsException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Exception\Exception;
|
||||
use Yansongda\Pay\Exception\InvalidSignException;
|
||||
|
||||
use function Yansongda\Artful\filter_params;
|
||||
use function Yansongda\Pay\get_provider_config;
|
||||
use function Yansongda\Pay\verify_alipay_sign;
|
||||
|
||||
class AppCallbackPlugin implements PluginInterface
|
||||
{
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServiceNotFoundException
|
||||
* @throws InvalidSignException
|
||||
* @throws InvalidParamsException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][AppCallbackPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$params = $rocket->getParams();
|
||||
$config = get_provider_config('alipay', $params);
|
||||
|
||||
if (empty($params['alipay_trade_app_pay_response'])) {
|
||||
throw new InvalidParamsException(Exception::PARAMS_CALLBACK_REQUEST_INVALID);
|
||||
}
|
||||
|
||||
$value = filter_params($params['alipay_trade_app_pay_response']);
|
||||
|
||||
verify_alipay_sign($config, $value->toJson(), $params['sign'] ?? '');
|
||||
|
||||
$rocket->setPayload($params)
|
||||
->setDirection(NoHttpRequestDirection::class)
|
||||
->setDestination($rocket->getPayload());
|
||||
|
||||
Logger::info('[Alipay][AppCallbackPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\NoHttpRequestDirection;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\InvalidConfigException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Exception\InvalidSignException;
|
||||
|
||||
use function Yansongda\Artful\filter_params;
|
||||
use function Yansongda\Pay\get_provider_config;
|
||||
use function Yansongda\Pay\verify_alipay_sign;
|
||||
|
||||
class CallbackPlugin implements PluginInterface
|
||||
{
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServiceNotFoundException
|
||||
* @throws InvalidSignException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][CallbackPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$params = $rocket->getParams();
|
||||
$config = get_provider_config('alipay', $params);
|
||||
|
||||
$value = filter_params($params, fn ($k, $v) => '' !== $v && 'sign' != $k && 'sign_type' != $k);
|
||||
|
||||
verify_alipay_sign($config, $value->sortKeys()->toString(), $params['sign'] ?? '');
|
||||
|
||||
$rocket->setPayload($params)
|
||||
->setDirection(NoHttpRequestDirection::class)
|
||||
->setDestination($rocket->getPayload());
|
||||
|
||||
Logger::info('[Alipay][CallbackPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
use function Yansongda\Artful\filter_params;
|
||||
|
||||
class FormatPayloadBizContentPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][FormatPayloadBizContentPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$payload = $rocket->getPayload();
|
||||
|
||||
$rocket->setPayload(
|
||||
filter_params($payload->all(), fn ($k, $v) => '' !== $v && 'sign' != $k)
|
||||
->merge([
|
||||
'biz_content' => json_encode(filter_params($payload->get('biz_content', []))),
|
||||
])
|
||||
);
|
||||
|
||||
Logger::info('[Alipay][FormatPayloadBizContentPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\PCreditPayInstallment;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02np8z?pathHash=994a1e7d&ref=api
|
||||
*/
|
||||
class AppPayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][PCreditPayInstallment][AppPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.trade.app.pay',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][PCreditPayInstallment][AppPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\PCreditPayInstallment;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02np8y?pathHash=718b8786&ref=api
|
||||
*/
|
||||
class H5PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][PCreditPayInstallment][H5PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.trade.wap.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'QUICK_WAP_WAY',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][PCreditPayInstallment][H5PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\PCreditPayInstallment;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02np90?pathHash=d2a20943&ref=api&scene=32
|
||||
*/
|
||||
class PosPayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][PCreditPayInstallment][PosPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'FACE_TO_FACE_PAYMENT',
|
||||
'scene' => 'bar_code',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][PCreditPayInstallment][PosPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\PCreditPayInstallment;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02np92?pathHash=de4742e0&ref=api
|
||||
*/
|
||||
class ScanPayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][PCreditPayInstallment][ScanPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.precreate',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][PCreditPayInstallment][ScanPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Query;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/d87dc009_alipay.trade.order.onsettle.query?pathHash=53466049&ref=api&scene=common
|
||||
*/
|
||||
class OnsettlePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Query][OnsettlePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.order.onsettle.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Query][OnsettlePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Query;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/6f314ee9_alipay.trade.royalty.rate.query?pathHash=9118088a&ref=api&scene=common
|
||||
*/
|
||||
class RatePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Query][RatePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.royalty.rate.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Query][RatePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Query;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/9ef980b7_alipay.trade.order.settle.query?pathHash=688b1c13&ref=api&scene=common
|
||||
*/
|
||||
class SettlePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Query][SettlePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.order.settle.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Query][SettlePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Relation;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/c21931d6_alipay.trade.royalty.relation.bind?pathHash=08a24dae&ref=api&scene=common
|
||||
*/
|
||||
class BindPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Relation][BindPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.royalty.relation.bind',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Relation][BindPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Relation;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/1860be54_alipay.trade.royalty.relation.batchquery?pathHash=2f733e2d&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Relation][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.royalty.relation.batchquery',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Relation][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Relation;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/3613f4e1_alipay.trade.royalty.relation.unbind?pathHash=5a880175&ref=api&scene=common
|
||||
*/
|
||||
class UnbindPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Relation][UnbindPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.royalty.relation.unbind',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Relation][UnbindPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Royalty\Request;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/c3b24498_alipay.trade.order.settle?pathHash=8e6acab4&ref=api&scene=common
|
||||
*/
|
||||
class SettleOrderPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Royalty][Request][SettleOrderPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.order.settle',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Royalty][Request][SettleOrderPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/1aad1956_alipay.data.bill.ereceipt.apply?pathHash=a2527e9c&ref=api&scene=common
|
||||
*/
|
||||
class ApplyReceiptPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][ApplyReceiptPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.bill.ereceipt.apply',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][ApplyReceiptPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer\Bill;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/76606b11_alipay.data.dataservice.bill.downloadurl.query?pathHash=425f62c6&ref=api&scene=common
|
||||
*/
|
||||
class QueryUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][Bill][QueryUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][Bill][QueryUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer\Fund;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/58a29899_alipay.fund.trans.common.query?pathHash=aad07c6d&ref=api&scene=f9fece54d41f49cbbd00dc73655a01a4
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][Fund][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.trans.common.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][Fund][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer\Fund;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/62987723_alipay.fund.trans.uni.transfer?pathHash=66064890&ref=api&scene=ca56bca529e64125a2786703c6192d41
|
||||
* @see https://opendocs.alipay.com/open/02byvi?pathHash=b367173b&ref=api&scene=66dd06f5a923403393b85de68d3c0055
|
||||
*/
|
||||
class TransferPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][Fund][TransferPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.trans.uni.transfer',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'biz_scene' => 'DIRECT_TRANSFER',
|
||||
'product_code' => 'TRANS_ACCOUNT_NO_PWD',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][Fund][TransferPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/1b8a680c_alipay.fund.account.query?pathHash=ff8fc0e0&ref=api&scene=c76aa8f1c54e4b8b8ffecfafc4d3c31c
|
||||
*/
|
||||
class QueryAccountPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][QueryAccountPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.account.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][QueryAccountPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/30b94a2f_alipay.data.bill.ereceipt.query?pathHash=bfe1c3f4&ref=api&scene=common
|
||||
*/
|
||||
class QueryReceiptPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][QueryReceiptPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.bill.ereceipt.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][QueryReceiptPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02byvd?pathHash=2dceb6d2&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Fund][Transfer][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.trans.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Fund][Transfer][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Marketing\Redpack;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/03rbyf?pathHash=76643847&ref=api&scene=common
|
||||
*/
|
||||
class AppPayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Marketing][Redpack][AppPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.fund.trans.app.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'STD_RED_PACKET',
|
||||
'biz_scene' => 'PERSONAL_PAY',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Marketing][Redpack][AppPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Marketing\Redpack;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/03rbye?pathHash=1c8d9fcb&ref=api&scene=common
|
||||
*/
|
||||
class WebPayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Marketing][Redpack][WebPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.fund.trans.page.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'STD_APP_TRANSFER',
|
||||
],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Marketing][Redpack][WebPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Authorization;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02aile?pathHash=4efd837f&ref=api&scene=common
|
||||
*/
|
||||
class AuthPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Authorization][AuthPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.info.auth',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Authorization][AuthPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Authorization;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/6b97edd1_alipay.open.auth.userauth.relationship.query?pathHash=ac4a364e&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Authorization][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.open.auth.userauth.relationship.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Authorization][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Authorization;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/84bc7352_alipay.system.oauth.token?pathHash=fe1502d5&ref=api&scene=common
|
||||
*/
|
||||
class TokenPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Authorization][TokenPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload(array_merge(
|
||||
[
|
||||
'method' => 'alipay.system.oauth.token',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
));
|
||||
|
||||
Logger::info('[Alipay][Member][Authorization][TokenPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Certification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ahk0?pathHash=b485c65c&ref=api&scene=common
|
||||
*/
|
||||
class CertifyPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Certification][CertifyPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.certify.open.certify',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Certification][CertifyPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Certification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ahjy?pathHash=ed72e8ea&ref=api&scene=common
|
||||
*/
|
||||
class InitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Certification][AppInitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.certify.open.initialize',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'FACE',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Certification][AppInitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Certification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ahjw?pathHash=a3efadb6&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Certification][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.certify.open.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Certification][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/a74a7068_alipay.user.info.share?pathHash=af2476d4&ref=api&scene=common
|
||||
*/
|
||||
class DetailPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][DetailPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$params = $rocket->getParams();
|
||||
|
||||
$rocket->mergePayload([
|
||||
'auth_token' => $params['auth_token'] ?? $params['_auth_token'] ?? '',
|
||||
'method' => 'alipay.user.info.share',
|
||||
'biz_content' => [],
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][DetailPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceCheck;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/03nisu?pathHash=43fcb08b&ref=api&scene=common
|
||||
*/
|
||||
class AppInitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceCheck][AppInitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.check.initialize',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'biz_code' => 'DATA_DIGITAL_BIZ_CODE_FACE_CHECK_LIVE',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceCheck][AppInitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceCheck;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/03nisv?pathHash=3f259e83&ref=api&scene=common
|
||||
*/
|
||||
class AppQueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceCheck][AppQueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.check.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceCheck][AppQueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/04jg6r?pathHash=0572cc86&ref=api&scene=common
|
||||
*/
|
||||
class AppInitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][AppInitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.verification.initialize',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'biz_code' => 'DATA_DIGITAL_BIZ_CODE_FACE_VERIFICATION',
|
||||
'identity_type' => 'CERT_INFO',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][AppInitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/04jg6s?pathHash=1608a398&ref=api&scene=common
|
||||
*/
|
||||
class AppQueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][AppQueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.verification.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][AppQueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02zloa?pathHash=b0b7fece&ref=api&scene=common
|
||||
*/
|
||||
class H5InitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][H5InitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.certify.initialize',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'biz_code' => 'FUTURE_TECH_BIZ_FACE_SDK',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][H5InitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02zloc?pathHash=b1141506&ref=api&scene=common
|
||||
*/
|
||||
class H5QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][H5QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.certify.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][H5QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02zlob?pathHash=20eba12a&ref=api&scene=common
|
||||
*/
|
||||
class H5VerifyPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][H5VerifyPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.certify.verify',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][H5VerifyPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/04pxq6?pathHash=f421977b&ref=api&scene=common
|
||||
*/
|
||||
class ServerVerifyPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][FaceVerification][ServerVerifyPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.face.source.certify',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'cert_type' => 'IDENTITY_CARD',
|
||||
],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][FaceVerification][ServerVerifyPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Ocr;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/043ksf?pathHash=ea0482cd&ref=api&scene=common
|
||||
*/
|
||||
class AppInitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Ocr][AppInitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.ocr.mobile.initialize',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'biz_code' => 'DATA_DIGITAL_BIZ_CODE_OCR',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Ocr][AppInitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Ocr;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/0aggs5?pathHash=084101d3&ref=api
|
||||
*/
|
||||
class DetectPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Ocr][DetectPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.ocr.common.detect',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Ocr][DetectPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\Ocr;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/05ut8h?pathHash=8cc2aaf1&ref=api&scene=common
|
||||
*/
|
||||
class ServerDetectPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Member][Ocr][ServerDetectPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'datadigital.fincloud.generalsaas.ocr.server.detect',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Member][Ocr][ServerDetectPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Bill;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/1523f88d_alipay.data.dataservice.bill.downloadurl.query?pathHash=6a78e19b&ref=api&scene=common
|
||||
*/
|
||||
class QueryUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Bill][QueryUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Bill][QueryUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/e65d4f60_alipay.trade.app.pay?pathHash=d2d3578f&ref=api&scene=f235566281d54f96942a44b84640a918
|
||||
*/
|
||||
class AppPayPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][AppPayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.trade.app.pay',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][AppPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/83a5f6d3_alipay.trade.cancel?pathHash=f27672eb&ref=api&scene=common
|
||||
*/
|
||||
class CancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][CancelPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.cancel',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/24a75394_alipay.trade.close?pathHash=7bf94ec4&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/38d751b1_alipay.trade.pay?pathHash=0a98c4e0&ref=api&scene=b4d9c9906e14451b99c8de390ae20fea
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'GENERAL_WITHHOLDING',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/07005f5c_alipay.trade.query?pathHash=aa8ed91c&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/de34d4fa_alipay.trade.refund?pathHash=46ea3fea&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Pay][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Pay][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Sign;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/ed428330_alipay.user.agreement.executionplan.modify?pathHash=13c30e39&ref=api&scene=common
|
||||
*/
|
||||
class ModifyPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Sign][ModifyPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.executionplan.modify',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Sign][ModifyPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Sign;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/3dab71bc_alipay.user.agreement.query?pathHash=6706b504&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Sign][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Sign][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Sign;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/8bccfa0b_alipay.user.agreement.page.sign?pathHash=725a0634&ref=api&scene=common
|
||||
*/
|
||||
class SignPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Sign][SignPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.user.agreement.page.sign',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Sign][SignPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\Sign;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/b841da1f_alipay.user.agreement.unsign?pathHash=6d2d4910&ref=api&scene=common
|
||||
*/
|
||||
class UnsignPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Agreement][Sign][UnsignPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.user.agreement.unsign',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Agreement][Sign][UnsignPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/ce0b4954_alipay.trade.close?pathHash=7b0fdae1&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/cd12c885_alipay.trade.app.pay?pathHash=c0e35284&ref=api&scene=20
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.trade.app.pay',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/b5c20219_alipay.data.dataservice.bill.downloadurl.query?pathHash=5a085da8&ref=api&scene=common
|
||||
*/
|
||||
class QueryBillUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][QueryBillUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][QueryBillUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/82ea786a_alipay.trade.query?pathHash=0745ecea&ref=api&scene=23
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/8c776df6_alipay.trade.fastpay.refund.query?pathHash=fb6e1894&ref=api&scene=common
|
||||
*/
|
||||
class QueryRefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][QueryRefundPlugin] 通用插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.fastpay.refund.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][QueryRefundPlugin] 通用插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\App;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/6c0cdd7d_alipay.trade.refund?pathHash=4081e89c&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][App][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][App][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhe?pathHash=629fa9a5&ref=api&scene=2a9ad7e9012248b0acd5edd04c9f31b6
|
||||
*/
|
||||
class AppFreezePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][AppFreezePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.fund.auth.order.app.freeze',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'PREAUTH_PAY',
|
||||
],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][AppFreezePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhh?pathHash=1cfd43b0&ref=api&scene=common
|
||||
*/
|
||||
class CancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][CancelPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.auth.operation.cancel',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/09bk7c?pathHash=d86258e3&ref=api&scene=9453b93a5f93490893e7ea5d19d754c9
|
||||
*/
|
||||
class PosFreezePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][PosFreezePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.auth.order.freeze',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'auth_code_type' => 'bar_code',
|
||||
'product_code' => 'PREAUTH_PAY',
|
||||
],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][PosFreezePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhg?pathHash=44be9c20&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.auth.operation.detail.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/09bj50?pathHash=9c577eb9&ref=api&scene=b58198cdbff342edad810bfee704489a
|
||||
*/
|
||||
class ScanFreezePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][ScanFreezePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.auth.order.voucher.create',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'PREAUTH_PAY',
|
||||
],
|
||||
$rocket->getParams()
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][ScanFreezePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Auth;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhi?pathHash=7435c8fd&ref=api&scene=common
|
||||
*/
|
||||
class UnfreezePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Auth][AppFreezePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.fund.auth.order.unfreeze',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Auth][AppFreezePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Bill;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhr?pathHash=f6a9e642&ref=api&scene=common
|
||||
*/
|
||||
class QueryUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Bill][QueryUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Bill][QueryUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhl?pathHash=22f195b5&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhk?pathHash=1c57dd00&ref=api&scene=32f92b62c19b44cfaf3bf4d974fcbcf3
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'PREAUTH_PAY',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhn?pathHash=7c131156&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jhm?pathHash=b36fd1d4&ref=api&scene=common
|
||||
*/
|
||||
class QueryRefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][QueryRefundPlugin] 通用插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.fastpay.refund.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][QueryRefundPlugin] 通用插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/064jho?pathHash=1e92f707&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\Pay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/2c9c00e8_alipay.trade.orderinfo.sync?pathHash=bc74615a&ref=api&scene=common
|
||||
*/
|
||||
class SyncPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Authorization][Pay][SyncPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.orderinfo.sync',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Authorization][Pay][SyncPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Face;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/2f7c1d5f_zoloz.authentication.smilepay.initialize?pathHash=24de8b36&ref=api&scene=common
|
||||
*/
|
||||
class InitPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Face][InitPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'zoloz.authentication.smilepay.initialize',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Face][InitPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Face;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/c8e4d285_zoloz.authentication.customer.ftoken.query?pathHash=4cba522d&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Face][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'zoloz.authentication.customer.ftoken.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Face][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/a62e8677_alipay.trade.close?pathHash=0801e763&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Direction\ResponseDirection;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/29ae8cb6_alipay.trade.wap.pay?pathHash=0a6313c7&ref=api&scene=21
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->setDirection(ResponseDirection::class)
|
||||
->mergePayload([
|
||||
'method' => 'alipay.trade.wap.pay',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/3c9f1bcf_alipay.data.dataservice.bill.downloadurl.query?pathHash=97357e8b&ref=api&scene=common
|
||||
*/
|
||||
class QueryBillUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][QueryBillUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][QueryBillUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/4e2d51d1_alipay.trade.query?pathHash=8abc6ffe&ref=api&scene=common
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/7be83133_alipay.trade.fastpay.refund.query?pathHash=7cf4fed5&ref=api&scene=common
|
||||
*/
|
||||
class QueryRefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][QueryRefundPlugin] 通用插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.fastpay.refund.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][QueryRefundPlugin] 通用插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\H5;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/4b7cc5db_alipay.trade.refund?pathHash=d98b006d&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][H5][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][H5][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/05xunj?pathHash=ca2a9ea6&ref=api&scene=common
|
||||
*/
|
||||
class CancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][CancelPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.cancel',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/05xhst?pathHash=f30ab879&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/05x9kv?pathHash=779dc517&ref=api&scene=de4d6a1e0c6e423b9eefa7c3a6dcb7a5
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.create',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'product_code' => 'JSAPI_PAY',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/05xr1m?pathHash=3522e59a&ref=api&scene=common
|
||||
*/
|
||||
class QueryBillUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][QueryBillUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][QueryBillUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/6f534d7f_alipay.trade.query?pathHash=98c03720&ref=api&scene=23
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/4a0fb7bf_alipay.trade.fastpay.refund.query?pathHash=2e6cbb7c&ref=api&scene=common
|
||||
*/
|
||||
class QueryRefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.fastpay.refund.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][QueryRefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/mini/05xskz?pathHash=b18b975d&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Mini][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Mini][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/13399511_alipay.trade.cancel?pathHash=b0a8222c&ref=api&scene=common
|
||||
*/
|
||||
class CancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][CancelPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.cancel',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/e84f0d79_alipay.trade.close?pathHash=b25c3fc7&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/1f1fe18c_alipay.trade.pay?pathHash=29c9a9ba&ref=api&scene=32
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.pay',
|
||||
'biz_content' => array_merge(
|
||||
[
|
||||
'scene' => 'bar_code',
|
||||
],
|
||||
$rocket->getParams(),
|
||||
),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/e81ed5f1_alipay.data.dataservice.bill.downloadurl.query?pathHash=3dde2faa&ref=api&scene=common
|
||||
*/
|
||||
class QueryBillUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][QueryBillUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][QueryBillUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/6f534d7f_alipay.trade.query?pathHash=98c03720&ref=api&scene=23
|
||||
*/
|
||||
class QueryPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/c1cb8815_alipay.trade.fastpay.refund.query?pathHash=6557d527&ref=api&scene=common
|
||||
*/
|
||||
class QueryRefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][QueryRefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.fastpay.refund.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][QueryRefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/3aea9b48_alipay.trade.refund?pathHash=04122275&ref=api&scene=common
|
||||
*/
|
||||
class RefundPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Pos][RefundPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.refund',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Pos][RefundPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfi?pathHash=45b45d97&ref=api&scene=common
|
||||
*/
|
||||
class CancelPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Scan][CancelPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.cancel',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Scan][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02o6e7?pathHash=7a011fc5&ref=api&scene=common
|
||||
*/
|
||||
class ClosePlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Scan][ClosePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.close',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Scan][ClosePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/f72f0792_alipay.trade.create?pathHash=8919111c&ref=api&scene=2d8d65b1350f44bfa394347f06700c4f
|
||||
*/
|
||||
class CreatePlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Scan][CreatePlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.create',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Scan][CreatePlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Exception\ContainerException;
|
||||
use Yansongda\Artful\Exception\ServiceNotFoundException;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
use Yansongda\Pay\Traits\SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/f540afd8_alipay.trade.precreate?pathHash=d3c84596&ref=api&scene=19
|
||||
*/
|
||||
class PayPlugin implements PluginInterface
|
||||
{
|
||||
use SupportServiceProviderTrait;
|
||||
|
||||
/**
|
||||
* @throws ContainerException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Scan][PayPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->loadAlipayServiceProvider($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.trade.precreate',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Scan][PayPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Artful\Contract\PluginInterface;
|
||||
use Yansongda\Artful\Logger;
|
||||
use Yansongda\Artful\Rocket;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02ekfm?pathHash=950726c8&ref=api&scene=common
|
||||
*/
|
||||
class QueryBillUrlPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[Alipay][Pay][Scan][QueryBillUrlPlugin] 插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => 'alipay.data.dataservice.bill.downloadurl.query',
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[Alipay][Pay][Scan][QueryBillUrlPlugin] 插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
}
|
||||
某些文件未显示,因为此 diff 中更改的文件太多 显示更多
在新工单中引用
屏蔽一个用户