mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
update
This commit is contained in:
parent
f78d464342
commit
737b226daa
@ -30,7 +30,7 @@ abstract class AbstractProvider implements ProviderInterface
|
||||
*
|
||||
* @return \Yansongda\Supports\Collection|\Psr\Http\Message\ResponseInterface
|
||||
*/
|
||||
public function call(string $plugin, array $params)
|
||||
public function call(string $plugin, array $params = [])
|
||||
{
|
||||
if (!class_exists($plugin) || !in_array(ShortcutInterface::class, class_implements($plugin))) {
|
||||
throw new InvalidParamsException(InvalidParamsException::SHORTCUT_NOT_FOUND, "[$plugin] is not incompatible");
|
||||
@ -42,8 +42,7 @@ abstract class AbstractProvider implements ProviderInterface
|
||||
$money = Pay::get($plugin);
|
||||
|
||||
return $this->pay(
|
||||
$this->mergeCommonPlugins($money->getPlugins(...$params)),
|
||||
...$params
|
||||
$this->mergeCommonPlugins($money->getPlugins($params)), $params
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -110,28 +110,39 @@ class FooProviderStub extends AbstractProvider
|
||||
{
|
||||
public function find($order): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function cancel($order): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function close($order): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function refund(array $order): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function verify($contents = null, ?array $params = null): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
public function success(): ResponseInterface
|
||||
{
|
||||
}
|
||||
|
||||
public function mergeCommonPlugins(array $plugins): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
class FooPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
|
Loading…
Reference in New Issue
Block a user