mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
feat: 增加支付宝 分账关系维护/分账查询 插件 (#874)
This commit is contained in:
parent
0ca35cfb97
commit
6db99832ae
@ -1,4 +1,8 @@
|
||||
## v3.5.3-TBD
|
||||
## v3.5.3
|
||||
|
||||
### feat
|
||||
|
||||
- feat: 增加支付宝 分账关系维护/分账查询 插件(#874)
|
||||
|
||||
### optimized
|
||||
|
||||
|
18
src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php
Normal file
18
src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02pj6l?ref=api
|
||||
*/
|
||||
class OrderSettleQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'alipay.trade.order.settle.query';
|
||||
}
|
||||
}
|
18
src/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPlugin.php
Normal file
18
src/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPlugin.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02c7hs?ref=api
|
||||
*/
|
||||
class RoyaltyRelationBatchQueryPlugin extends GeneralPlugin
|
||||
{
|
||||
protected function getMethod(): string
|
||||
{
|
||||
return 'alipay.trade.royalty.relation.batchquery';
|
||||
}
|
||||
}
|
18
src/Plugin/Alipay/Trade/RoyaltyRelationBindPlugin.php
Normal file
18
src/Plugin/Alipay/Trade/RoyaltyRelationBindPlugin.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02c7hq?ref=api
|
||||
*/
|
||||
class RoyaltyRelationBindPlugin extends GeneralPlugin
|
||||
{
|
||||
public function getMethod(): string
|
||||
{
|
||||
return 'alipay.trade.royalty.relation.bind';
|
||||
}
|
||||
}
|
18
src/Plugin/Alipay/Trade/RoyaltyRelationUnbindPlugin.php
Normal file
18
src/Plugin/Alipay/Trade/RoyaltyRelationUnbindPlugin.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
|
||||
|
||||
/**
|
||||
* @see https://opendocs.alipay.com/open/02c7hr?ref=api
|
||||
*/
|
||||
class RoyaltyRelationUnbindPlugin extends GeneralPlugin
|
||||
{
|
||||
public function getMethod(): string
|
||||
{
|
||||
return 'alipay.trade.royalty.relation.unbind';
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class AppPayPluginTest extends TestCase
|
||||
{
|
||||
protected $plugin;
|
||||
protected AppPayPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
31
tests/Plugin/Alipay/Trade/OrderSettleQueryPluginTest.php
Normal file
31
tests/Plugin/Alipay/Trade/OrderSettleQueryPluginTest.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Yansongda\Pay\Tests\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Direction\ResponseDirection;
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\AppPayPlugin;
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\OrderSettleQueryPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class OrderSettleQueryPluginTest extends TestCase
|
||||
{
|
||||
protected OrderSettleQueryPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->plugin = new OrderSettleQueryPlugin();
|
||||
}
|
||||
|
||||
public function testNormal()
|
||||
{
|
||||
$rocket = new Rocket();
|
||||
$rocket->setParams([]);
|
||||
|
||||
$result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; });
|
||||
|
||||
self::assertStringContainsString('alipay.trade.order.settle.query', $result->getPayload()->toJson());
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class PagePayPluginTest extends TestCase
|
||||
{
|
||||
protected $plugin;
|
||||
protected PagePayPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class PageRefundPluginTest extends TestCase
|
||||
{
|
||||
protected $plugin;
|
||||
protected PageRefundPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class PayPluginTest extends TestCase
|
||||
{
|
||||
protected $plugin;
|
||||
protected PayPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Yansongda\Pay\Tests\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBatchQueryPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class RoyaltyRelationBatchQueryPluginTest extends TestCase
|
||||
{
|
||||
protected RoyaltyRelationBatchQueryPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->plugin = new RoyaltyRelationBatchQueryPlugin();
|
||||
}
|
||||
|
||||
public function testNormal()
|
||||
{
|
||||
$rocket = new Rocket();
|
||||
$rocket->setParams([]);
|
||||
|
||||
$result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; });
|
||||
|
||||
self::assertStringContainsString('alipay.trade.royalty.relation.batchquery', $result->getPayload()->toJson());
|
||||
}
|
||||
}
|
29
tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php
Normal file
29
tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Yansongda\Pay\Tests\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBindPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class RoyaltyRelationBindPluginTest extends TestCase
|
||||
{
|
||||
protected RoyaltyRelationBindPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->plugin = new RoyaltyRelationBindPlugin();
|
||||
}
|
||||
|
||||
public function testNormal()
|
||||
{
|
||||
$rocket = new Rocket();
|
||||
$rocket->setParams([]);
|
||||
|
||||
$result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; });
|
||||
|
||||
self::assertStringContainsString('alipay.trade.royalty.relation.bind', $result->getPayload()->toJson());
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Yansongda\Pay\Tests\Plugin\Alipay\Trade;
|
||||
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBatchQueryPlugin;
|
||||
use Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationUnbindPlugin;
|
||||
use Yansongda\Pay\Rocket;
|
||||
use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class RoyaltyRelationUnbindPluginTest extends TestCase
|
||||
{
|
||||
protected RoyaltyRelationUnbindPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->plugin = new RoyaltyRelationUnbindPlugin();
|
||||
}
|
||||
|
||||
public function testNormal()
|
||||
{
|
||||
$rocket = new Rocket();
|
||||
$rocket->setParams([]);
|
||||
|
||||
$result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; });
|
||||
|
||||
self::assertStringContainsString('alipay.trade.royalty.relation.unbind', $result->getPayload()->toJson());
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ use Yansongda\Pay\Tests\TestCase;
|
||||
|
||||
class WapPluginTest extends TestCase
|
||||
{
|
||||
protected $plugin;
|
||||
protected WapPayPlugin $plugin;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -135,3 +135,21 @@ $result = Pay::alipay()->pay($allPlugins, $params);
|
||||
### 协议由普通通用代扣协议产品转移到周期扣协议产品
|
||||
|
||||
- `Yansongda\Pay\Plugin\Alipay\User\AgreementTransferPlugin`
|
||||
|
||||
## 交易
|
||||
|
||||
### 交易分账查询接口
|
||||
|
||||
- `Yansongda\Pay\Plugin\Alipay\Trade\OrderSettleQueryPlugin`
|
||||
|
||||
### 分账关系查询
|
||||
|
||||
- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBatchQueryPlugin`
|
||||
|
||||
### 分账关系绑定
|
||||
|
||||
- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBindPlugin`
|
||||
|
||||
### 分账关系解绑
|
||||
|
||||
- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationUnbindPlugin`
|
||||
|
Loading…
Reference in New Issue
Block a user