mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
update
This commit is contained in:
parent
d808fc96f5
commit
8b5b93dd8f
9
src/Plugin/Wechat/Pay/App/ClosePlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/ClosePlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class ClosePlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\ClosePlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/DownloadBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/DownloadBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class DownloadBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\DownloadBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/FindRefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/FindRefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/GetFlowBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/GetFlowBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class GetFlowBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetFlowBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/GetTradeBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/GetTradeBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class GetTradeBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetTradeBillPlugin
|
||||
{
|
||||
}
|
15
src/Plugin/Wechat/Pay/App/PrepayPlugin.php
Normal file
15
src/Plugin/Wechat/Pay/App/PrepayPlugin.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class PrepayPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\PrepayPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/app';
|
||||
}
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/QueryPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/QueryPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class QueryPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/App/RefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/App/RefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\App;
|
||||
|
||||
class RefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\RefundPlugin
|
||||
{
|
||||
}
|
33
src/Plugin/Wechat/Pay/Common/ClosePlugin.php
Normal file
33
src/Plugin/Wechat/Pay/Common/ClosePlugin.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
class ClosePlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/out-trade-no/'.
|
||||
($rocket->getParams()['out_trade_no'] ?? '').
|
||||
'/close';
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
$rocket->setPayload(new Collection([
|
||||
'mchid' => $config->get('mch_id', ''),
|
||||
]));
|
||||
}
|
||||
}
|
26
src/Plugin/Wechat/Pay/Common/DownloadBillPlugin.php
Normal file
26
src/Plugin/Wechat/Pay/Common/DownloadBillPlugin.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class DownloadBillPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return $rocket->getParams()['download_url'] ?? '';
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
26
src/Plugin/Wechat/Pay/Common/FindRefundPlugin.php
Normal file
26
src/Plugin/Wechat/Pay/Common/FindRefundPlugin.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class FindRefundPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/refund/domestic/refunds/'.($rocket->getParams()['out_refund_no'] ?? '');
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
26
src/Plugin/Wechat/Pay/Common/GetFlowBillPlugin.php
Normal file
26
src/Plugin/Wechat/Pay/Common/GetFlowBillPlugin.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class GetFlowBillPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/bill/fundflowbill?'.http_build_query($rocket->getParams());
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
26
src/Plugin/Wechat/Pay/Common/GetTradeBillPlugin.php
Normal file
26
src/Plugin/Wechat/Pay/Common/GetTradeBillPlugin.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class GetTradeBillPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/bill/tradebill?'.http_build_query($rocket->getParams());
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
37
src/Plugin/Wechat/Pay/Common/PrepayPlugin.php
Normal file
37
src/Plugin/Wechat/Pay/Common/PrepayPlugin.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class PrepayPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/jsapi';
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
$payload = [
|
||||
'appid' => $config->get('mp_app_id', ''),
|
||||
'mchid' => $config->get('mch_id', ''),
|
||||
];
|
||||
|
||||
if (!$rocket->getPayload()->has('notify_url')) {
|
||||
$payload['notify_url'] = $config->get('notify_url');
|
||||
}
|
||||
|
||||
$rocket->mergePayload($payload);
|
||||
}
|
||||
}
|
35
src/Plugin/Wechat/Pay/Common/QueryPlugin.php
Normal file
35
src/Plugin/Wechat/Pay/Common/QueryPlugin.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class QueryPlugin extends GeneralPlugin
|
||||
{
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
return 'v3/pay/transactions/id/'.
|
||||
($rocket->getParams()['transaction_id'] ?? '').
|
||||
'?mchid='.$config->get('mch_id', '');
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
20
src/Plugin/Wechat/Pay/Common/RefundPlugin.php
Normal file
20
src/Plugin/Wechat/Pay/Common/RefundPlugin.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Common;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class RefundPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/refund/domestic/refunds';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
}
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/ClosePlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/ClosePlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class ClosePlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\ClosePlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/DownloadBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/DownloadBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class DownloadBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\DownloadBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/FindRefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/FindRefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/GetFlowBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/GetFlowBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class GetFlowBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetFlowBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/GetTradeBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/GetTradeBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class GetTradeBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetTradeBillPlugin
|
||||
{
|
||||
}
|
15
src/Plugin/Wechat/Pay/H5/PrepayPlugin.php
Normal file
15
src/Plugin/Wechat/Pay/H5/PrepayPlugin.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class PrepayPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\PrepayPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/h5';
|
||||
}
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/QueryPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/QueryPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class QueryPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/H5/RefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/H5/RefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\H5;
|
||||
|
||||
class RefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\RefundPlugin
|
||||
{
|
||||
}
|
@ -4,30 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
class ClosePlugin extends GeneralPlugin
|
||||
class ClosePlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\ClosePlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/out-trade-no/'.
|
||||
($rocket->getParams()['out_trade_no'] ?? '').
|
||||
'/close';
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
$rocket->setPayload(new Collection([
|
||||
'mchid' => $config->get('mch_id', ''),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
@ -4,23 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class DownloadBillPlugin extends GeneralPlugin
|
||||
class DownloadBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\DownloadBillPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return $rocket->getParams()['download_url'] ?? '';
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
||||
|
@ -4,23 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class FindRefundPlugin extends GeneralPlugin
|
||||
class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/refund/domestic/refunds/'.($rocket->getParams()['out_refund_no'] ?? '');
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
||||
|
@ -4,23 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class GetFlowBillPlugin extends GeneralPlugin
|
||||
class GetFlowBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetFlowBillPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/bill/fundflowbill?'.http_build_query($rocket->getParams());
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
||||
|
@ -4,23 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class GetTradeBillPlugin extends GeneralPlugin
|
||||
class GetTradeBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetTradeBillPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/bill/tradebill?'.http_build_query($rocket->getParams());
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
||||
|
@ -4,29 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class PrepayPlugin extends GeneralPlugin
|
||||
class PrepayPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\PrepayPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/jsapi';
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
$rocket->mergePayload([
|
||||
'appid' => $config->get('mp_app_id', ''),
|
||||
'mchid' => $config->get('mch_id', ''),
|
||||
'notify_url' => $config->get('notify_url'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -4,32 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class QueryPlugin extends GeneralPlugin
|
||||
class QueryPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin
|
||||
{
|
||||
/**
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*/
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
$config = get_wechat_config($rocket->getParams());
|
||||
|
||||
return 'v3/pay/transactions/id/'.
|
||||
($rocket->getParams()['transaction_id'] ?? '').
|
||||
'?mchid='.$config->get('mch_id', '');
|
||||
}
|
||||
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'GET';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
$rocket->setPayload(null);
|
||||
}
|
||||
}
|
||||
|
@ -4,17 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Jsapi;
|
||||
|
||||
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class RefundPlugin extends GeneralPlugin
|
||||
class RefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\RefundPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/refund/domestic/refunds';
|
||||
}
|
||||
|
||||
protected function checkPayload(Rocket $rocket): void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
9
src/Plugin/Wechat/Pay/Mini/ClosePlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/ClosePlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class ClosePlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\ClosePlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/DownloadBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/DownloadBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class DownloadBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\DownloadBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/FindRefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/FindRefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/GetFlowBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/GetFlowBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class GetFlowBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetFlowBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/GetTradeBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/GetTradeBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class GetTradeBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetTradeBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/PrepayPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/PrepayPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class PrepayPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\PrepayPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/QueryPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/QueryPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class QueryPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Mini/RefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Mini/RefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Mini;
|
||||
|
||||
class RefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\RefundPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/ClosePlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/ClosePlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class ClosePlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\ClosePlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/DownloadBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/DownloadBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class DownloadBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\DownloadBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/FindRefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/FindRefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/GetFlowBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/GetFlowBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class GetFlowBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetFlowBillPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/GetTradeBillPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/GetTradeBillPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class GetTradeBillPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\GetTradeBillPlugin
|
||||
{
|
||||
}
|
15
src/Plugin/Wechat/Pay/Native/PrepayPlugin.php
Normal file
15
src/Plugin/Wechat/Pay/Native/PrepayPlugin.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
class PrepayPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\PrepayPlugin
|
||||
{
|
||||
protected function getUri(Rocket $rocket): string
|
||||
{
|
||||
return 'v3/pay/transactions/native';
|
||||
}
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/QueryPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/QueryPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class QueryPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin
|
||||
{
|
||||
}
|
9
src/Plugin/Wechat/Pay/Native/RefundPlugin.php
Normal file
9
src/Plugin/Wechat/Pay/Native/RefundPlugin.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Wechat\Pay\Native;
|
||||
|
||||
class RefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\RefundPlugin
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue
Block a user