- 框架初始化
 - 安装插件
 - 修复PHP8.4报错
This commit is contained in:
2025-04-19 17:21:20 +08:00
commit c6a4e1f5f6
5306 changed files with 967782 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=800&apiservId=468&version=V2.2&bussType=0
*/
class CancelPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '31',
'txnSubType' => '00',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=798&apiservId=468&version=V2.2&bussType=0
*/
class PosNormalPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '01',
'txnSubType' => '06',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=797&apiservId=468&version=V2.2&bussType=0
*/
class PosPreAuthPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000201',
'txnType' => '02',
'txnSubType' => '04',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Exception\ContainerException;
use Yansongda\Pay\Exception\ServiceNotFoundException;
use Yansongda\Pay\Pay;
use Yansongda\Pay\Rocket;
use function Yansongda\Pay\get_unipay_config;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=792&apiservId=468&version=V2.2&bussType=0
*/
class QueryPlugin extends \Yansongda\Pay\Plugin\Unipay\OnlineGateway\QueryPlugin
{
/**
* @throws ContainerException
* @throws ServiceNotFoundException
*/
protected function getUri(Rocket $rocket): string
{
$config = get_unipay_config($rocket->getParams());
if (Pay::MODE_SANDBOX === ($config['mode'] ?? Pay::MODE_NORMAL)) {
return 'https://101.231.204.80:5000/gateway/api/backTransReq.do';
}
return parent::getUri($rocket);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=799&apiservId=468&version=V2.2&bussType=0
*/
class RefundPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '04',
'txnSubType' => '00',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=796&apiservId=468&version=V2.2&bussType=0
*/
class ScanFeePlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000601',
'txnType' => '13',
'txnSubType' => '08',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=793&apiservId=468&version=V2.2&bussType=0
*/
class ScanNormalPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '01',
'txnSubType' => '07',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=794&apiservId=468&version=V2.2&bussType=0
*/
class ScanPreAuthPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/backTransReq.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '02',
'txnSubType' => '05',
'channelType' => '08',
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
use Yansongda\Pay\Plugin\Unipay\GeneralPlugin;
use Yansongda\Pay\Rocket;
/**
* @see https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=795&apiservId=468&version=V2.2&bussType=0
*/
class ScanPreOrderPlugin extends GeneralPlugin
{
protected function getUri(Rocket $rocket): string
{
return 'gateway/api/order.do';
}
protected function doSomething(Rocket $rocket): void
{
$rocket->mergePayload([
'bizType' => '000000',
'txnType' => '01',
'txnSubType' => '01',
'channelType' => '08',
]);
}
}