mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
change: close 的 API 参数只支持 array,不再支持 string (#901)
This commit is contained in:
parent
b2d8e0f7ee
commit
381591c0b3
@ -8,6 +8,7 @@
|
||||
- change(internal): DirectionInterface 方法由 `parse` 改为 `guide`(#896)
|
||||
- change: 查询API方法由 `find` 改为 `query`,同时参数只支持 array(#897)
|
||||
- change: cancel 的 API 参数只支持 array,不再支持 string(#890)
|
||||
- change: close 的 API 参数只支持 array,不再支持 string(#891)
|
||||
|
||||
## v3.5.3
|
||||
|
||||
|
@ -25,7 +25,7 @@ interface ProviderInterface
|
||||
|
||||
public function cancel(array $order): null|array|Collection;
|
||||
|
||||
public function close(array|string $order): null|array|Collection;
|
||||
public function close(array $order): null|array|Collection;
|
||||
|
||||
public function refund(array $order): array|Collection;
|
||||
|
||||
|
@ -83,10 +83,8 @@ class Alipay extends AbstractProvider
|
||||
* @throws InvalidParamsException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function close(array|string $order): null|array|Collection
|
||||
public function close(array $order): null|array|Collection
|
||||
{
|
||||
$order = is_array($order) ? $order : ['out_trade_no' => $order];
|
||||
|
||||
Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null));
|
||||
|
||||
return $this->__call('close', [$order]);
|
||||
|
@ -74,7 +74,7 @@ class Unipay extends AbstractProvider
|
||||
/**
|
||||
* @throws InvalidParamsException
|
||||
*/
|
||||
public function close(array|string $order): null|array|Collection
|
||||
public function close(array $order): null|array|Collection
|
||||
{
|
||||
throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Unipay does not support close api');
|
||||
}
|
||||
|
@ -84,10 +84,8 @@ class Wechat extends AbstractProvider
|
||||
* @throws InvalidParamsException
|
||||
* @throws ServiceNotFoundException
|
||||
*/
|
||||
public function close(array|string $order): null|array|Collection
|
||||
public function close(array $order): null|array|Collection
|
||||
{
|
||||
$order = is_array($order) ? $order : ['out_trade_no' => $order];
|
||||
|
||||
Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null));
|
||||
|
||||
$this->__call('close', [$order]);
|
||||
|
@ -141,7 +141,7 @@ class FooProviderStub extends AbstractProvider
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function close(array|string $order): Collection
|
||||
public function close(array $order): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ Q0C300Eo+XOoO4M1WvsRBAF13g9RPSw=\r
|
||||
self::expectException(InvalidParamsException::class);
|
||||
self::expectExceptionCode(Exception::METHOD_NOT_SUPPORTED);
|
||||
|
||||
Pay::unipay()->close('foo');
|
||||
Pay::unipay()->close(['foo']);
|
||||
}
|
||||
|
||||
public function testRefund()
|
||||
|
@ -66,7 +66,7 @@ class WechatTest extends TestCase
|
||||
$http->shouldReceive('sendRequest')->andReturn($response);
|
||||
Pay::set(HttpClientInterface::class, $http);
|
||||
|
||||
Pay::wechat()->close('foo');
|
||||
Pay::wechat()->close(['out_trade_no' => '123']);
|
||||
|
||||
self::assertTrue(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user